aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--b4/__init__.py4
-rw-r--r--b4/ez.py5
2 files changed, 7 insertions, 2 deletions
diff --git a/b4/__init__.py b/b4/__init__.py
index 0bc8f27..798755c 100644
--- a/b4/__init__.py
+++ b/b4/__init__.py
@@ -2915,6 +2915,10 @@ def cleanup_email_addrs(addresses: List[Tuple[str, str]], excludes: Set[str],
gitdir: Optional[str]) -> List[Tuple[str, str]]:
global MAILMAP_INFO
for entry in list(addresses):
+ # Only qualified addresses, please
+ if not len(entry[1].strip()) or '@' not in entry[1]:
+ addresses.remove(entry)
+ continue
# Check if it's in excludes
removed = False
for exclude in excludes:
diff --git a/b4/ez.py b/b4/ez.py
index 3e6581c..ec331d0 100644
--- a/b4/ez.py
+++ b/b4/ez.py
@@ -819,7 +819,7 @@ def cmd_ez_send(cmdargs: argparse.Namespace) -> None:
# add addresses seen in trailers
for trailer in trailers:
- if '@' in trailer[1]:
+ if '@' in trailer[1] and '<' in trailer[1]:
for pair in utils.getaddresses([trailer[1]]):
if pair[1] not in seen:
seen.add(pair[1])
@@ -907,7 +907,8 @@ def cmd_ez_send(cmdargs: argparse.Namespace) -> None:
ztracking = gzip.compress(bytes(json.dumps(tracking), 'utf-8'))
b64tracking = base64.b64encode(ztracking)
cmsg.add_header('X-b4-tracking', ' '.join(textwrap.wrap(b64tracking.decode(), width=78)))
- msg.add_header('To', b4.format_addrs(allto))
+
+ msg.add_header('To', b4.format_addrs(allto))
if allcc:
msg.add_header('Cc', b4.format_addrs(allcc))
logger.info(' %s', msg.get('Subject'))