Web Hosting Talk







View Full Version : [PROCMAIL] auto reply


IkkePikke
07-01-2001, 03:42 PM
Hi webhostingtalkers, I have a problem with a procmail autoreply setup.

I want to achieve that when a user gets mail, a auto reply mail is send to the sender of the mail.
People told me I had todo this with procmail and I tried to do it.
When I send the user I have setup this reply stuff for an email, it's received, but no replymail is sent..

Someone know what is going wrong?
This is the .procmailrc file of the user.

VERBOSE=yes
LOGABSTRACT=all
LOGFILE=./logfile

:0 h c
* !^FROM_DAEMON
* !^X-Loop:tester@fasteddy.nl
| (formail -r -I"Precedence: junk" \
-A"X-Loop:tester@fasteddy.nl" ; \
echo "Mail received.") | $SENDMAIL -t


and this is the logfile contents:

rocmail: Match on ! "(^(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|utoansw
er))(([^).!:a-z0-9][-_a-z0-9]*)?[%@> ][^<)]*(\(.*\).*)?)?$([^>]|$)))"
procmail: Match on ! "^X-Loop:tester@fasteddy.nl"
procmail: Assigning "LASTFOLDER= (formail -r -I"Precedence: junk" \
-A"X-Loop:tester@fasteddy.nl" ; \
echo "Mail received.") | $SENDMAIL -t"
From fasteddy@cybercomm.nl Sun Jul 1 21:02:38 2001
Subject: test
Folder: (formail -r -I"Precedence: junk" \ -A"X-Loop:tester@fasteddy 910
procmail: Locking "/var/spool/mail/tester01.lock"
procmail: Assigning "LASTFOLDER=/var/spool/mail/tester01"
procmail: Opening "/var/spool/mail/tester01"
procmail: Acquiring kernel-lock
procmail: Executing " (formail -r -I"Precedence: junk" \
-A"X-Loop:tester@fasteddy.nl" ; \
echo "Mail received.") | $SENDMAIL -t"
procmail: Unlocking "/var/spool/mail/tester01.lock"
From fasteddy@cybercomm.nl Sun Jul 1 21:02:38 2001
Subject: test
Folder: /var/spool/mail/tester01 1618
procmail: Notified comsat: "tester01@11280:/var/spool/mail/tester01"

Madman2020
07-04-2001, 03:04 AM
Here is one way to do it:

# Set the proper shell
SHELL=/bin/sh

# Autoresponder section
:0 h c
* !^FROM_DAEMON
* !^X-Loop: acme_vacation
* ^TOacme@
| (formail -rt -A"Precedence: junk (autoreply)" \
-A"X-Loop: vactationmessage" ; \
cat $HOME/.autoreply) | $SENDMAIL -t

There is another way to include the file as well.