Email Server Issues (postfix, rainloop, dovecot)

Posted March 25, 2014 14.7k views
Hi, I am trying to setup my own mail server to serve my personal email address, ""... I don't plan on having any other email accounts on this server aside from this one. What I did... Install Postfix for smtp.. Install Dovecot for IMAP.. Install Rainloop for webmail.. The Zone file for my domain... -----------Begin Zone File-------------- $TTL 1800 @ IN SOA NS1.DIGITALOCEAN.COM. ( 1395759915 ; last update: 2014-03-25 15:05:15 UTC 3600 ; refresh 900 ; retry 1209600 ; expire 1800 ; ttl ) IN NS NS1.DIGITALOCEAN.COM. MX 5 NS NS2.DIGITALOCEAN.COM. NS NS3.DIGITALOCEAN.COM. TXT google-site-verification=SUaAi0AD-OTTO1y4mzyqMcKu72WFpGTiLgNiNxYYS1o @ TXT "v=spf1 a ~all" www CNAME @ @ IN A ------------End Zone File---------------- The Zone File for my webmail domain... -----------Begin Zone File-------------- $TTL 1800 @ IN SOA NS1.DIGITALOCEAN.COM. ( 1395679621 ; last update: 2014-03-24 16:47:01 UTC 3600 ; refresh 900 ; retry 1209600 ; expire 1800 ; ttl ) IN NS NS1.DIGITALOCEAN.COM. NS NS2.DIGITALOCEAN.COM. NS NS3.DIGITALOCEAN.COM. @ IN A ------------End Zone File---------------- What I can do... I can send email with no issues through the terminal via the command, echo "This is a test message." | mail -s Hello I can also send email through Heirloom mailx I can recieve email from my root user account (I send email to, using the terminal command) I can login and view my inbox through my webmail. What I can't do... Recieve email sent from my gmail address. (no mailer:daemon error message from my gmail at the time of sending this ticket.) Send email from my webmail app (authentication failed). Is there something wrong with my configurations? Thanks

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
4 answers

I am now able to send email through my rainloop webmail account...

To do this, I removed postfix from chroot and set the saslauthd to Default. Now my only problem is receiving email.

still can't receimails...
I can't connect to mydomain at port 25 through telnet (connect failed)

this is the output of my netstat -plntu command

my postfix main conf

GNU nano 2.2.6 File: /etc/postfix/

# See /usr/share/postfix/ for a commented, more complete version

# Debian specific: Specifying a file name will cause the first
# line of that file to be used as the name. The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

readme_directory = no

# TLS parameters
smtpd_tls_cert_file = /etc/ssl/certs/smtpd.crt
smtpd_tls_key_file = /etc/ssl/private/smtpd.key
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.

myhostname =
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination =, localhost, localhost.localdomain, localhost
relayhost =
mynetworks = [::ffff:]/104 [::1]/128
mailbox_command =
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_interfaces = $myhostname
inet_interfaces = $myhostname, localhost
inet_protocols = all
home_mailbox = Maildir/
smtpd_sasl_local_domain =
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination reject_sender_login_mismatch
smtp_tls_security_level = may
smtpd_tls_security_level = may
smtpd_tls_auth_only = no
smtp_tls_note_starttls_offer = yes
smtpd_tls_CAfile = /etc/ssl/certs/cacert.pem
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom
milter_default_action = accept
milter_protocol = 2
smtpd_milters = inet:localhost:8891
non_smtpd_milters = inet:localhost:8891

Finally figured out the problem....

It was an IPtables Rules conflict.

I flushed the iptables and redid all the rules to allow smtp, imap, pop3 and icmp traffic.

I had no idea why I had these iptable rules in the firstplace. I never configured it. I had another droplet and it did not have the same rules.