mail server suggestions

Where Penguins and Daemons chill together in the warmth of the Sun.

Moderators: SecretSquirrel, notfred

mail server suggestions

Postposted on Wed Aug 29, 2007 11:03 am

I've been toying with the idea of setting up my own mail server at home but having never done that before I'm a little in the dark.

Here is what I'd like to know:

Which server should I go for? Linux has loads of packages available and I'm a little lost. I'm looking for simple, secure IMAP, SMTP and POP3 running under ubuntu (or maybe debain). I won't be needing management of hundreds of domains and or users. Any personal recommendations or comparison sites would be appreciated.

How big a security risk is mail server. They are obvious targets I suppose and I plan to run mine in a dedicated virtual machine in a full DMZ. Just how much grief am I likely to be letting myself in for?

What do need to do to my DNS settings? The MX bits are all to do with mail stuff right? Any suggestions for somewhere to find out about this stuff, some theory for beginners would be nice.

Thanks in advance!

In case anyone is wondering why I'd like my own mail server... the prospect of having unlimited IMAP mail boxes is what's got me going on this.
Fernando!
Your mother ate my dog!
cheesyking
Minister of Gerbil Affairs
 
Posts: 2241
Joined: Sun Jan 25, 2004 7:52 am
Location: That London (or so I'm told)

Re: mail server suggestions

Postposted on Wed Aug 29, 2007 11:17 am

cheesyking wrote:Which server should I go for? Linux has loads of packages available and I'm a little lost. I'm looking for simple, secure IMAP, SMTP and POP3 running under ubuntu (or maybe debain).

Typically the Unix "tradition" is that SMTP servers are separate from POP3/IMAP servers. SMTP is for delivery, while POP/IMAP is for remote access of delivered mail.

I'd suggest Postfix for SMTP and Dovecot for POP/IMAP. Exim is also a good simpler SMTP server. I've also heard that Cyrus IMAP and Courier IMAP are good for POP/IMAP.
Last edited by bitvector on Wed Aug 29, 2007 11:27 am, edited 3 times in total.
bitvector
Grand Gerbil Poohbah
 
Posts: 3234
Joined: Wed Jun 22, 2005 4:39 pm
Location: Mountain View, CA

Postposted on Wed Aug 29, 2007 11:19 am

Do you think it would be worth putting the pop/imap and smtp servers into different VMs?
Fernando!
Your mother ate my dog!
cheesyking
Minister of Gerbil Affairs
 
Posts: 2241
Joined: Sun Jan 25, 2004 7:52 am
Location: That London (or so I'm told)

Postposted on Wed Aug 29, 2007 11:24 am

cheesyking wrote:Do you think it would be worth putting the pop/imap and smtp servers into different VMs?

The POP/IMAP servers have to have access to the mail delivered to local spools by your MTA somehow, so I'm not sure what the point would be.
bitvector
Grand Gerbil Poohbah
 
Posts: 3234
Joined: Wed Jun 22, 2005 4:39 pm
Location: Mountain View, CA

Postposted on Wed Aug 29, 2007 11:25 am

Make sure your ISP doesn't block any of the relevant ports, I know that a few near me do.
Damn the torpedoes , full speed ahead.

AMD X2 4200+, Asus A8N-E, 3GBs of RAM, 7900GS
king_kilr
Maximum Gerbil
 
Posts: 4299
Joined: Sat Sep 25, 2004 11:23 pm
Location: Browsing the web far and wide.

Postposted on Wed Aug 29, 2007 12:00 pm

I think you are going over the top with VMs, this is *NIX not Windows so unless you setup something that reads the email and executes it then you shouldn't run in to any difficulties as long as you keep your software versions up to date.

I run exim on my server to receive the mail for some virtual domains, but that's more to do with it being the default in Debian rather than anything for it (apart from it not being sendmail). The configuration options are incredibly scary in their complexity and not well documented, but it is a very powerful setup.

I have a dynamic IP address that DynDNS resolves the domain name for. I set up MX records for each domain pointing to the server name in that domain and the server name then points to the IP address. That should ensure that the email hits your machine.

For outgoing mail, use the "smarthost" option where your SMTP server sends it to your ISPs SMTP server, that gets through outgoing port blocking and other stuff. Setup an SPF record in your DNS for your ISPs SMTP servers otherwise your mail may get tagged as SPAM by some places. Gmail shows SPF record checking if you send email from your setup to your gmail address to double check it.

You will get hit by spammers, I thoroughly recommend SpamAssassin and if running exim you can tie it in through sa-exim to reject at the SMTP stage, so the spam never actually gets fully received by your host. Make sure it is doing DNS RBL lookups though, in Debian it defaulted to not doing them and I had to install an extra package - I think it was a perl DNS package - before it would do the lookups.

Once the SMTP server has received the mail it can deliver it wherever, including in to an IMAP server, although I believe this is usually done by delivering in to mail box files and then running an IMAP server pointing at them, but I might be wrong.

Tips for troubleshooting:
1) Check your logfiles
2) Learn to speak SMTP i.e. telnet name@domain 25 and then type the SMTP commands (see RFC 821 http://www.ietf.org/rfc/rfc0821.txt) This way you can see what your server is doing when a mailhost tries to talk to it.
notfred
Grand Gerbil Poohbah
 
Posts: 3704
Joined: Tue Aug 10, 2004 10:10 am
Location: Ottawa, Canada

Postposted on Wed Aug 29, 2007 12:57 pm

The POP/IMAP servers have to have access to the mail delivered to local spools by your MTA somehow, so I'm not sure what the point would be.

Doh!

The server will be running VMs anyway and with price of memory and processing these days and that fact that I love VMs I think I might as well have a separate mail VM.

I should be fine in terms of port blocks and I've already got a static IP.

Sounds like sendmail is a no no while exim and postfix are worth a look.

For pop/imap: courier, dovecot or cyrus.

Thanks a lot guys, time to do some reading and actually finish building the hardware.
Fernando!
Your mother ate my dog!
cheesyking
Minister of Gerbil Affairs
 
Posts: 2241
Joined: Sun Jan 25, 2004 7:52 am
Location: That London (or so I'm told)

Postposted on Thu Oct 04, 2007 10:41 am

Well, I'm chuffed at the moment.

Mail servers are a lot easier to set up than I thought!

I've got exim4 courier fetchmail procmail and spamassassin installed and talking to each other. (for the most part anyway)

The bug I've got at the moment is that I can't relay mail through exim from anywhere but my local network. I thought all I had to do was enable TLS and it would allow me to relay form networks I hadn't specified. Any suggestions?
Fernando!
Your mother ate my dog!
cheesyking
Minister of Gerbil Affairs
 
Posts: 2241
Joined: Sun Jan 25, 2004 7:52 am
Location: That London (or so I'm told)


Return to Linux, Unix, and Assorted Madness

Who is online

Users browsing this forum: No registered users and 2 guests