[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How to setup a simple email server?



On Sat, 25 Jan 2014 13:09:52 -0600
Garry <gconn77@icloud.com> wrote:

> I would like to setup a simple email server and run it out of my
> house. I have everything needed in order to do it. In fact I had one
> setup successfully about a year ago and crashed it. I can't figure
> out how I did it. 
> 
> There's only two email addresses I would like to setup. 
> 
> I would like to use postfix and dovecot; I don't need MySQL. 
> 
> My ISP seems to block port 587; all other ports are open (25, 110,
> etc.)
> 
> I have issues wrapping my mind around setting up mx records. 

An MX record is a hostname (some servers will accept an IP address,
which is incorrect, and many will not) which in turn is an A record
pointing to your IP address. Whoever hosts your domain A records also
hosts the MX record.

e.g. you have an A record 'mail.fredbloggs.tld' which resolves to your
IP address, and an MX record which resolves to 'mail.fredbloggs.tld'.

You can have more than one MX record, with priorities, with e.g. a
lower priority entry pointing to a backup mail server which will
collect mail when your server is down, and forward it when it is back
up. I've never felt the need for one, legitimate mail servers will
re-try for usually a couple of days, and if your server is down for a
few hours, all you will lose is spam. If a legitimate server does give
up, it will notify the sender that the email did not get through.

To send email directly from your server (i.e. not via a smarthost
somewhere else) you need to jump through a few more hoops: you will
need a DNS PTR (reverse DNS) record configured at your ISP for your IP
address, you can probably do this yourself if your ISP provides a web
control panel, otherwise you will need to ask for it to be done. The
PTR must resolve to a hostname which resolves back to your IP address.
This doesn't have to be the same hostname as your MX record uses, but
it is simplest if it is.

You will also need to set the FQDN or primary hostname (I don't know
what Postfix calls it, but it is what is sent as the SMTP HELO or EHLO
banner) of your mail server program to something which can be resolved
in public DNS.

You may get away with the bare domain name e.g. 'fredbloggs.tld', but
strictly speaking a DNS server should not return an IP address for
this. In practice, most DNS servers will return the address of
'www.fredbloggs.tld' if asked for just the domain name. That
(preferably) won't be your IP address, but it will be name resolution,
and at the moment, that will be enough. To be safest, configure the FQDN
to be the same hostname as you used for the MX record. It doesn't have
to bear any resemblance to the actual computer hostname.

If you can't get the DNS records sorted out, or if your IP address is
part of a block which has a bad spam history and the ISP isn't
interested in keeping a good reputation, then you may need to send mail
via a smarthost. Either your ISP or your domain host may provide one as
part of your package. One big advantage of running your own mail server
is that if your email is refused by another server, you generally have
a fairly detailed report as to why it happened.

> 
> The domain is registered on namecheap.com
> 
> My IP address is static ipv4. 
> 
> I'm running (would like to keep running) Debian 6 32bit. 

Which loses security support very soon. Time to upgrade, I'm afraid.

> 
> I've followed all the various guides that pull up in search; with
> each I run into problems I can't seem to resolve. 
> 
> Can someone point me to a tutorial or provide me with some resources
> I can follow? I am very appreciative with any help willing to be
> offered. Thank you. 
> 
Someone else will need to help with Postfix, I'm using exim4. When this
is installed, Debian provides a short questionnaire to set up most
simple mail server configurations, and it is possible that Debian does
something similar for Postfix.

-- 
Joe


Reply to: