Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Apr 2007
    Posts
    1

    Default Filtering with procmail

    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

  2. #2
    Member
    Join Date
    Mar 2008
    Posts
    12

    Default

    Hi ,

    Did you find the trick for that, cause I have the same issue.
    It is actually working , but I still have an error message going back to the sender..:

    procmail: Couldn't create "/var/mail/alu"
    procmail: [25250] Mon Mar 8 23:26:23 2010
    procmail: Assigning "SENDMAIL=/usr/lib/sendmail"
    procmail: Assigning "SHELL=/bin/sh"
    procmail: Assigning "LOGFILE=./proclog.log"
    procmail: Opening "./proclog.log"

Similar Threads & Tags
Similar threads

  1. Replies: 0
    Last Post: 11-09-2010, 10:18 AM
  2. Filtering with procmail
    By GeorgeCO in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 03-08-2010, 10:28 PM
  3. Mail > User Level Filtering & Account Level Filtering
    By rpiggott in forum Feature Requests for cPanel/WHM
    Replies: 1
    Last Post: 11-02-2009, 05:09 PM
  4. Using Procmail
    By burachat in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 11-07-2004, 09:46 PM
  5. Procmail for filtering mail to folders
    By bambenek in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 10-26-2003, 12:18 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube