diff options
author | Matěj Cepl <mcepl@redhat.com> | 2014-03-17 15:36:36 +0100 |
---|---|---|
committer | Matěj Cepl <mcepl@redhat.com> | 2014-03-17 15:36:36 +0100 |
commit | fd0dcabe2cb54f2365abe1af0eac603bcf8901a4 (patch) | |
tree | 353cc8024c3d610caa31a4b8845f59700d312f53 /gg_scraper.py | |
parent | eba58b1bc92b21fae2761b7ffbcc626c0c4034eb (diff) | |
download | gg_scraper-fd0dcabe2cb54f2365abe1af0eac603bcf8901a4.tar.gz |
Fix logic to actually demangle the mbox.
Diffstat (limited to 'gg_scraper.py')
-rwxr-xr-x | gg_scraper.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gg_scraper.py b/gg_scraper.py index 640d304..0f3c5ab 100755 --- a/gg_scraper.py +++ b/gg_scraper.py @@ -51,7 +51,7 @@ logging.basicConfig(format='%(levelname)s:%(funcName)s:%(message)s', ADDR_SEC_LABEL = 'addresses' MANGLED_ADDR_RE = re.compile( - r'([a-zA-Z0-9_.+-]+\.\.\.@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+)', + r'([a-zA-Z0-9_.+-]+(\.)+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+)', re.IGNORECASE) __version__ = '0.7' @@ -349,7 +349,7 @@ def demangle(correct_list, orig_mbx, out_mbx): if matches is not None: u_from = msg.get_from() for orig, fixed in pairs.items(): - if (orig is not None) and (fixed is not None): + if (orig is None) or (fixed is None): continue msg_str = msg_str.replace(orig, fixed) out_msg = mailbox.mboxMessage(msg_str) |