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 = "[EMAIL PROTECTED]"
 
     fullname = ""
     extract = False



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to