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 13:51:31 UTC

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

Author: norman
Date: Fri Jan 12 04:51:30 2007
New Revision: 495563

URL: http://svn.apache.org/viewvc?view=rev&rev=495563
Log:
Handle KeyError in sendmail.py if os.environ['USER'] gives the exception. See JAMES-663

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=495563&r1=495562&r2=495563
==============================================================================
--- james/server/trunk/src/python/sendmail.py (original)
+++ james/server/trunk/src/python/sendmail.py Fri Jan 12 04:51:30 2007
@@ -83,8 +83,13 @@
         sys.exit(2)
 
     to_addrs = list
-    from_addr = "postmaster@localhost"
-
+    
+    try:
+        from_addr = os.environ['USER'] + '@' + socket.getfqdn()
+    except KeyError:
+        from_addr = "root@" + socket.getfqdn()
+        
+        
     fullname = ""
     extract = False
 



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


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

Posted by "Noel J. Bergman" <no...@devtech.com>.
> +    except KeyError:
> +        from_addr = "root@" + socket.getfqdn()

Why are we defaulting to root@?

	--- Noel



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