procmail
[Top] [All Lists]

Re: sendmail

2001-02-22 10:58:48
At 16:55 2001-02-22 +0000, Michele Cerioni wrote:
I want send a new mail from procmail in some condition. Is it possible?

Yes.

Are you asking HOW? Have you tried "man procmailex" and searching for 'sendmail' (the word YOU chose for your subject heading above)? That would give you the basic recipes necessary.


Here's an example:

# set the path for where autoreplies are located
AUTOREPLY=$HOME/replytexts

:0:
* ^Subject:.*say hi
* ! ^X-Loop: michele(_at_)ptnet(_dot_)it
  | ( formail -rt -A"X-Loop: michele(_at_)ptnet(_dot_)it" \
        -I "Subject: Greetings from Italy" \
        -I "From: michele(_at_)ptnet(_dot_)it" ;\
      cat $AUTOREPLY/welcome.msg ) | $SENDMAIL -t


This assumes the recipient is to be the person who sent you a message. If you want it something else, just read the manpage for formail, and instead of using it to extract the reply address from the message sent to you, insert a header (hint: look at how subject is handled), for the To:, with the address you want to send to. OR omit the -t from sendmail, and specify the address on the line there (which effectively BCC's the address).

---
 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(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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