Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Vacation script for CentOs 64 bit Sendmail / SquirrelMail - any ideas? 1

Status
Not open for further replies.

bazil2

Technical User
Feb 15, 2010
148
0
0
DE
(Elementary user)

Can anyone recommend a Vacation script to use with CentOs Sendmail/Squirrel Mail?

Best regards
 
This works for me for our site in procmailrc, had a difficult time with the Domain name with all the different versions of Outlook on the network. Put domain name in testdomain file , vac users in vac file when they go on vacation an dvacation message in .msg for each user. Norm

# Vacation recipe - enter names in /etc/mail/spamassassin/vac
TO=`formail -x To:`
FIRST=`echo "$TO" |sed -n '1p'| awk -F"<" '{print $2}'`
FIRSTX=`echo "$FIRST" | awk -F"@" '{print $1}'`
DOMAIN1=`echo "$FIRST" | awk -F">" '{print $1}'`
DOMAINX=`echo "$DOMAIN1" |awk -F"@" '{print $2}'`


:0 whc: /tmp/vacation.lock
* ? (echo "$DOMAINX" | $FGREP -i -x -f /etc/testdomain)
* ? (echo "$FIRSTX" | $FGREP -i -x -f /etc/mail/spamassassin/vac)
* !^FROM_DAEMON
* !^X Loop: $TO
| formail -rD 8192 /etc/mail/spamassassin/vac_cache/$FIRSTX.cache

:0 ehc
| (formail -rA"Precedence: junk" \
-A"X-Loop: $TO" ; \
cat "/etc/mail/spamassassin/vacmessages/$FIRSTX.msg" \
) | $SENDMAIL -oi -t

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top