• LinuxGuyF28A4E59

    This is my second time setting up a Linux email server. Following the directions in your tutorial for setting up an email server in CentOS 6, I was able to set up a working email server on CentOS 7. After realizing that you made a tutorial specifically for CentOS 7, I decided to try it out on a fresh system. I’m having some troubles though…

    If I’m reading it right, according to this tutorial, the only files in /etc/postfix/ssl in the end are: server.key, server.key.secure, server.csr, server.crt

    However, the edits to /etc/postfix/main.cf make reference to the following in /etc/postfix/ssl which are not present: smtpd.key, smtpd.crt, cacert.pem

    postfix is failing to send email with errors in /var/log/maillog like:

    warning: cannot get RSA certificate from file /etc/postfix/ssl/smtpd.crt: disabling TLS support
    warning: TLS library problem: 11134:error:02001002:system library:fopen:No such file or directory:bss_file.c:398:fopen(‘/etc/postfix/ssl/smtpd.crt’,’r’):

    and

    cannot load Certificate Authority data: disabling TLS support
    warning: TLS library problem: 8846:error:02001002:system library:fopen:No such file or directory:bss_file.c:169:fopen(‘/etc/postfix/ssl/cacert.pem’,’r’):

    I suppose I can rename all of the “server” files to “smtpd” files, but then I’m still missing cacert.pem. Am I missing a step?

    • Thanks LinuxGuyF28A4E59, post updated . Just remove that cacert.pem line and rename smtpd.* to server .* .. Thanks for checking ..

      • BTW, how to set ip DKIM (DomainKeys Identified Mail) working with postfix after i follow though this doc? (Can i just use server.key in this doc for DKIM TXT record?)

  • Richard Crampton

    Fantastic article; right level of depth and explanation. I am new to setting up mail servers on linux, and this article was incredibly helpful. Now have a working mail server for JIRA to use; many thanks!

  • Rob Woof

    Very clear and systematic instructions, and I think I have followed them correctly. Unfortunately I have not yet got postfix working. At least, I’m at the stage of trying to test it using telnet, and it keeps either rejecting the connection or closing the connection. I’m stumped. It’s either:

    $ telnet smtp.mydomain.com.au 587
    Trying 10.10.0.58…
    telnet: connect to address 10.10.0.58: Connection refused
    telnet: Unable to connect to remote host
    $

    or

    $ telnet smtp.mydomain.com.au 25
    Trying 10.10.0.58…
    Connected to smtp.mydomain.com.au.
    Escape character is ‘^]’.
    Connection closed by foreign host.

    $

    The result for 465 is the same as for 25. All three ports are open in the firewall (25, 465 and 587). I have no idea where to go from here. I suspect that I have missed or mistyped something while following the instructions above, but I have no ideas on how to troubleshoot it to find the issue.

    Any troubleshooting pointers?

    • scarto

      did you make port forwording on router ?

      • No, no port forwarding on router.
        I got the same error in Fedora 22. and there must has some error with this doc.

      • Andy Foster

        You don’t need to forward any ports on your router if you’re doing this within a single network, which I would recommend for initial setup and testing. Once you know it’s working within one network, then forward the ports on your router to permit access from other networks.

        The document states to include two directives for inet_interfaces. Make sure you only have:
        inet_interfaces = all
        If that’s followed by:
        inet_interfaces = localhost
        then postifx will only listen on the link-local interface.

        You can see what interface and port a service is listening on with netstat -plunt

    • Plumppuppyfilms Owner

      I have the same problem, just instantly closes the connection. Can’t do anything

    • Gabriel Alejandro Scarcella

      This work great for me. I got connection refused first, fixed it with correct port forwarding on router

    • joonas

      The problem is in the /etc/dovecot/conf.d/10-master.conf file.
      I found my answer to the problem here: http://serverfault.com/questions/628966/dovecot-error-unknown-setting-unix-listener

  • David

    I cannot set up the connection with SSL/TLS instead of STARTTLS. It drop an error. When trying with STARTTLS setting up the account on Mozilla Thunderbird, it says the username and password are incorrect. Tried many times but could do nothing else.

  • Pingback: Setup mail server on centos 7 [Email with Postfix, Dovecot and MariaDB on CentOS 7] | FoxTech Lab()

  • kamal CHIKH ECHIOUKH

    Thank you very much. Very clear

    —-
    Kamal CHIKH ECHIOUKH

  • Ezeogu Melville

    pardon this question, but how did you open the mail GUI…???

  • Prashant varshney

    How can I access the mail server from UI after completing step 15?

  • Omar OKA

    Thanks , everything is work

  • Omar Oka

    How i can enable calendar on my mail server ?????

  • Linode User

    Followed tutorial exactly using a Linode server. Tons of issues. Would not recommend.

  • Andrej Bd

    Thank you for good and useful article.

  • pina

    Thank you for the instructions. I have one question – How can I set up multiple e-mail addresses for one user in the same domain?

  • Pingback: How to setup mail server in centos 6 ( postfix-dovecot )()

  • Pingback: Setup mail server on ubuntu 14.04 ( Postfix - dovecot )()

  • Gabriel Alejandro Scarcella

    Work great for me on CentOS 7. Running on a google cloud server.
    Thanks a lot!

  • Khoi Thinh

    Can i setup Mail on Server using Amazon instance EC2 (Centos 7 already installed). I don’t have any domainm i just have elastic IP which is not really static IP or global IP.

  • Mastah

    I just fount this “tutorial” and must say ,,,, useless, doesn’t work on my CentOS 7, can open webmail but whatever i do it seems to not sending email or receiving emails.
    Any suggestions ?

    • Mike Johnston

      That’ll get you an answer.. Insult the person that took the time to do this for free…and then ask for suggestions. lol

  • Informatic

    Good evening,

    Please I followed all the configuration steps, but in the end I can not run my email server with SSL support / tls. What should I do?

    Answer me please I really need your help

  • psyche699

    hello,

    very clear, thanks but i have a probleme with password user.
    Its not working, i test with mozzila thunderbird, and i have a erro for validating password.

    so, i change the password user with : passwd john
    but after the thunderbird have the error with the new password

    please help me….

    • TRëX

      For Thunderbird account setup

      Incoming: POP3, server hostname=ip address of server, port=110, ssl=STARTTLS, authentication =normal password

      Outgoing: SMTP, server hostname=ip address of server, port=25, ssl=STARTTLS, authentication=normal password

  • Tested and working here, thank you for your time bro.

  • rorian

    Thanks 4 the tutorial!
    I did this… and I’ve got
    Recipient address rejected: Access denied

    while trying to send mail via telnet

    Centos7, webmin

  • Wonderhost

    Hi Kriza,

    Thank you for the well explained tutorial.
    If I need to add another domain for the mail service. What changes that I need to do in postfix configuration file?

  • Rohan

    Hi team,

    Nice tutorial. But won’t you have to install bind and add mx records, PTR records and TXT records(contains SPF) so that you can send mails successfully to even Gmail email ID’s and do not get caught in the spam folder

    Would really appreciate if someone could help me with the same.

    Regards,
    Rohan

  • C64Gamer

    I can send emails to other mail servers but if i try to send an email to my new mailserver i always get: “Recipient address rejected: User unknown in local recipient table”. Any ideas?