procmail
[Top] [All Lists]

Re: Lists and procmail

2005-04-21 14:33:48
A#em-notif-dl
em-notif-dl: "|/usr/local/bin/listsoftware -t em-notif-dl"
owner-em-notif-dl: "|/usr/local/bin/listsoftware -t owner-em-notif-dl"
em-notif-dl-request: "|/usr/local/bin/listsoftware -t em-notif-dl-request"
em-notif-dl-search-request: "|/usr/local/bin/listsoftware -t
em-notif-dl-search-request"
em-notif-dl-server: "|/usr/local/bin/listsoftware -t em-notif-dl-server"
em-notif-dl-signoff-request: "|/usr/local/bin/listsoftware -t
em-notif-dl-signoff-request"
em-notif-dl-subscribe-request: "|/usr/local/bin/listsoftware -t
em-notif-dl-subscribe-request"
em-notif-dl-unsubscribe-request: "|/usr/local/bin/listsoftware -t
em-notif-dl-unsubscribe-request"

I'm unfamiliar with this software, or its options. Traditionally listserves such as Majordomo eventually deliver to a sendmail include alias (a file containing a bunch of addresses). So, what you'd want to do is change the alias that the list software delivers to and make that a procmail program invocation:

em-notif-dl-procmail: "/usr/local/bin/procmail /etc/procmailrcs/some_filter.rc em-notif-dl-out"

where your filter is passed the argument of the original list outbound address, and performs a forward operation to that. This way, the list delivers the complete, list-modified message to your procmail alias, which cleans up the necessary headers, then that forwards the modified message to the real delivery alias (a list of email addresses in a file), and everything is just like it'd normally be.

You may need to obtain and re-specify the envelope sender for the message, as a regular forward operator in procmail (which invokes sendmail) will change the envelope sender.

Your procmail filter could also strip out or modify some additional Received: headers created locally, which might help to mask it's existence.

Looking at the invocations above, if that is indeed the sum total of the aliases for your list, then I'm left to assume that your list actually customizes each individual message sent to each individual recipient, rather than batching them (one massive bcc: list, effectively). If so, you're probably going to have to delve into the list software itself to hack something in, and if you have to do that, it should be rather trivial to tweak the precedence.

Also the header of the message I am matching on from the list example above
would look like

Sender: em-notif-dl <em-notif-dl(_at_)fqhn>

With the list Precedence header looking like
Precedence: list

So the procmail rule I would need based on the past feedback would be


:0 fw h
* ^Sender:.*em-notif-dl
* ^Precedence:.*list
|formail -I "Precedence: first-class"

If the filter is being invoked specifically for that list, it seems unlikely that you'd need to actually match on any specific conditions - just DO what needs to be done.

Now the questions I have are:

Handling order. Procmail has been built into sendmail.cf.

"built into" ?

You mean it's configured as the local mailer? Or you've enabled the (generally not used) procmail mailer?

When an incomming message reaches sendmail, will sendmail process the aliases file first? Or will the /etc/procmailrc file with the above recipe be processed first?

aliases. The /etc/procmailrc would be invoked on a local delivery, which of course would be handled after sendmail had ascertained that the message was intended for local delivery - i.e. after all alias expansion.

But where do I tell the system to send this to procmail after the listsoftware has processed the message but before handing off the mail to the mail gateways ?

Put an invocation of procmail into the aliasing for the list. Most lists deliver to an "outbound" address, and you'd tweak that.

Why can't you simply change how the list generates the headers? If you can't, you might consider changing to a less restrictive list processor package.

Majordomo for instannce allows you to define what the precedence header will be set to (if at all).

---
 Sean B. Straw / Professional Software Engineering

 Procmail disclaimer: <http://www.professional.org/procmail/disclaimer.html>
 Please DO NOT carbon me on list replies.  I'll get my copy from the list.


____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>
  • Lists and procmail, King, John (Greg) (LMIT-HOU)
    • Re: Lists and procmail, Professional Software Engineering <=