[Mimedefang] auto reply / vacation
Kevin A. McGrail
kmcgrail at pccc.com
Tue Feb 2 10:03:28 EST 2010
> But I don't need that. If you are going to write your own, I'd encourage
> you to study the vacation(1) source code; it contains measures that
> eliminate most of the worst auto-responder behaviour.
Actually, I found the vacation program to be woefully problematic in
replying to spam, lists, etc. and had worked for some months on it and
submitted a patch. The Sendmail authors rejected the patch because they
considered too specific. I disagreed and stopped using vacation because I
found that procmail was a better solution though a front-end to edit it for
end users would be a good idea.
Here were some specs I wrote at the time:
#1 not reply based on subject contents, for example "do not reply to subject
beginning with *** SPAM *** / [SPAM] / [ADV] or containing [SEXUALLY
EXPLICIT], etc."
#2 Do not reply to message of "precedence of bulk"
#3 Do not reply to mailing lists.
#4 Do not reply to NDR and DSN messages.
#5 Do not reply to more than one time per day.
#6 Do not reply to Vacation and other out of office messages.
#7 Do not reply to Daemons
So for example, here's an untested procmail script (based on the procmailrc
example)
#1 could be solved with the X-Spam-Status and my focus on SA to catch spam.
#2 could be solved with FROM DAEMON (from man procmailrc)
If the regular expression contains `^FROM_DAEMON' it will be
substituted by `(^(Mailing-List:|Precedence:.*(junk|bulk|list)|To: Multiple
recipients of
|(((Resent-)?(From|Sender)|X-Envelope-From):|>?From )([^>]*[^(.%@a-z0-9])?(Post(ma?(st(e?r)?|n)|office)|(send)?Mail(er)?|daemon|m(mdf|ajordomo)|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]*)?[%@>\t ][^<)]*(\(.*\).*)?)?$([^>]|$)))',
which should catch mails coming from most daemons (how's that for a
regular expression :-).
#3 could be solved with FROM_DAEMON and the List-Id check
#4 could be solved with using VBOUNCE with SA
#5 is harder but you can use a 16K cache file. It won't respond a second
time until the cache file fills up.
#6 could be solved with usign VBOUNCE with SA
#7 FROM DAEMON again
SHELL=/bin/sh
:0 Whc: vacation.lock
* !^X-Spam-Status: Yes
# Don't reply to daemons and mailinglists
* !^FROM_DAEMON
# Don't reply to mailinglists
* !^List-Id:
# Don't reply to Bounces
^X-Spam-Status:.*BOUNCE_MESSAGE
# Mail loops are evil
* !^X-Loop: kmcgrail at pccc.com
| formail -rD 16384 vacation.cache
:0 ehc # if the name was not in the cache
| (formail -rI"Precedence: junk" -A"X-Loop: kmcgrail at pccc.com" ; \
echo "I don't care about you and this email proves it." ; \
echo "" ; \
echo "Regards," ; \
echo "KAM" ; \
) | $SENDMAIL -oi -t -f kmcgrail at pccc.com
Regards,
KAM
More information about the MIMEDefang
mailing list