Mark Sapiro wrote:
> The attached patch is an example of how this could be done.
Here's an updated patch. The only difference is it uses
email.Utils.formatdate() instead of strftime() to create the date/time
string.
--
Mark Sapiro <[email protected]> The highway is for gamblers,
San Francisco Bay Area, California better use your sense - B. Dylan
--- /var/MM/21/Mailman/MailList.py 2014-03-15 10:21:18.915725783 -0700
+++ MailList.py 2014-03-15 14:53:50.791317003 -0700
@@ -38,7 +38,7 @@
from types import *
import email.Iterators
-from email.Utils import getaddresses, formataddr, parseaddr
+from email.Utils import getaddresses, formataddr, formatdate, parseaddr
from email.Header import Header
from Mailman import mm_cfg
@@ -897,9 +897,16 @@
# accept a userdesc instance.
cookie = self.pend_new(Pending.SUBSCRIPTION, userdesc)
# Send the user the confirmation mailback
+ rcvd = None
if remote is None:
by = remote = ''
else:
+ if re.match(r'^\d+\.\d+\.\d+\.\d+$', remote):
+ rcvd = 'from %s by %s with HTTP; %s' % (
+ remote,
+ self.host_name,
+ formatdate(localtime=True),
+ )
by = ' ' + remote
remote = _(' from %(remote)s')
@@ -932,6 +939,8 @@
autosub = 'auto-generated'
del msg['auto-submitted']
msg['Auto-Submitted'] = autosub
+ if rcvd:
+ msg._headers.insert(0, ('Received', rcvd))
msg.send(self)
who = formataddr((name, email))
syslog('subscribe', '%s: pending %s %s',
------------------------------------------------------
Mailman-Users mailing list [email protected]
https://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe:
https://mail.python.org/mailman/options/mailman-users/archive%40jab.org