I'm storing and forwarding (to google apps) emails using the following procmail recipe:
# set vars
USERNAME=local_username
LOCALPART=realemaillocalpart
:0
# Avoid email loops
* ! ^X-Loop: ${USERNAME}@domain\.nl
{
:0c: #Preserve a copy of the email
${DEFAULT}
:0fwh #Adjust some headers before forwarding
| formail -A"X-Loop: ${USERNAME}@domain.nl" \
# Forward the email
:0
!${LOCALPART}@apps.domain.nl
}
This works, but when I set up an 'out of office' message in gmail it returns the email to the forwarding system instead of to the original sender.
This probably has to do with the forwarding system adding or replacing a Return-path line and putting the local username and the servername in there.
My question is thus how can I prevent that from happening?