Phil’s Diary - [Blog @ http://www.philsdiary.net/]
Friday December 12, 2003
Sendmail

So encouraged a little by yesterday’s linux tinkering, I decide that I should at least try to move all my server type stuff (mail, ftp etc.) across to the Linux box. Have it all in one place, and the box doing what it’s best at.

So after an extended lie-in this morning, I start looking at the mailserver part.

I’ve got a non-simple mail setup, mainly because I want to be able to be able to read my email, by telnet away from home. So I’ve been using a university computer account I still have and forwarding all my different email accounts there. Then I get Outlook to collect from there too. Even when the mail first goes through my machine here, it ends up there.

So I now set about changing it.

First step was to find a howto on Sendmail. I found this which is a bit brief and doesn’t got the whole way, but was a good start.

With those changes made the root user could send email using pine to the outside world. From here on it’s a case of tinkering with obvious looking config files (/etc/mail/)and reading log files (/var/log/maillog) and hoping for the best.

Next I setup relaying so that my windows machines can use the linuxbox as a mailserver and relay through it. Local network only. This is set using one of the config files in /etc/mail/ (I think it was ‘access‘).

So that was outgoing sorted. Next was incoming. First problem I noticed was that sendmail would only deliver mail to users setup on the linuxbox. As I’m used to setting up email address for all sorts of things, I didn’t really want to do that, so next thing to change was virtusertables, and adding some @philsdiary.co.uk type entries to catch any email to that domain and forward it to my single user account.

Small local tests indicated that it was working, so next step was to open port 25 to the real world in place of my old mailserver.

When the spam started coming in it was all looking quite promising, so three more things left to do.

First was to check the security, so I ran abuse.net’s mail relay test. Amazingly it came up with no relaying allowed. I guess this is one of those often talked about differences between windows, where linux is secure by default and windows needs locking down.

So with that done I moved on to removing spam, and go spam assassin installed. Luckily I had a procmailrc file to refer to which showed me how to go about using this, otherwise I’d have been a little lost.

That worked too, so final step was to get mail from that old uni account, using fetchmail. Fetchmail, unlike sendmail is a bit easy to use. Just create a .fetchmailrc file with a few lines telling it what machine and account to poll, and who the collected mail should belong to at this end, and then run it with a check time. And off it goes.

Finally on my list, atomic time (the clock has been drifting quite badly of late), which is just a crontab entry for ntpdate.

no doubt I’ll have some tweaks and changes to make, and if the worst comes to the worst I can always switch the old mailserver in, but for the moment it looks quite promising.

All I’ve got left to do now is setup ssh/telnet access and ftp, and with those done I’ll be finished. I might then start tackling apache, though I don’t really need to.

Anyhow, time is getting on and I’ve got to go and get ready for the office Christmas party. Depending on hangover, I may see you tomorrow.

Posted by Phil on December 12, 2003 06:13 PM | Categories: Linux

Wow! You're becoming a SysAdmin with all these changes. I don't know if I'll ever get around to setting up things like this but if I do, I'll know where to come for help ;}

Aloha - Dan

Posted by: DanS at December 15, 2003 6:16 PM