Best Mail Setup to Just Forward Email?

I would like my linode to simply forward all mail sent to it.

However, I will be munging various subject lines.

I'm doing this so I can have email aliases setup like, and any email sent to that would add "#work" to the subject so it'd be sorted correctly at Evernote. Same thing for Toodledo, etc.

Some email addresses will just forward as-is.

So…what is the best way to do this? procmail for the munging but what should I setup as far as the mail program itself?

3 Replies

Have you looked at the library?

I generally use Postfix for mail stuff, so I'd lean towards that. Something I threw up awhile back to change the envelope sender of forwarded mail (to avoid tripping out SPF) defined a transport:




.munger   munger:


munger_destination_recipient_limit = 1


munger  unix  -       n       n       -       -       pipe
  flags=q user=nobody argv=/etc/postfix/redirector ${mailbox}@${nexthop} ${original_recipient}



# Redirects mail to make SPF happy.
# Ryan Tucker <>, 2010 Oct 24
# Based on
HOSTNAME=`hostname -f`
DESTINATION=`echo "$1" | sed 's/.munger$//'`

/usr/sbin/sendmail -bm -f "mail@$HOSTNAME" "$DESTINATION"
logger -i -p -t redirector "Redirecting message to $DESTINATION (orig to $2)"</> 

I thought it was pretty clever: to route mail through it, just append .munger to the recipient e-mail address. You could do something similar without having to do a lot of manual configuration, if you wanted to dedicate to the job… pipes through procmail to add "#${MAILBOX}" to the subject, so would add #work, etc.

Or, search for docs on setting up postfix+procmail and someone'll probably have your use case ready to roll. :-)

Instead of munging subject lines, couldn't you just add a custom header you can use to filter with your client?


Please enter an answer

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct