accepting posts based on a header-field
![](https://secure.gravatar.com/avatar/c27d8114f38f5bb4f3d64cc73788def1.jpg?s=120&d=mm&r=g)
hi.
i have searched the faq and asked google but haven't found anything for my problem (so forgive me if i missed something obvious):
my basic problem is, that i want to forward mails from one mailing list to another (on both lists only subscribers can post): the setting is as follows: there is an "announce"-list and a "users"-list; mails going to the "announce"-list should also go to the "users"-list, so people don't have to subscribe to both lists the subscribers to both lists overlap, but there are a lot of users subscribed to only one of them.
so my first attempt was, to just subscribe "users" to the "announce" list, but as soon as somebody who is subscribed to "announce" but NOT to "users" posts to the announce-list, the mail is held for approval in the "users" list. this is rather inconvenient.
so my second thought was to auto-accept postings to the "users" list which has a special header-field (i thought that the "List-ID"-field would just be ok for my purposes). unfortunately i found that this wasn't possible (i am running debian and tried both 2.1.5-8sarge2 (which is basically 2.1.5 with some cross-site-scripting security issues fixed) and 2.1.8)
the only header-field i found which could be used for auto-accepting is the the "Approved: <moderator-password>".
so i did a quick hack to handle this at the MTA-level <sidenote> i didn't want to patch mailman itself, because this is only a rather long-term solution: wait until the patch gets accepted upstream; then wait until the upstream version is in debian (and with the debian way of releasing this will take years until it is in the stable branch which i prefer for my servers); in the meantime i could either run the newest mailman release (from source) or patch each and every security update of the debian-package. </sidenote>
basically now my working setting is like this (using mailman, exim4, procmail) "users" is subscribed to "announce". mails for "users" are not directly delivered to the mailman-wrapper by the MTA but instead it is first piped through procmail. if any mail directed to "users" appears to come from "announce" (based on the "List-ID" header field) i add another header "Approved: <mod-pw>" with formail, before it gets delivered to the mailman-wrapper for "users".
of course this is not very secure (but not much less secure then accepting mails based on the "From:" field)
however, since this was a bit of work and somewhat hackish (though only configuration and no patching was involved) my question is: is there as simpler way to acchieve this? would an option for each mailing list to auto-accept mails with a special header (perferrably a regex) make sense (feature-request)? or - if my setup is of some use for others - should i post a short howto somewhere (where)?
mfg.asd.r IOhannes
![](https://secure.gravatar.com/avatar/746f7519ba02fb0d815e59f305c53fa2.jpg?s=120&d=mm&r=g)
IEM - network operating center wrote:
There is a patch <http://sourceforge.net/tracker/index.php?func=detail&aid=1220144&group_id=103&atid=300103> which would allow you to specify the "announce" list in the "users" list's accept_these_nonmembers. This would solve your problem and is a candidate for inclusion in Mailman 2.2, but in the mean time it is still a patch which you don't want to do.
You could do this with a custom handler which is not a patch in that once it is implemented and installed, it survives upgrades. See <http://www.python.org/cgi-bin/faqw-mm.py?req=show&file=faq04.067.htp> for info on custom handlers and see Mailman/Handlers/Approve.py for details of what needs to be done to accept a post based on a header - basically, recognize the header and set the 'approved' flag in the message metadata.
-- Mark Sapiro <msapiro@value.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
![](https://secure.gravatar.com/avatar/c27d8114f38f5bb4f3d64cc73788def1.jpg?s=120&d=mm&r=g)
Mark Sapiro wrote:
yes true, i thought of that. but then i didn't want to spend to much time in learning how to do such a handler in a "clean" way. it is quite important to me that code and configuration are kept separately. i guess this is possible (but i haven't dived too deep into this) as far as i could overlook the custom handler thing, it also means that i would have to add such handler for each mailing list (e.g. copy the code snippet to each list i would want to enable my feature). so it was all too much of a hazzle...
anyhow, i have set up a small HOW-TO about my solution (using exim&procmail) at http://iem.at/Members/zmoelnig/mailmanprocmail
feel free, if you want to put it into a more "official" place.
mfg.asd.r IOhannes
![](https://secure.gravatar.com/avatar/746f7519ba02fb0d815e59f305c53fa2.jpg?s=120&d=mm&r=g)
IEM - network operating center wrote:
There is a patch <http://sourceforge.net/tracker/index.php?func=detail&aid=1220144&group_id=103&atid=300103> which would allow you to specify the "announce" list in the "users" list's accept_these_nonmembers. This would solve your problem and is a candidate for inclusion in Mailman 2.2, but in the mean time it is still a patch which you don't want to do.
You could do this with a custom handler which is not a patch in that once it is implemented and installed, it survives upgrades. See <http://www.python.org/cgi-bin/faqw-mm.py?req=show&file=faq04.067.htp> for info on custom handlers and see Mailman/Handlers/Approve.py for details of what needs to be done to accept a post based on a header - basically, recognize the header and set the 'approved' flag in the message metadata.
-- Mark Sapiro <msapiro@value.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
![](https://secure.gravatar.com/avatar/c27d8114f38f5bb4f3d64cc73788def1.jpg?s=120&d=mm&r=g)
Mark Sapiro wrote:
yes true, i thought of that. but then i didn't want to spend to much time in learning how to do such a handler in a "clean" way. it is quite important to me that code and configuration are kept separately. i guess this is possible (but i haven't dived too deep into this) as far as i could overlook the custom handler thing, it also means that i would have to add such handler for each mailing list (e.g. copy the code snippet to each list i would want to enable my feature). so it was all too much of a hazzle...
anyhow, i have set up a small HOW-TO about my solution (using exim&procmail) at http://iem.at/Members/zmoelnig/mailmanprocmail
feel free, if you want to put it into a more "official" place.
mfg.asd.r IOhannes
participants (2)
-
IEM - network operating center
-
Mark Sapiro