Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Sun Sep 25, 2011 4:18 pm 
Offline
Senior Newbie

Joined: Fri Apr 08, 2011 4:46 pm
Posts: 12
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 en-work@example.com, 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?


Top
   
 Post subject:
PostPosted: Sun Sep 25, 2011 4:22 pm 
Offline
Senior Newbie
User avatar

Joined: Mon Aug 24, 2009 10:37 am
Posts: 18
Have you looked at the library?

http://library.linode.com/search?query=smtp


Top
   
 Post subject:
PostPosted: Sun Sep 25, 2011 5:38 pm 
Offline
Senior Member
User avatar

Joined: Sat Aug 30, 2008 1:55 pm
Posts: 1739
Location: Rochester, New York
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:

/etc/postfix/virtual
Code:
...
rtucker@example.com rtucker+example_com@gmail.com.munger
...


/etc/postfix/transport
Code:
.munger   munger:


/etc/postfix/main.cf
Code:
munger_destination_recipient_limit = 1


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


/etc/postfix/redirector
Code:
#!/bin/bash

# Redirects mail to make SPF happy.
# Ryan Tucker <rtucker@gmail.com>, 2010 Oct 24
# Based on http://serverfault.com/q/82234/54177
HOSTNAME=`hostname -f`
DESTINATION=`echo "$1" | sed 's/.munger$//'`

/usr/sbin/sendmail -bm -f "mail@$HOSTNAME" "$DESTINATION"
logger -i -p mail.info -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 something.example.com to the job... en.example.com pipes through procmail to add "#${MAILBOX}" to the subject, so work@en.example.com would add #work, etc.

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

_________________
Code:
/* TODO: need to add signature to posts */


Top
   
 Post subject:
PostPosted: Sun Sep 25, 2011 10:26 pm 
Offline
Senior Member

Joined: Thu Oct 02, 2008 8:56 am
Posts: 99
Instead of munging subject lines, couldn't you just add a custom header you can use to filter with your client?


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group