1

Anybody can suggest me a good tutorial to configure postfix as a secure smtp. I've installed it by this command sudo apt-get install mail-stack-delivery but I can't use it. In particular I haven't a domain but I've a direct ip and I would use my server on this address to send only mail trough my java webapp.

3
  • Primo, puo fare meglio con la domanda (e' poco chiara). Second, if you're looking to set up a relay server, what's preventing you from using an established mail provider?
    – NickW
    Oct 14, 2014 at 12:57
  • I don't want setting-up a relay server, I have to use my server, up on a dedicated ip without domain, as a mail server to send only. I've configured it, but it doesn't work as I expect Oct 14, 2014 at 13:07
  • You'll need a domain, as email addresses work better with them, you do not have to advertise the mail server to the world (no MX records), but it depends on where you want it to go afterwards (many internet hosts WILL NOT accept mail from servers without domain names, and MX records). That is why I suggest relaying through an established provider.
    – NickW
    Oct 14, 2014 at 14:37

1 Answer 1

1

The first you have to know: you have to deal with two, different, independent tasks. These are:

  1. Setting up postfix to use tls (or ssl)
  2. Setting up postfix to use authentication.

The second thing has the feature to only allow user authentication on encrypted channels, which could by also very useful if you don't like eavesdroppers.

These tasks requires total different configuration changes.

About (1): It works on 3 ways. SSL is only an encrypted port, mostly on TCP port 465. TLS starts with normal SMTP, and could be change to encrypted with the STARTTLS command from the client side. This method works on TCP port 25 or sometimes on port 587. To set up this is relative simple, the first which you should begin is here.

About (2): Postfix can only authenticate through sasl. SASL is an authentication protocol, but in our case it is practically daemon, similar to radius or kerberos, which can be asked about questions like: "User X with password Y, can I log him in?". The real authentication (comparing your /etc/shadow, or even your more complex data) will be done by the sasl. To do that, first, you had to install sasl, configure and test it. After that can you give to postfix the needed configuration changes, to be able to authenticate from sasl. About the details, here is a good documentation.

You must know: these things are independant changes. You will have probably a lot of problems, especially around the sasl daemon, which isn't really well documented. In its case, there good be a very good tool named strace (google for strace).

If you find problems (you will), come back and ask new question with your specific, detailed problems.

1
  • but I must have a domain? Or I can use a specific ip address? Oct 14, 2014 at 22:17

Not the answer you're looking for? Browse other questions tagged .