procmail
[Top] [All Lists]

Re: autorespond recipe

2007-05-26 11:05:12
On 5/26/07, Dallman Ross <dman(_at_)nomotek(_dot_)com> wrote:
Chirag Ravishankar write in Wednesday, May 23, 2007 4:56 PM:

I would like to reply to a sender's message by my own message
such as "Thank you for your mail, I will repond to it
momentarily" AND I would like to send all the contents (body
and attachments) back to the sender.

Note that you need a LINEBUF setting big enough for the biggest
message you intend to quote, plus of course more "buffer" space
for normal ops on top of that.

Oh: this will only *quote* MIME-encoding of attachments.
It will be very ugly.  Obviously, if you really want to
send the entire body back with attachments, you need to
do things a bit differently -- especially if the body is
not plaintext.

http://www.well.com/user/barts/email/mimewrap.txt

Handles automatically increasing LINEBUF and turns the entire original
message into a message/rfc822 attachment.

Dallman's response-addressing code is good (except maybe for a missing
close-brace?), so the whole thing would look like:

########################### start replyrcfile ###########################

NL      = "
"
 :0
#* {other conditions}
 * !^FROM_DAEMON
 * !^X-Loop:(.*\<)?$NEWFROM$
 {
  # MESSAGETEXT is used internally by mimewrap.txt
  MESSAGETEXT = "This is an automatic reply to your message$NL"
  MESSAGETEXT = "${MESSAGETEXT}and has not been read by a human.$NL"
  INCLUDERC=mimewrap.txt

  NEWFROM = "mynewfrom(_at_)address"

  :0 fw
  | formail -rkp "> "                    \
            -A "Precedence: junk"        \
            -A "X-Loop: $NEWFROM"        \
            -i "Reply-To: $NEWFROM"      \
            -i "Return-Path: $NEWFROM"   \
            -i "Sender: $NEWFROM"        \
            -i "From: $NEWFROM"          \
            -i "Subject: Auto-Reply"

  :0
  | "$SENDMAIL" $SENDMAILFLAGS -f "$NEWFROM" to(_at_)address
 }

############################ end replyrcfile ############################

____________________________________________________________
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>