OT: auto responder (OOO) question
Rob Poe
rob at poeweb.com
Thu May 12 22:35:43 IST 2011
On 5/12/2011 3:46 PM, Scott Silva wrote:
> on 5/12/2011 1:09 PM Steve Campbell spake the following:
>>
>> On 5/12/2011 3:28 PM, Scott Silva wrote:
>>> on 5/12/2011 11:20 AM Steve Campbell spake the following:
>>>> As much as I hate to set one of these up, a fellow employee has persuaded me
>>>> to set up an out-of-office deal for her. I'm running Centos 3 and sendmail.
>>>> I've played around with a .procmailrc file, but it doesn't seem to do
>>>> anything. I've also created the symlink in /etc/smrsh to procmail with no
>>>> avail.
>>>>
>>>> Does anyone know if I have to restart sendmail after creating the link?
>>>> Does Mailscanner have any bearing on using procmail?
>>>>
I setup a simple bash script for it -- no checking (honestly, didn't
care too much about checking). They've used it forever .. use, don't
use, modify, whatever. Enjoy!
-----------------------------------------------------
/usr/bin/vacationon
#!/bin/bash
rm -Rf /home/$1/.procmailrc
cp /template/.procmailrc /home/$1/.procmailrc
cp /template/vacation.msg /home/$1/vacation.msg
echo "\"|/usr/bin/procmail -f-\"" > /home/$1/.forward
rm -Rf /home/$1/vacation.cache
chown $1:$1 /home/$1/.procmailrc
chown $1:$1 /home/$1/vacation.msg
chmod 640 /home/$1/.procmailrc
chmod 644 /home/$1/vacation.msg
cd /home/$1
echo "Please edit vacation.msg for this user."
echo "cd /home/$1"
echo "pico vacation.msg"
-----------------------------------------------------
/template/.procmailrc
SHELL=/bin/sh
:0 Whc: vacation.lock
# Perform a quick check to see if the mail was addressed to us
* $^To:.*${LOGNAME}
# Don't reply to daemons and mailinglists
* !^FROM_DAEMON
# Mail loops are evil
* !^X-Loop: ${LOGNAME}@utxl.com
| formail -rD 8192 vacation.cache
:0 ehc # if the name was not in the cache
| (formail -rA"Precedence: junk" \
-A"X-Loop: $LOGNAME at utxl.com" -i"Subject: $LOGNAME - Out of office -
Will get back to you"; \
cat $HOME/vacation.msg ; \
cat $HOME/.signature 2>/dev/null\
) | $SENDMAIL -oi -t
-----------------------------------------------------
/template/vacation.msg
I am out of the office on vacation. If you need further assistance
please call xxx-xxx-xxxx. I will receive your email message when I
return.
Thanks!
-----------------------------------------------------
/usr/bin/vacationoff
#!/bin/bash
rm -Rf /home/$1/.procmailrc
rm -Rf /home/$1/vacation.cache
rm -Rf /home/$1/vacation.msg
rm -Rf /home/$1/.forward
More information about the MailScanner
mailing list