Home email server setup - stuck

Hello,

Firstly, I am using Debian 7.1, updated (as of today), I installed postfix, sasl, and dovecot. I have read through various online tutorials and quick installation guides, videos etc. And, ventured into the actual text of postfix, sasl and dovecot.

Everything is installed and "appears" to be running. I can start and stop the services.

I have three questions:

1.) How can I troubleshoot the email process? In other words, how can I determine where the error is that is preventing me from sending and receiving email? Any tips would be greatly appreciated.

2.) I currently have a dynamic IP. I believe that might be a problem, with sending email? I just want to have a server for my personal (and family) can have email address served from home server. Nothing major - but even the simplest setups seem to be major =( Should I just get a static IP? Or, is there a good solution with dynamic IP address?

3.) How can I stop spam relaying from my home server? I haven't got it setup where it is working, but I assume, soon enough, spammers would find it, and relay their junk from my email server =( Any tips to where I can dodge that before it occurs?

Thanks again.

Jalisco

Usually dynamic IP rarely change. When it does, simply tell your domain provider your new IP.

How did you make this server (more precise: MTA) known to its peers? The most common way is to add a "MX" ("mail exchange") record into the DNS zone. I suppose you haven't built your own DNS domain too, have you?

I hope this helps.

bakunin

I setup ddclient to automatically update my IP - it checks it every five minutes.

It appears that my ISP changes my IP for me almost daily (once per day). I don't know why it does that - my computer is always online. But, it gets changed every night around 1 am.

As to the second question. I don't really know how it's set up. MTA = mail transfer agent? I thought that's what Postfix was? The server is not setup as a domain, e. g. the hostname is not the domain name.

I have not setup a dns server, would that help? If so, I can try it. I didn't know if I needed to set that up as well.

---------- Post updated at 08:49 AM ---------- Previous update was at 05:12 AM ----------

at a minimum, this is a problem I am working through...chug chug, little train that could =)

Transcript of session follows.

 Out: 220 littlebeak ESMTP Postfix (Debian/GNU)
 In:  EHLO mail-ea0-f182.google.com
 Out: 250-littlebeak
 Out: 250-PIPELINING
 Out: 250-SIZE 10240000
 Out: 250-VRFY
 Out: 250-ETRN
 Out: 250-STARTTLS
 Out: 250-ENHANCEDSTATUSCODES
 Out: 250-8BITMIME
 Out: 250 DSN
 In:  STARTTLS
 Out: 454 4.7.0 TLS not available due to local problem
 In:  QUIT
 Out: 221 2.0.0 Bye

Yes, postfix is one MTA (sendmail would be another, etc.). If you send mail your client sends it to your own MTA. This picks it up and transfers it to another MTA, this one maybe to yet another one, etc., finally the last MTA stores it and - upon request of the client of the recipient - sends it to the recipients client. Now, the next to last MTA in this chain has to know somehow that it has to transfer the mail to the last MTA for this to work. Therefore you have to make your system with postfix installed known to the MTA of your ISP (or whoever runs the next-to-last MTA, from which you get your mails) so that your MTA is being delivered the mails adressed to you(r domain).

Usually it works like this: you run "your.domain.com" and you have many systems in it. Your users have mail adresses "user@your.domain.com", but in fact they sit on "system1.your.domain.com", "system2.your.domain.com", etc.. This is done by setting up an MTA system like you did, say "mta.your.system.com" and then create a MX record, which states "mta.your.system.com" to be the mail exchange of "your.domain.com" and defining the all users there somehow (typically something like LDAP is used for this).

If you want to set up your own domain you would need a (at least one) static IP address first and then still would have to make your domain known. This means getting your (primary) DNS server (the one responsible for your domain) to be recognized at the ISPs DNS. They would probably hold "domain.com" and would now "delegate" the responsibility for "your.domain.com" to you.

I know, this all doesn't help you immediately, but i thought it would be a good idea to show the general ideas and concepts behind the mail (and DNS) system.

I hope this helps.

bakunin

thanks for the tip on the code tags, will do that in the future.

Thanks for the information.

I think I have that all setup with my isp. I have mx record setup there. I have a dynamic IP, which is automatically updated with ddclient.

I have read that dynamic IPs are not often relayed, as an anti-spamming policy by many, if I understood that correctly. So, I don't know if my server will work long term.

I think my problem is local. When I send an email to my domain, it appears from the returned email, that the email actually made it there, before being rejected by the domain - for the same reason mentioned above, local error. will work on it some more today =)