At a minimum you need the SMTP (25) port open in both directions. You should have the Submission (587) port open for incoming traffic, if you want mobile clients to be able to send email. For your clients to pick up mail you need either IMAP (143) or IMAPS (993) open for incoming traffic, although it would be better to have both open as sometimes one or the other is firewalled by ISPs.
Setting up your own SMTP server can be somewhat difficult. Besides requiring a static IP address, there are several DNS records you need to setup. Either Postfix or Exim4 will work. There are a number of posts dealing with SMTP server issues. You could configure your clients to use a relay for outgoing messages.
If you do choose to setup your own mail server, you will need to deal with incoming spam. Your clients (cellphone and laptop) should connect on the Submission port (587) and authenticate. exim4
can authenticate using your dovecot
server, I don't know if postfix
will do the same. You will need port 25 open in both directions to allow mail to flow to other servers.
If you don't install postfix
or exim4
you will likely want to provide a light weight server like ssmtp
to deliver system notifications.
Having a single place to manage your mail is a good idea. Dovecot is a reasonably easy to configure server that provide IMAP services. I would configure it to listen on both the IMAP (143) and IMAPS (993) ports. I believe dovecot listens on both these ports when you use the imap
protocol.
You are correct in not using the POP protocols.
If you are not running your own email (SMTP) server for incoming mail you can use a program like fetchmail
to get your mail from the server that is is being delivered to. You will need the appropriate port open to connect you your server. It will need a Mail Delivery Agent to deliver the mail. One option is procmail
, although you may be able to use the dovecot LDA service.