I'm having a difficult time getting procmail to both deliver a message and
send a bounce back (autoresponder).
So far my only solution is to deliver everything local in .forward and
send to procmail.
eg:
#cat .forward
"|IFS=' '&& exec /usr/bin/procmail -f-||exit 75 #autoreply"
\autoreply
This is not optimal.
I've setup a new .procmailrc with the following:
#cat .procmailrc
LOGFILE="$HOME/procmail.log"
LOGABSTRACT=all
VERBOSE=on
:0
* $ ?/usr/bin/test -e $HOME/autoreply.txt
{
:0
* $ !^From:(_dot_)*$LOGNAME(_at_)domain\(_dot_)com
* $ !^X-Loop: $LOGNAME(_at_)$HOST
* $ !^FROM_DAEMON
* $ !^FROM_MAILER
| ( formail -r -A"X-Loop: $LOGNAME(_at_)$HOST"; cat
"$HOME/autoreply.txt" ) | /usr/lib/sendmail -t -oi
Maildir/
}
:0
Maildir/
The way I read this recipe:
If there exists a $HOME/autoreply.txt then check to make sure the
message isn't a 'bad bounce' then send the the autoresponse back to the
sender as well deliver the message to the local Maildir/. If all else
fails deliver to the local Maildir and finish.
When I try it the message bounces fine but a copy doesn't appear in the
Maildir.
The logs states:
procmail: [23950] Mon Nov 1 18:23:50 2004
procmail: Executing "/usr/bin/test,-e,/home/autoreply/autoreply.txt"
procmail: Match on "/usr/bin/test -e /home/autoreply/autoreply.txt"
procmail: Match on ! "^From:(_dot_)*autoreply(_at_)domain\(_dot_)com"
procmail: Match on ! "^X-Loop: autoreply(_at_)mail(_dot_)domain(_dot_)com"
procmail: Match on ! "(^(Mailing-List:|Precedence:.*(junk|bulk|list)|To:
Multiple recipients of |(((Resent-)?(From|Sen
der)|X-Envelope-From):|>?From
)([^>]*[^((_dot_)%(_at_)a-z0-9])?(Post(ma?(st(e?r)?|n)|office)|(send)?Mail(er)?|daemon|m(mdf|ajordo
mo)|n?uucp|LIST(SERV|proc)|NETSERV|o(wner|ps)|r(e(quest|sponse)|oot)|b(ounce|bs\.smtp)|echo|mirror|s(erv(ices?|er)|mtp
(error)?|ystem)|A(dmin(istrator)?|MMGR|utoanswer))(([^).!:a-z0-9][-_a-z0-9]*)?[%@>
][^<)]*(\(.*\).*)?)?$([^>]|$)
))"
procmail: Match on ! "(^(((Resent-)?(From|Sender)|X-Envelope-From):|>?From
)([^>]*[^((_dot_)%(_at_)a-z0-9])?(Post(ma(st(er)?|n)|o
ffice)|(send)?Mail(er)?|daemon|mmdf|n?uucp|ops|r(esponse|oot)|(bbs\.)?smtp(error)?|s(erv(ices?|er)|ystem)|A(dmin(istra
tor)?|MMGR))(([^).!:a-z0-9][-_a-z0-9]*)?[%@>
][^<)]*(\(.*\).*)?)?$([^>]|$))"
procmail: Assigning "LASTFOLDER= ( formail -r -A"X-Loop: $LOGNAME(_at_)$HOST";
cat "$HOME/autoreply.txt" ) | /usr/lib/sendm
ail -t -oi "
From null(_at_)tinfoilhat(_dot_)ca Mon Nov 1 18:23:50 2004
procmail: Executing " ( formail -r -A"X-Loop: $LOGNAME(_at_)$HOST"; cat
"$HOME/autoreply.txt" ) | /usr/lib/sendmail -t -oi
"
Subject: 12345
Folder: ( formail -r -A"X-Loop: $LOGNAME(_at_)$HOST"; cat "$HOME/autorep
1075
It does get to the 'bounce' action but never hits the Maildir/ as well?
Any ideas on what I can try?
--
Sean
____________________________________________________________
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