Hi cPanel experts, and hopefully procmail experts also:
I am trying to filter incoming messages in a cpanel environment such that messages with subjects matching a specified string are forwarded to another email address while the original message is delivered locally to my email inbox.
I am using procmail to do this because I have used it in the past in another envionment. The basic cpanel filters redirect the messages to the other email account, but do not then keep the mesage for local delivery.
I think I am getting close to getting this to work but a serious problem remains.
Specifically, the message is redirected to the another address, and the original is received, BUT an error message is resent to the sender.
---------------------------------------------------------------
The following text was generated during the delivery attempt:
------ pipe to |/usr/bin/procmail
generated by george@mydomain.net ------
procmail: Couldn't create "/var/spool/mail/loginname"
---------------------------------------------------------------
For testing purposes, I sent a message from an email account sender@xyz.net to george@mydomain.net with "testtest2" in the subject line. The .procmailrc file forwards the message to receiver@abc.net.
My .procmailrc file (which is in the highest directory that I can see) looks like this:
----------------------------------------------------------------
PMDIR=$HOME/.procmail
LOGFILE=$PMDIR/log
VERBOSE=on
MAILDIR=$HOME/mail/mydomain.net/george
# test
:0
* ^Subject:.*testtest2.*
{
:0 c
! receiver@abc.net
:0
$MAILDIR/
}
-------------------------------------------------------------------
The log file that is save during the test looks like this:
procmail: [2530] Sat Aug 4 23:20:31 2007
procmail: Match on "^Subject:.*testtest2.*"
procmail: Executing "/usr/sbin/sendmail,-oi,receiver@abc.net"
procmail: Assigning "LASTFOLDER=/usr/sbin/sendmail -oi receiver@abc.net"
procmail: [2530] Sat Aug 4 23:20:32 2007
procmail: Assigning "LASTFOLDER=/home/loginname/mail/mydomain.net/george/new/1186284031.2530_2.tau.genwebserver.com"
procmail: Notified comsat: "loginname@0:/home/loginname/mail/mydomain.net/george/new/1186284031.2530_2.tau.genwebserver.com"
From sender@xyz.net Sat Aug 04 23:20:31 2007
Subject: testtest2
Folder: /home/loginname/mail/mydomain.net/george/new/1186284031.2530_2 1088
--------------------------------------------------------------------
Some more details:
I am invoking procmail via an email filter in cpanel. The email filter already matches for "testtest2" as a subject.
I tried invoking procmail from the forwarder. When I sent the test message, two copies of the message were delivered to george@mydomain.net and one forwarded to receiver@xyz.net. The same error message as
above was sent back to sender@xyz.net.
I also sent a test message with a non-matching subject line to george@mydomain.net while the forwarder was in place. It didn't match (of course), but still sent out a an error message back to
sender@xyz.net.
The error message returned to sender@xyz.net contained the following:
-------------------------------------------------------------------
A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es) failed:
pipe to |/usr/bin/procmail
generated by george@mydomain.net
local delivery failed
The following text was generated during the delivery attempt:
------ pipe to |/usr/bin/procmail
generated by george@mydomain.net ------
procmail: Couldn't create "/var/spool/mail/loginname"
--------------------------------------------------------------------
This is what the log file looked like:
------------------------------------------------------------------
procmail: [19115] Sat Aug 4 23:24:56 2007
procmail: No match on "^Subject:.*testtest2.*"
procmail: Notified comsat: "loginname@:**Bounced**"
From sender@xyz.net Sat Aug 04 23:24:56 2007
Subject: test the world
Folder: **Bounced** 0
------------------------------------------------------------------
I would appreciate any help I can get
GeorgeCO



LinkBack URL
About LinkBacks
Reply With Quote




