Re: [Mailman-Users] 'Dynamic' footer

2014-03-15 Thread Rodti MacLeary

On 13 Mar 2014, at 15:28, Mark Sapiro  wrote:

> For Mailman 2.1, the Mailman/Handlers/Decorate.py module (called by
> SMTPDirect.py during outgoing message processing) augments the
> replacement dictionary for headers and footers from a 'decoration-data'
> dictionary in the messages metadata if it exists.

Thanks Barry, Mark and Christian for these suggestions.  I’ll try them out this 
weekend :-)

r.
--
Mailman-Users mailing list Mailman-Users@python.org
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


Re: [Mailman-Users] Reducing false positives with spam markings with Gmail, etc.

2014-03-15 Thread Mark Sapiro
On 03/14/2014 03:16 PM, Cedric Knight wrote:
> 
> There are hints about this change at Gmail at
> ,
> that it might be a result of the "Precedence: bulk" header added to
> administrivia messages.


Most Mailman generated messages are Precedence: bulk. The use of
Precedence: headers is discouraged by RFC 2076, and I would consider not
adding the Precedence: bulk header to confirmations.

This would seem reasonable even though some confirmation messages are
actually spurious [1]. The question is should there be a Precedence
header at all, and if so, what should its value be?

[1] I once thoughtlessly posted an example of an unsubscribe URL using
real data for my address and this list, and now every time a search
engine web crawler crawls the list archive, I get an unsubscribe
confirmation request.

-- 
Mark Sapiro The highway is for gamblers,
San Francisco Bay Area, Californiabetter use your sense - B. Dylan
--
Mailman-Users mailing list Mailman-Users@python.org
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


Re: [Mailman-Users] Can confirmation messages use custom Received: headers?

2014-03-15 Thread Mark Sapiro
On 03/14/2014 02:42 PM, Yan Juras wrote:
> 
> I was looking at the Spamcop FAQ and noticed a brief comment about the 
> Received headers that some webmail interfaces add that list the IP address of 
> the client that used HTTP to submit the email via a webmail GUI, for example:
> 
> Received: from 66.191.176.186 by webmail-d137.sysops.aol.com (149.174.18.27) 
> with HTTP (WebMailUI); Sat, 13 Apr 2013 08:07:55 -0400
> 
> The Spamcop FAQ kind of implies that Spamcop will consider the source of the 
> HTTP (in this example, 66.191.176.186) as the sender, rather than the email 
> server that converted the HTTP to SMTP. I've not checked this at all, so I 
> may be reading into the FAQ.
> 
> So my question is this: can Mailman be configured in some straightforward way 
> to add a Received: header with the IP address of the host that requested the 
> subscription? I am not a Python programmer, but I am capable of making code 
> changes if necessary.


Received: headers and the circumstances in which they are added are
defined by RFC 5321 and its predecessors. They are to be added at the
beginning of the headers by servers that relay the message. The
implication is that the agent that generates the message (Mailman in
this case) should not be including a Received: header in the generated
message, but you could do it.

The attached patch is an example of how this could be done. Note that
the Received: header is inserted at the front of the msg._headers list
rather than setting it in the normal way which would add it at the end.

-- 
Mark Sapiro The highway is for gamblers,
San Francisco Bay Area, Californiabetter use your sense - B. Dylan
--- ../2.1/Mailman/MailList.py	2013-09-28 14:35:25.049175848 -0700
+++ Mailman/MailList.py	2014-03-15 10:02:56.659744673 -0700
@@ -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,
+   time.strftime('%a, %d %b %Y %X %z'),
+   )
 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 Mailman-Users@python.org
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

Re: [Mailman-Users] Configuration of New Mailman Instance

2014-03-15 Thread Mark Sapiro
On 03/14/2014 03:12 PM, Paul Crown wrote:
> 
> My scenerio:
> 
> Server W is running Apache2, and my initial config has
> http://lists.mydomain.com letting me login as admin and create new lists.
> Server P is running Postfix
> Server R is my mail-relay for outbound SMTP traffic unique to this domain
> 
> No messages are being sent out through R or any other server for that
> matter.
> No messages are being received by P.  (5.1.1 list-email address
> rejected: user unknown in relay recipient table.


Which server has Mailman installed?

It looks like W.

This can work, but I might install Mailman on P and configure Postfix on
P per .

If Mailman is on W, you have to configure Postfix on P to relay list
mail to W and have some kind of MTA/MDA on W to deliver that mail to
Mailman.

If Mailman is on P you need to share Mailman's file system or at least
$var-prefix via NFS or whatever between W and P.

Either way, you need to set SMTPHOST in Mailman/mm_cfg.py to point to R.

If your only issue is P's "user unknown in relay recipient table" see
 for how to get Mailman to write
it's virtual-mailman file which can be used as relay_recipient_maps on P.

-- 
Mark Sapiro The highway is for gamblers,
San Francisco Bay Area, Californiabetter use your sense - B. Dylan
--
Mailman-Users mailing list Mailman-Users@python.org
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


Re: [Mailman-Users] Configuration of New Mailman Instance

2014-03-15 Thread Mark Sapiro
On 03/15/2014 10:45 AM, Mark Sapiro wrote:
> 
> If your only issue is P's "user unknown in relay recipient table" see
>  for how to get Mailman to write
> it's virtual-mailman file which can be used as relay_recipient_maps on P.


Ooops... copy/paste error. That should be

... see  for how to get
Mailman to write it's virtual-mailman file ...

-- 
Mark Sapiro The highway is for gamblers,
San Francisco Bay Area, Californiabetter use your sense - B. Dylan
--
Mailman-Users mailing list Mailman-Users@python.org
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


Re: [Mailman-Users] Can confirmation messages use custom Received: headers?

2014-03-15 Thread Mark Sapiro
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 The highway is for gamblers,
San Francisco Bay Area, Californiabetter 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 Mailman-Users@python.org
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