I first installed Virtualmin on my server which I used to install Postfix + Dovecot and later Roundcube. All was working well, until due to a wordpress plugin issue 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 now login to my mail client (Roundcube) I notice from mail.log which makes it seem as if I'm being immedidately disconnected:
Jul 6 12:03:55 zh dovecot: imap-login: Login: user=<test>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, mpid=16236, secured, session=<eGB7DTcaWgB/AAAB> Jul 6 12:03:55 zh dovecot: imap(test): Disconnected: Logged out in=82 out=609 Jul 6 12:03:55 zh dovecot: imap-login: Login: user=<test>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, mpid=16241, secured, session=<ouF9DTcaWwB/AAAB> Jul 6 12:03:55 zh dovecot: imap(test): Disconnected: Logged out in=44 out=556 Jul 6 12:03:56 zh dovecot: imap-login: Login: user=<test>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, mpid=16247, secured, session=<n6qGDTcaXAB/AAAB> Jul 6 12:03:56 zh dovecot: imap-login: Login: user=<test>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, mpid=16248, secured, session=<Er2GDTcaXQB/AAAB> Jul 6 12:03:56 zh dovecot: imap(test): Disconnected: Logged out in=50 out=469 Jul 6 12:03:56 zh dovecot: imap(test): Disconnected: Logged out in=233 out=885
Whenever I send mail, in this case through Roundcube, I get this from my mail.logfile:
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]
This error produce this Roundcube error message:
SMTP Error (250): Authentication failed.
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
smtpdbanner = $myhostname ESMTP $mailname (Ubuntu) biff = no appending .domain is the MUA's job. appenddotmydomain = no Uncomment the next line to generate "delayed mail" warnings delaywarningtime = 4h readme_directory = no TLS parameters smtpdtlscertfile=/etc/ssl/certs/ssl-cert-snakeoil.pem smtpdtlskeyfile=/etc/ssl/private/ssl-cert-snakeoil.key smtpdusetls=yes smtpdtlssessioncachedatabase = btree:${datadirectory}/smtpdscache smtptlssessioncachedatabase = btree:${datadirectory}/smtpscache See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for information on enabling SSL in the smtp client. smtpdrelayrestrictions = permitmynetworks permitsaslauthenticated deferunauthdestination myhostname = ichangedmydomain.com aliasmaps = hash:/etc/aliases virtualaliasmaps = hash:/etc/aliases virtualaliasmaps = hash:/etc/postfix/virtual aliasdatabase = 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 mailboxcommand = procmail -a "$EXTENSION" mailboxsizelimit = 0 recipientdelimiter = + inetinterfaces = 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.
Howdy,
First off, for future reference, you can stop the flow of outgoing email by shutting off the Postfix service. You don't actually need to uninstall it.
As far as the problem you're seeing now -- what is the output of this command:
postconf -n
thank you for that tip, in hindsight I wish I knew better:
The following is from postconf -n
d
Okay, make sure that these options are added to your main.cf file:
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
And then, you have a mailbox_command line now, but it appears to be incorrect... try setting it to the following:
mailbox_command = /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME
Once you do all that, restart Postfix, and see if that works for you.
-Eric
I updated main.cf with the three lines you posted above.
The following is the mail.log from sending an email to my inbox from an outside server (Yahoo):
When trying to send an email from my server in mail.log I'm now getting:
Roundcube now gives the following:
.
Thank you once again for your input, I feel like the problem is almost solved.
This may be important as well: When sending to my main domain (let's call it main.com) I get:
Hi Eric,
Are you still able to help out? I'm a Software Engineer but I'm totally clueless on this one. My virtualmin is totally funky right now. Even when viewing my Users within Virtualmin the "Primary email address enabled?" option won't let me set it to yet. It keeps resetting to "no".
Please help