Search code examples
procmail

Procmail not forwarding using ![my email address]


I have an account on a Linux server, and I'd like to have a copy of each non-spam email that's sent to this count be forwarded to my Gmail account.

I added these lines to my .procmailrc file:

:0c:
* .
[email protected]

Here they are in the context of the whole file (sorry for the wall of text, but i don't know procmail well enough to isolate the relevant fragment):

LINEBUF=4096
MAILDIR=/mail/$LOGNAME/Maildir
DEFAULT=/mail/$LOGNAME/Maildir/
#LOGFILE=$HOME/.pmlog
VERBOSE=no

:0
* ^From:[email protected]
.somebody/

:0
* ^Subject:.*test
.IN-testing/

:0
* ^From:.*Network
/dev/null

:0
* ^From:.*Microsoft
/dev/null

:0
* ^From:.*Corporation
/dev/null


# Spam filtering
:0
SCORE=|/usr/bin/spamprobe receive
:0 wf
|/usr/bin/formail -I "X-SpamProbe: $SCORE"
:0 a
*^X-SpamProbe: SPAM
.spam/
:0
./

:0c:
* .
[email protected]

But nothing is being forwarded to my Gmail account. Emails are successfully reaching my account on the Linux server. I checked my Gmail spam folder, but they aren't there either. How do I actually set up copy forwarding?


Solution

  • The earlier delivering recipe takes care of the message, so your forwarding recipe never executes.

    :0
    ./
    

    Switch the order of the last two recipes, or move the c flag from the last recipe to this one.

    Incidentally, you can omit the condition to do stuff unconditionally, like you already do in this recipe, but not in the new one you added.

    Also, for basic troubleshooting, set VERBOSE=yes and examine the log - this would readily have allowed you to diagnose this yourself.

    For more debugging tips, see e.g. http://www.iki.fi/era/mail/procmail-debug.html