Search code examples
phpemailsslsmtpimap

Can I have a valid mail server without buying a certificate?


I'm mounting my own mail server and I really get it working now (telnet), I just need to configure IMAP to finish.

BUT three things:

  1. I used telnet to send email to gmail. OK! but the mail arrived says: Gmail can't verify that example.com actually sent this message.
  2. I used gmail to send email to my mail server. OK! (Emails arrived fine, I go to /var/spool/mail/virtual/(mailbox) --> nano *filename*)
  3. I cannot connect to the account (for example myaccount@example.com) in Roundcube, I go to the logs and there's an error on imap: dovecot: imap-login: Fatal: Can't load ssl_cert: There is no valid PEM certificate. (You probably forgot '<' from ssl_cert=<)

During the configuration of the mail server I have seen some parameters related to SSL and certificates, but that's my question:

Is necessary to buy a SSL certificate, can I configure it with self-signed certificates? Can I avoid SSL over IMAP?

Thanks.


Solution

  • buying SSL is not necessary, you need valid domain and SPF record, like

    v=spf1 include:example.com ~all
    

    learn more here