I like this response I got from Reto. He sent it privately, but I think
the whole list can benefit.
for multiple repliers on the same address (info@)
I just use (in the aliases files) info-domain1.com, info-domain2.com and
vut refers to those.
More or less, the same code -- two great ways of doing it.
Oh, one thing that does bother me with the + support in sendmail is that
if you place things in your sendmail.mc (M4) file in an improper order
(although sendmail docs do mention this), it won't work. I did this by
mistake and couldn't figure out what went wrong. I changed the order of
the commands in the M4 file and things worked fine.
Thanks,
--
Brock Rozen
brozen(_at_)torah(_dot_)org
Director of Technical Services (410)358-9800
Project Genesis http://www.torah.org/
---------- Forwarded message ----------
Date: Mon, 4 Jan 1999 17:33:32 -0500 (EST)
From: Reto Lichtensteiger <rali(_at_)meitca(_dot_)com>
To: brozen(_at_)torah(_dot_)org
Subject: Re: (procmail) Auto-reply system from the aliases file
Brock Rozen wrote:
<> I figured that the best way to run an auto-reply system, at least once you
<> get many many addresses, is from the aliases file and not from a dedicated
<> account on the system.
<> My question, how do I do it? What do I place in the aliases file to run
<> procmail with the designated recipe file and what's essential in that
<> recipe file? (I could stick any global variables in /etc/procmailrc, so
<> that's not so bad, and otherwise I could just include a standard
<> configuration file)
% grep ^info /etc/mail/aliases
info: "|/usr/bin/procmail -m /etc/procmail/info.rc"
% cat /etc/procmail/info.rc
# First; environment variables ...
PATH=/bin:/usr/ucb:/usr/local/bin
SHELL=/bin/sh
MAILDIR=/etc/procmail
LOGFILE=$MAILDIR/logs/abuse
AUTO=$MAILDIR/auto-responses
DEFAULT=/dev/null
BITBUCKET=/dev/null
FORMAIL=/bin/formail
# use 'formail' to prevent duplicate responses
:0 Whc: ${MAILDIR}/.info.lck
* !^FROM_DAEMON
* !^X-Loop: info(_at_)meitca(_dot_)com
| formail -rD 8192 $MAILDIR/.info.cache
# Uncomment to get a copy of the info message forwarded to someone
#:0 c
#* ^Subject:[ ]+\/.*
#| $FORMAIL -I "Subject: (INFO Request) ${MATCH}" | $SENDMAIL -oi <someaddress>
:0
* !^X-Loop: info(_at_)meitca(_dot_)com
* ^Subject:\/.*
* ! FROM_DAEMON
| ( $FORMAIL -r -I"X-Loop: info(_at_)meitca(_dot_)com" \
-I"Reply-To: postmaster(_at_)meitca(_dot_)com" \
-i"Subject: Information Request Auto Response (was ${MATCH})" \
-I"From: Information Server <info(_at_)meitca(_dot_)com>" ; \
cat ${AUTO}/info.txt ; cat \
) | $SENDMAIL -oi -t
Note: In order to use the $MATCH stuff you do need to be running 3.11pre7
procmail.
Rgds,
Reto L.
--
R A Lichtensteiger rali(_at_)meitca(_dot_)com -or-
rali(_at_)world(_dot_)std(_dot_)com
http://www.meitca.com/ITA/People/rali
"Yes, you're doing things right, but are you doing the right things?"
"Nope. I'm just doing something dumb fast."