RedHat iTOps Tube

Wednesday, May 16, 2012

Setting up a personal e-mail forwarder

Hello, I'd like any mail addressed to *@*.mydomain.com to find its way into my inbox at Gmail. Forwarding works, Gmail importing messages from an IMAP/POP3 server works, or even uploading mail via IMAP to Gmail works. Any suggestions about the simpliest way to do this? I have a CentOS 5.0 VPS at my disposal.



For some background, I currently use a catch-all forwarder and give every entity a unique e-mail address. If an address gets spammed, I null route it. There are some drawbacks to this approach, so I'd like to use an MX wildcard so each entity gets a unique subdomain, which can be blocked at the DNS level.



This will be very low volume, and ideally it wouldn't have any form of spam filtering. The e-mail itself is unlikely to be terribly important (and it's all mine), although I obviously want this to be somewhat reliable.



I believe this is possible with sendmail, but it seems much easier to write my own SMTP server than to learn how to configure sendmail the way I want (and a lot more fun). OTOH, I'm a bit wary of putting my own hobbyist-level code on the open internet, so I'm hoping someone will know of a better solution...