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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Procmail - nothing happens

Status
Not open for further replies.

BIS

Technical User
Jun 1, 2001
1,893
NL
Hallo ,

I am trying to set up a simple procmail autoresponder on a RH7.3 box.

I have created a user called autoresponder for testing purposes.
I am using sendmail.
In the users home directory ( /home/autoresponder ) I have the following
.procmailrc file :

SHELL=/bin/sh
MAILDIR=${HOME}
SENDMAIL=/usr/sbin/sendmail
LOGFILE=${MAILDIR}/procmail.log
LOG="--- Logging ${LOGFILE} for ${LOGNAME},"
:0 h c
* ^To.*autoresponder@mydomain.com* !^FROM_DAEMON
* !^X-Loop
| (echo "From: autoresponder@mydomain.com" ; echo "Subject: Thanks for your inquiry!" ; formail -r -I"Precedence: junk" -A"X-Loop: autoresponder@mydomain.com" ; cat autoreply.txt) | $SENDMAIL -t

The file autoreply.txt also exists in the /home/autoresponder directory.

Both files (.procmailrc and autoreply.txt) are -rw------- .

When I send a mail nothing seems to happen. In the logfile all I see is:
--- Logging /home/autoresponder/procmail.log for autoresponder,From
someone@somewhere.com Tue Apr 22 12:59:27 2003
Subject: Test
Folder: /var/spool/mail/autoresponder

Where am I going wrong?

 
I use a procmailrc in the /etc folder, so it processes all emails. Note that unlike an rc in the user's directory, the rc in /etc has no leading period (took me awhile to figure that out).

LOGFILE=/var/log/pm.log
LOG="
"
VERBOSE=yes
SHELL=/bin/sh
LOGABSTRACT=no

#Autoresponder Recipe
:0 Whc: user.lock
# Perform a check to see if the mail was addressed to us
* $^To:.*jennifer.user
# Don't reply to daemons, mailinglists or self
* !^FROM_DAEMON
* !^X-Loop: jennifer.user@mydomain.net
| formail -rD 8192 user.cache
:0c eh # if the name was not in the cache
| (formail -rI&quot;Precedence: junk&quot; -I&quot;From: Auto Replier <autoreplier@mydomain.net>&quot; ; -A&quot;X-Loop: jennifer.user@mydomain.net &quot; ; echo &quot;I received your mail,&quot; ; echo &quot;however I will be out of the office &quot; ; echo &quot;through March 6th. If you have an issue &quot; ; echo &quot;that must be dealt with immediately, please &quot; ; echo &quot;send your email to: info@mydomain.net &quot; ; echo &quot;Thanks very much. &quot; ; echo &quot; Jennifer User &quot; ; echo &quot;-- jennifer.user@mydomain.net&quot; ) | $SENDMAIL -oi -t


I used the cat command once, but had better results just hard-coding the reply.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top