You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by no...@apache.org on 2007/01/12 12:23:27 UTC

svn commit: r495557 - /james/server/trunk/src/python/sendmail.py

Author: norman
Date: Fri Jan 12 03:23:25 2007
New Revision: 495557

URL: http://svn.apache.org/viewvc?view=rev&rev=495557
Log:
sendmail.py doesn't handle multiple TO-recipients. Thx to Stephan Sann for this patch. See JAMES-662

Modified:
    james/server/trunk/src/python/sendmail.py

Modified: james/server/trunk/src/python/sendmail.py
URL: http://svn.apache.org/viewvc/james/server/trunk/src/python/sendmail.py?view=diff&rev=495557&r1=495556&r2=495557
==============================================================================
--- james/server/trunk/src/python/sendmail.py (original)
+++ james/server/trunk/src/python/sendmail.py Fri Jan 12 03:23:25 2007
@@ -47,8 +47,17 @@
     for header in headers:
         if header.startswith("To:"):
             if extract:
-                to = header[3:]
-                to_addrs.append(to[("<" + to).rfind("<"):(to + ">").find(">")])
+
+                #to = header[3:]
+                #to_addrs.append(to[("<" + to).rfind("<"):(to + ">").find(">")])
+
+                allRecipientsString = header[3:]
+                allRecipientsArray = allRecipientsString.split(',')
+                
+                for recipient in allRecipientsArray:
+
+                  to_addrs.append(recipient[("<" + recipient).rfind("<"):(recipient + ">").find(">")])
+
         elif header.startswith("From:"):
             hasFrom = True
            
@@ -74,7 +83,7 @@
         sys.exit(2)
 
     to_addrs = list
-    from_addr = os.environ['USER'] + '@' + socket.getfqdn()
+    from_addr = "postmaster@localhost"
 
     fullname = ""
     extract = False



---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org