procmail
[Top] [All Lists]

Re: Auto-send (NOT reply/forward) an email with procmail

2001-07-20 04:08:50
On Fri, Jul 20, 2001 at 01:26:15AM -0700, Professional Software Engineering 
wrote:
Email:foo(_at_)bar(_dot_)net

:0
* !^FROM_DAEMON
* !^X-Loop: youraddr(_at_)yourdomain(_dot_)tld
{
         :0B
         * ^Email:[      ]*\/[^  ].*

This assumes there will be whitespace between the colon and the email address.
His example specified no space, but that may have been a typo. 
For his benefit: the first character class contains a literal space and tab.
Omit this and the following * if your example is correct. Leave it in if there
will be white space after the :.
Question: Why the white space in the second character class?

Obviously, you need to define the $AUTOREPLY path earlier in the script:

AUTOREPLY=$home/.procmailrc/texts

Not a good idea. ~/.procmailrc should be a file, not a directory.

         # Forward along a subscription request to the listserv
         :0c
         | (formail -rtzx -I "From: $MATCH" \
         -I "To: yourmailinglist(_at_)domain(_dot_)tld" \
         -I "Subject: subscribe $MATCH" ;\
         cat $AUTOREPLY/subscribeuser.msg ) | $SENDMAIL -t

I'm no doubt abusing the formail syntax here, but I'm fairly certain this 
will work -- it'll ditch the body and most headers in the process of 

Indeed. The -rt is unneccesary, since we're not generating a reply back to
the sender here, and x requires an argument (The header field to extract).

-- 
Every man should know how to make at least one drink from a foreign country,
preferably one taught to him by a local female with whom he has had a
complicated, unresolved, and quite possibly dangerous dalliance.
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>