summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJens Vagelpohl <jens@netz.ooo>2004-09-07 21:19:37 +0000
committerJens Vagelpohl <jens@netz.ooo>2004-09-07 21:19:37 +0000
commit35cb001c736a489f10c2cde5ea5bf154cd4bf5ea (patch)
tree409620d87a1e018a041bebb3b4f11cf92d0b583b
parente32a7441df267dbdb3d1a6bc31da01159d469c8c (diff)
downloadViewsManager-35cb001c736a489f10c2cde5ea5bf154cd4bf5ea.zip
ViewsManager-35cb001c736a489f10c2cde5ea5bf154cd4bf5ea.tar.gz
- Fix for JTracker issue 386: Use the rfc822 module to help parse
addresses.
-rw-r--r--CHANGES.txt10
-rwxr-xr-xmaildrop/maildrop.py6
2 files changed, 14 insertions, 2 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index b89412e..9b56b60 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,5 +1,14 @@
MaildropHost version and change information
+ 1.8
+
+ * Bugs fixed:
+
+ - Address parsing in the maildrop script could get confused by commas
+ inside an address. A solution as proposed by Maik Jablonski
+ (JTracker issue 386) involves using the rfc822 module.
+
+
1.7
* Bugs fixed:
@@ -12,6 +21,7 @@ MaildropHost version and change information
- Fixed missing SMTP_PORT in "send-mail"-part of maildrop.py
(Maik Jablonski).
+
1.6
As of this release the MaildropHost product is distributed under
diff --git a/maildrop/maildrop.py b/maildrop/maildrop.py
index 6c9a747..21da1a4 100755
--- a/maildrop/maildrop.py
+++ b/maildrop/maildrop.py
@@ -42,7 +42,7 @@ Options:
Drop only x mails in one smtp-connection (defaults to 0 = all mails at once)
"""
-import getopt, smtplib, os, sys, time
+import getopt, smtplib, os, sys, time, rfc822
DEBUG = 0
MAILDROP_INTERVAL = 120
@@ -220,7 +220,9 @@ while 1:
# Create mail and send it off
h_from = mail_dict.get( 'From' )
h_to = mail_dict.get( 'To' )
- h_to_list = h_to.split( ',' )
+ h_to_list = []
+ for item in rfc822.AddressList(h_to):
+ h_to_list.append(item[1])
h_body = mail_dict.get( 'body' )
try: