Weblog entry #3 for nathanbullock
I really have no interest in setting up a mailserver either. I don't want to have to deal with spam and other things, that is what things like yahoo and gmail are for.
What I do want is for any mail that is sent through this internal mail system to actually be sent, using one of my already existing email accounts smtp servers, to that same email address. So all error messages would show up in my regular email account from my regular email account, instead of on the root account of my server.
One way I could do this is to just change /usr/sbin/sendmail to a small python script that logs in to my regular email account through smtp and then sends the email to that same account. Would this be bad?
Any suggestions?
Comments on this Entry
Cheers.
[ Parent | Reply to this comment ]
[ Send Message | View Steve's Scratchpad | View Weblogs ]
It wouldn't be bad but ssmtp or nullmailer are both packages available within Debian which allow all mail invoked via /usr/sbin/sendmail to be forwarded to a relay-server.
Neither listen upon port 25 though - so if you want that you should probably configure mail forwarding manually.
[ Parent | Reply to this comment ]
Reinventing the wheel is usually a bad idea.
The classic mistake with such systems is not to queue email when the remote end is down. So once you've written the Python script to fall back to backup MX, and queue email when it has failed, and a daemon running to clear the queue every 15 minutes, a utility to check the queue when there is a problem, you have most of a Python MTA.
Our standard build at work sticks in Postfix, but not listening externally. I forward via /etc/aliases (most stuff is forwarded to root in Debian, I forward root email to our sysadmin account). The /etc/aliases works with sendmail and Exim as well, although the Debian packages and installer make it easiest to set this up with Postfix or Exim.
Sure it is overkill for what is needed. On the other hand I'm pretty convinced that if Postfix couldn't ship the email, nothing could.
[ Parent | Reply to this comment ]
[ Send Message | View dkg's Scratchpad | View Weblogs ]
[ Parent | Reply to this comment ]