Weblog entry #3 for nathanbullock

Setting up a very simple mail system
Posted by nathanbullock on Thu 1 Mar 2007 at 19:44
My Debian server does not currently run a mailserver, well I guess exim4 runs locally, but it doesn't receive any mail from the outside world and it doesn't send mail to the outside world. I think the only thing it does is sends messages to my local account on the machine about log files, and various other errors or messages.

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

Posted by daemon (155.232.xx.xx) on Thu 1 Mar 2007 at 20:07
[ Send Message | View Weblogs ]
The python route wouldn't be bad, but replacing exim4 with something like nullmailer would be easier.

Cheers.

[ Parent | Reply to this comment ]

Posted by Steve (62.30.xx.xx) on Thu 1 Mar 2007 at 22:15
[ 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.

Steve

[ Parent | Reply to this comment ]

Posted by simonw (84.45.xx.xx) on Fri 2 Mar 2007 at 20:34
[ Send Message | View Weblogs ]
I think it is a very bad idea.

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 ]

Posted by dkg (216.254.xx.xx) on Fri 2 Mar 2007 at 18:39
[ Send Message | View dkg's Scratchpad | View Weblogs ]
You might also be interested in msmtp, which is packaged for debian. It's not an MTA in the way that some of these others are, but it can potentially play a similar role with proper configuration, from what i understand.

[ Parent | Reply to this comment ]

User Login

Username:

Password:

[ Advanced Login ]

Register Account

Mail Filtering

Quick Site Search