Virtualmin + Postfix + Dovecot + Roundcube

July 3, 2015 2.6k views
Email Linux Basics Nginx Ubuntu

I first installed Virtualmin on my server which I used to install Postfix + Dovecot and later Roundcube. All was working well, til my wordpress plugin got hacked and my server began to send SPAM email.

After following a number of tutorials I, noobishly, unisntalled Postfix (to prevent emails from being sent) while I debug.

Now I'm at a place where I've re-installed Postfix but to get it to work seems impossible, I've been stuck for days now.

I'm no longer able to send or receive emails.

Whenever I send mail I get this from my** mail.log** file:

Jul 3 16:43:20 zm postfix/smtpd[30489]: connect from localhost[127.0.0.1]
Jul 3 16:43:20 zm postfix/smtpd[30489]: disconnect from localhost[127.0.0.1]

In my** mail.err** log file I have this:

Jul 2 01:08:25 zm postfix/master[18886]: fatal: bind 0.0.0.0 port 25: Address already in use
Jul 2 01:09:07 zm postfix/postqueue[19034]: warning: Mail system is down -- accessing queue directly
Jul 2 01:09:27 zm postfix/postfix-script[19065]: fatal: the Postfix mail system is not running
Jul 2 01:09:33 zm postfix/master[19159]: fatal: bind 0.0.0.0 port 25: Address already in use
Jul 2 01:16:31 zm postfix/postfix-script[19660]: error: unknown command: ''
Jul 2 01:16:31 zm postfix/postfix-script[19661]: fatal: usage: postfix start (or stop, reload, abort, flush, check, status, set-permission
s, upgrade-configuration)
Jul 2 01:16:35 zm postfix/postfix-script[19667]: error: unknown command: ''
Jul 2 01:16:35 zm postfix/postfix-script[19668]: fatal: usage: postfix start (or stop, reload, abort, flush, check, status, set-permission
s, upgrade-configuration)
Jul 2 01:19:30 zm postfix/master[20032]: fatal: bind 0.0.0.0 port 25: Address already in use
Jul 2 01:19:31 zm postfix/master[20031]: fatal: daemon initialization failure
Jul 2 01:19:32 zm postfix/postfix-script[20033]: fatal: mail system startup failed
Jul 2 01:19:44 zm postfix/master[20141]: fatal: bind 0.0.0.0 port 25: Address already in use
Jul 2 01:19:50 zm postfix/master[20242]: fatal: bind 0.0.0.0 port 25: Address already in use
Jul 2 01:19:51 zm postfix/master[20241]: fatal: daemon initialization failure
Jul 2 01:19:52 zm postfix/postfix-script[20243]: fatal: mail system startup failed
Jul 2 01:20:00 zm postfix/master[20370]: fatal: bind 0.0.0.0 port 25: Address already in use

When I run *virtualmin check-config *this is some of the output:

"Mail server Postfix is installed and configured.
Postfix can support per-domain outgoing IP addresses, but is not currently configured to do so. This can be setup in the Postfix Mailserver module."

vi /etc/postfix/main.cf

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/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
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.

smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = ichangedmydomain.com
alias_maps = hash:/etc/aliases
#virtual_alias_maps = hash:/etc/aliases
virtual_alias_maps = hash:/etc/postfix/virtual
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = ichangedmydomain.com, localhost.com, , localhost
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all

Please I'd appreciate any help. (I'm not in a position to pay, this is for learning purposes mostly).

Thank you in advance.

Be the first one to answer this question.