Hi all,
Sorry for another question about how to configure email but I’ve spent the whole last three days trying to do it with no success. I was able to correctly receive email using IMAP but wasn’t able to send emails through SMTP. I read a lot of tutorials and changed so many things that I decided to start with a new fresh installation (Ubuntu 15.10, Webmin 1.791) and start asking.
I’ve created a new virtual server with domain name “agsh.net” and default parameters. I’ve created a MX record “mail.agsh.net” pointing to the server using the VPS provider (Contabo) user console. I’ve also created a test user “prueba.agsh” with email address “prueba@agsh.net”.
Following the instructions in http://wiki.dovecot.org/TestInstallation, if I make a local telnet connection I get (not the real password):
root@vmi67186:~# telnet localhost 143
Trying ::1…
Connected to localhost.
Escape character is ‘^]’.
- OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE AUTH=PLAIN] Dovecot ready.
a login “prueba.agsh” “password”
a OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS THREAD=ORDEREDSUBJECT MULTIAPPEND URL-PARTIAL CATENATE UNSELECT CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS BINARY MOVE SPECIAL-USE] Logged in
e logout - BYE Logging out
e OK Logout completed.
Connection closed by foreign host.
However, when I make a telnet from a external PC I get:
* OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE LOGIN
DISABLED] Dovecot ready.
a login “prueba.agsh” “password”
- BAD [ALERT] Plaintext authentication not allowed without SSL/TLS, but your cli
ent did it anyway. If anyone was listening, the password was exposed.
a NO [PRIVACYREQUIRED] Plaintext authentication disallowed on non-secure (SSL/TL
S) connections.
I’ve notice there is a small difference in the response when connected locally with respect to the instructions in http://wiki.dovecot.org/TestInstallation. Instead of
…LOGIN-REFERRALS ID ENABLE STARTTLS AUTH=PLAIN]…
I get
…LOGIN-REFERRALS ID ENABLE IDLE AUTH=PLAIN]…
So I decided to enable SSL connections (Dovecot networking and mail protocol options > Accept SSL connections? > Yes). However, after reloading Dovecot, the telnet connection is closed when I try to connect to the server.
root@vmi67186:~# telnet localhost 143
Trying ::1…
Connected to localhost.
Escape character is ‘^]’.
Connection closed by foreign host.
This is what the log says about it:
ar 21 13:35:15 vmi67186 dovecot: imap-login: Fatal: Can’t load ssl_cert: There is no valid PEM certificate. (You probably forgot ‘<’ from ssl_cert=<)
Mar 21 13:35:15 vmi67186 dovecot: master: Error: service(imap-login): command startup failed, throttling for 4 secs
To solve the error I’ve uncommented the lines:
ssl_cert = </etc/dovecot/dovecot.pem
ssl_key = </etc/dovecot/private/dovecot.pem
in file /etc/dovecot/conf.d/10-ssl.conf
However, when restarting Dovecot:
doveconf: Fatal: Error in configuration file /etc/dovecot/conf.d/10-ssl.conf line 12: ssl_cert: Can’t open file /etc/dovecot/dovecot.pem: No such file or directory
I’ve managed to solve this error by using /etc/webmin/miniserv.pem as ssl_cert and ssl_key, but I guess this is not secure. Where is the default certificate? Do I need to generate one?
Any help will be greatly appreciated.