I'm trying to forward (resend) email to Gmail while still delivering it to local folders according to some procmail rules.
The procmail contents related to forwarding are as follows:
MAILDIR=$HOME/mail/
DEFAULT=$HOME/mail/inbox
SENDER=`formail -c -x Return-Path`
SENDMAILFLAGS="-oi -f $SENDER"
:0fw
| spamc
:0:
* ^X-Spam-Status: Yes
spam
:0c
! [redacted]@gmail.com
The messages get through to Gmail, but their headers are included in the body:
>From kluge Tue Jul 12 15:14:43 2011
Return-path: <example@gmail.com>
Envelope-to: john.doe@example.com
Delivery-date: Tue, 12 Jul 2011 15:14:43 +0300
How can I get the mail to be resent so that it would appear as normal in Gmail?