[Solved ?] Completely reinstall email

I can now send from Usermin after I commented out:

#smtp_sasl_auth_enable = yes

From the /etc/postfix/main.cf section:

mailbox_command = /usr/bin/procmail-wrapper
smtpd_tls_security_level = may
smtpd_tls_mandatory_protocols = SSLv3, TLSv1
smtpd_tls_mandatory_ciphers = high
smtpd_sasl_auth_enable = yes
smtpd_tls_auth_only = yes
#smtp_sasl_auth_enable = yes
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
compatibility_level = 2

--- Original issue follows ---

After several years, I updated my virtualmin license a few months ago on an old server. I wasn't using the email services on that old server. However, I now have an urgent need to get an email address running on one of my domains there and find that none of the email services (dovecot, postfix, saslauth) seem to be working properly. Having spent a few days trying to work through the problems, I'm getting a desperate and am willing to apt purge all of the related packages and reinstall to get a working email configuration.

Is there a guide for this?

PS: At this point I'm desperate enough that all I really need to have running is one webmail email address on one domain if that simplifies the guide. I can even do without spam filtering.

Operating system Debian Linux 9 Webmin version 1.850 Usermin version 1.720 Virtualmin version 5.99 Theme version Authentic Theme 18.49-8 Kernel and CPU Linux 4.9.36-x86_64 on x86_64 Processor information Intel(R) Xeon(R) CPU E5-2680 v2 @ 2.80GHz, 4 cores

Status: 
Needs review

Comments

Howdy -- there unfortunately isn't a guide for reinstalling all the packages, though we're happy to help you troubleshoot the issue you're experiencing in order to get things working.

Can you describe the problems that you're having, including any errors you're receiving? Be sure to list any errors in /var/log/mail.log. Thanks!

This is the log that happens when I attempt to send to my gmail address from Usermin. (Hope this log excerpt is adequately anonymized.)

root@my-linode:/var/log# tailall mail.log mail.info mail.err mailman/error mailman/post mailman/qrunner mailman/smtp mailman/subscribe mailman/vette /var/webmin/*log /var/webmin/miniserv.error
...
web.browser.ip.address - root [25/Jul/2017:18:35:22 +0000] "GET /index.cgi/?xhr-info=1 HTTP/1.1" 200 25070
Jul 25 18:35:30 my-linode dovecot: imap-login: Debug: SSL: elliptic curve secp384r1 will be used for ECDH and ECDHE key exchanges
Jul 25 18:35:30 my-linode dovecot: auth: Debug: auth client connected (pid=24323)
Jul 25 18:35:30 my-linode dovecot: auth: Debug: client in: AUTH#0111#011PLAIN#011service=imap#011secured#011session=SomeHashCodeMaybe/fi#011lip=my.ip.address#011rip=my.ip.address#011lport=143#011rport=36546#011resp=...== (previous base64 data may contain sensitive data)
Jul 25 18:35:30 my-linode dovecot: auth-worker(23698): Debug: pam(jb.mydomain,my.ip.address,<SomeHashCodeMaybe/fi>): lookup service=dovecot
Jul 25 18:35:30 my-linode dovecot: auth-worker(23698): Debug: pam(jb.mydomain,my.ip.address,<SomeHashCodeMaybe/fi>): #1/1 style=1 msg=Password:
Jul 25 18:35:30 my-linode dovecot: auth: Debug: client passdb out: OK#0111#011user=jb.mydomain
Jul 25 18:35:30 my-linode dovecot: auth: Debug: master in: REQUEST#0113605397505#01124323#0111#0119c20a63675a3a0d1f6ca8650cfd57c33#011session_pid=24324#011request_auth_token
Jul 25 18:35:30 my-linode dovecot: auth-worker(23698): Debug: passwd(jb.mydomain,my.ip.address,<SomeHashCodeMaybe/fi>): lookup
Jul 25 18:35:30 my-linode dovecot: auth: Debug: master userdb out: USER#0113605397505#011jb.mydomain#011system_groups_user=jb.mydomain#011uid=1009#011gid=1010#011home=/home/mydomain/homes/jb#011auth_token=52360aa88e013e66fdf85f8369356a749128a7f5
Jul 25 18:35:30 my-linode dovecot: imap-login: Login: user=<jb.mydomain>, method=PLAIN, rip=my.ip.address, lip=my.ip.address, mpid=24324, secured
Jul 25 18:35:30 my-linode dovecot: imap(jb.mydomain): Debug: Effective uid=1009, gid=1010, home=/home/mydomain/homes/jb
Jul 25 18:35:30 my-linode dovecot: imap(jb.mydomain): Debug: Namespace inbox: type=private, prefix=, sep=, inbox=yes, hidden=no, list=yes, subscriptions=yes location=maildir:~/Maildir
Jul 25 18:35:30 my-linode dovecot: imap(jb.mydomain): Debug: maildir++: root=/home/mydomain/homes/jb/Maildir, index=, indexpvt=, control=, inbox=/home/mydomain/homes/jb/Maildir, alt=
Jul 25 18:35:30 my-linode dovecot: imap(jb.mydomain): Debug: /home/mydomain/homes/jb/Maildir/.Sent/dovecot.index.cache: Compressed, file_seq changed 0 -> 1501007730, size=32, max_uid=0
Jul 25 18:35:30 my-linode postfix/pickup[19823]: 5ADD0372F3: uid=1009 from=<jb@mydomain.com>
Jul 25 18:35:30 my-linode postfix/cleanup[24328]: 5ADD0372F3: message-id=<1501007730.23709@mydomain.com>
Jul 25 18:35:30 my-linode postfix/qmgr[4512]: 5ADD0372F3: from=<jb@mydomain.com>, size=618, nrcpt=1 (queue active)
Jul 25 18:35:30 my-linode dovecot: imap(jb.mydomain): Connection closed in=778 out=2365
Jul 25 18:36:11 my-linode postfix/smtp[24957]: fatal: specify a password table via the `smtp_sasl_password_maps' configuration parameter
Jul 25 18:36:12 my-linode postfix/master[15841]: warning: process /usr/lib/postfix/sbin/smtp pid 24957 exit status 1
Jul 25 18:36:12 my-linode postfix/master[15841]: warning: /usr/lib/postfix/sbin/smtp: bad command startup -- throttling
^C
root@my-linode:/var/log#

The tailall script (which I wrote specifically to try to debug this mess) is:

#!/usr/bin/env perl
$cmd='tail -f '.join(" -f ", @ARGV );
open(my $fh,"-|", $cmd) || die "Can't open pipeline to '$cmd'";
while(<$fh>){
chomp;
next if /[^[:print:]]/;
next if $seen{$_};
$seen{$_}=1;
print "$_\n";
}

Also, the postfconf output:

$ postconf -nf
postconf: warning: /etc/postfix/master.cf: undefined parameter: mua_sender_restrictions
postconf: warning: /etc/postfix/master.cf: undefined parameter: mua_client_restrictions
postconf: warning: /etc/postfix/master.cf: undefined parameter: mua_helo_restrictions
postconf: warning: /etc/postfix/master.cf: undefined parameter: mua_sender_restrictions
postconf: warning: /etc/postfix/master.cf: undefined parameter: mua_client_restrictions
postconf: warning: /etc/postfix/master.cf: undefined parameter: mua_helo_restrictions
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
compatibility_level = 2
debug_peer_level = 5
debug_peer_list = google.com
home_mailbox = Maildir/
inet_interfaces = all
mailbox_command = /usr/bin/procmail-wrapper
mailbox_size_limit = 0
myhostname = my-linode.members.linode.com
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
readme_directory = no
recipient_delimiter = +
smtp_sasl_auth_enable = yes
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated
    defer_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_tls_auth_only = yes
smtpd_tls_cert_file = /etc/postfix/postfix.cert.pem
smtpd_tls_key_file = /etc/postfix/postfix.key.pem
smtpd_tls_mandatory_ciphers = high
smtpd_tls_mandatory_protocols = SSLv3, TLSv1
smtpd_tls_security_level = may
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
virtual_alias_maps = hash:/etc/postfix/virtual

Hmm, this fatal error here may be causing Postfix to not function properly:

fatal: specify a password table via the `smtp_sasl_password_maps' configuration parameter

However, I don't see a reference to "smtp_sasl_password_maps" in your postconf output.

Can you copy in the contents of your /etc/postfix/master.cf file? It's possible the parameter is set in there.

Title: Completely reinstall email » [Solved ?] Completely reinstall email
Status: Active » Needs review
Body: View changes
/etc/postfix# cat main.cf
# See /usr/share/postfix/main.cf.dist 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 (Debian/GNU)
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/postfix/postfix.cert.pem
smtpd_tls_key_file = /etc/postfix/postfix.key.pem
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.

myhostname = my-linode.members.linode.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases

mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all

virtual_alias_maps = hash:/etc/postfix/virtual

home_mailbox = Maildir/
debug_peer_list = google.com
debug_peer_level = 5

mailbox_command = /usr/bin/procmail-wrapper
smtpd_tls_security_level = may
smtpd_tls_mandatory_protocols = SSLv3, TLSv1
smtpd_tls_mandatory_ciphers = high
smtpd_sasl_auth_enable = yes
smtpd_tls_auth_only = yes
smtp_sasl_auth_enable = yes
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
compatibility_level = 2

Hmm, that looks like the main.cf file... do you happen to have the master.cf file? They are both Postfix related configs, but master.cf is a bit different from the main.cf.

$ cat master.cf

#
# Postfix master process configuration file.  For details on the format
# of the file, see the master(5) manual page (command: "man 5 master" or
# on-line: http://www.postfix.org/master.5.html).
#
# Do not forget to execute "postfix reload" after editing this file.
#
# ==========================================================================
# service type  private unpriv  chroot  wakeup  maxproc command + args
#               (yes)   (yes)   (yes)   (never) (100)
# ==========================================================================
smtp inet n - - - - smtpd -v -o smtpd_sasl_auth_enable=yes
#smtp      inet  n       -       -       -       1       postscreen
#smtpd     pass  -       -       -       -       -       smtpd
#dnsblog   unix  -       -       -       -       0       dnsblog
#tlsproxy  unix  -       -       -       -       0       tlsproxy
#submission inet n       -       -       -       -       smtpd
#  -o syslog_name=postfix/submission
#  -o smtpd_tls_security_level=encrypt
#  -o smtpd_sasl_auth_enable=yes
#  -o smtpd_reject_unlisted_recipient=no
#  -o smtpd_client_restrictions=$mua_client_restrictions
#  -o smtpd_helo_restrictions=$mua_helo_restrictions
#  -o smtpd_sender_restrictions=$mua_sender_restrictions
#  -o smtpd_recipient_restrictions=
#  -o smtpd_relay_restrictions=permit_sasl_authenticated,reject
#  -o milter_macro_daemon_name=ORIGINATING
smtps inet n - - - - smtpd -o syslog_name=postfix/smtps -o smtpd_tls_wrappermode=yes -o smtpd_sasl_auth_enable=yes -o smtpd_reject_unlisted_recipient=no -o smtpd_client_restrictions=$mua_client_restrictions -o smtpd_helo_restrictions=$mua_helo_restrictions -o smtpd_sender_restrictions=$mua_sender_restrictions -o smtpd_recipient_restrictions= -o smtpd_relay_restrictions=permit_sasl_authenticated,reject -o milter_macro_daemon_name=ORIGINATING
smtps inet n - - - - smtpd -o syslog_name=postfix/smtps -o smtpd_tls_wrappermode=yes -o smtpd_sasl_auth_enable=yes -o smtpd_reject_unlisted_recipient=no -o smtpd_recipient_restrictions= -o smtpd_relay_restrictions=permit_sasl_authenticated,reject -o milter_macro_daemon_name=ORIGINATING
#628       inet  n       -       -       -       -       qmqpd
pickup    unix  n       -       -       60      1       pickup
cleanup   unix  n       -       -       -       0       cleanup
qmgr      unix  n       -       n       300     1       qmgr
#qmgr     unix  n       -       n       300     1       oqmgr
tlsmgr    unix  -       -       -       1000?   1       tlsmgr
rewrite   unix  -       -       -       -       -       trivial-rewrite
bounce    unix  -       -       -       -       0       bounce
defer     unix  -       -       -       -       0       bounce
trace     unix  -       -       -       -       0       bounce
verify    unix  -       -       -       -       1       verify
flush     unix  n       -       -       1000?   0       flush
proxymap  unix  -       -       n       -       -       proxymap
proxywrite unix -       -       n       -       1       proxymap
smtp      unix  -       -       -       -       -       smtp
relay     unix  -       -       -       -       -       smtp
#       -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
showq     unix  n       -       -       -       -       showq
error     unix  -       -       -       -       -       error
retry     unix  -       -       -       -       -       error
discard   unix  -       -       -       -       -       discard
local     unix  -       n       n       -       -       local
virtual   unix  -       n       n       -       -       virtual
lmtp      unix  -       -       -       -       -       lmtp
anvil     unix  -       -       -       -       1       anvil
scache    unix  -       -       -       -       1       scache
#
# ====================================================================
# Interfaces to non-Postfix software. Be sure to examine the manual
# pages of the non-Postfix software to find out what options it wants.
#
# Many of the following services use the Postfix pipe(8) delivery
# agent.  See the pipe(8) man page for information about ${recipient}
# and other message envelope options.
# ====================================================================
#
# maildrop. See the Postfix MAILDROP_README file for details.
# Also specify in main.cf: maildrop_destination_recipient_limit=1
#
maildrop  unix  -       n       n       -       -       pipe
  flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}
#
# ====================================================================
#
# Recent Cyrus versions can use the existing "lmtp" master.cf entry.
#
# Specify in cyrus.conf:
#   lmtp    cmd="lmtpd -a" listen="localhost:lmtp" proto=tcp4
#
# Specify in main.cf one or more of the following:
#  mailbox_transport = lmtp:inet:localhost
#  virtual_transport = lmtp:inet:localhost
#
# ====================================================================
#
# Cyrus 2.1.5 (Amos Gouaux)
# Also specify in main.cf: cyrus_destination_recipient_limit=1
#
#cyrus     unix  -       n       n       -       -       pipe
#  user=cyrus argv=/cyrus/bin/deliver -e -r ${sender} -m ${extension} ${user}
#
# ====================================================================
# Old example of delivery via Cyrus.
#
#old-cyrus unix  -       n       n       -       -       pipe
#  flags=R user=cyrus argv=/cyrus/bin/deliver -e -m ${extension} ${user}
#
# ====================================================================
#
# See the Postfix UUCP_README file for configuration details.
#
uucp      unix  -       n       n       -       -       pipe
  flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
#
# Other external delivery methods.
#
ifmail    unix  -       n       n       -       -       pipe
  flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
bsmtp     unix  -       n       n       -       -       pipe
  flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient
scalemail-backend unix - n n - 2 pipe
  flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension}
mailman   unix  -       n       n       -       -       pipe
  flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
  ${nexthop} ${user}

submission inet n - - - - smtpd -o smtpd_sasl_auth_enable=yes

Hmm, I'm not actually seeing any references to the parameter "smtp_sasl_password_maps" in your configs.

What output do you see if you run this command:

find /etc/postfix -type f | xargs grep smtp_sasl_password_maps

If that doesn't show any output, try restarting Postfix with the command "service postfix restart" -- and after running that command, do you see any errors listed in /var/log/mail.log?

# service postfix restart

==> mail.log <==
Jul 30 04:48:47 li89-226 postfix/postfix-script[31646]: fatal: the Postfix mail system is already running

# service postfix stop

# service postfix start

Jul 30 04:49:40 li89-226 postfix/postfix-script[31766]: fatal: the Postfix mail system is already running

# service postfix status

● postfix.service - Postfix Mail Transport Agent
   Loaded: loaded (/lib/systemd/system/postfix.service; enabled; vendor preset: enabled)
  Drop-In: /etc/systemd/system/postfix.service.d
           └─override.conf
   Active: active (exited) since Sun 2017-07-30 04:51:18 UTC; 58s ago
  Process: 32436 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
Main PID: 32436 (code=exited, status=0/SUCCESS)

Jul 30 04:51:18 ....members.linode.com systemd[1]: Starting Postfix Mail Transport Agent...
Jul 30 04:51:18 ....members.linode.com systemd[1]: Started Postfix Mail Transport Agent.

# service postfix stop

# service postfix status

● postfix.service - Postfix Mail Transport Agent
   Loaded: loaded (/lib/systemd/system/postfix.service; enabled; vendor preset: enabled)
  Drop-In: /etc/systemd/system/postfix.service.d
           └─override.conf
   Active: inactive (dead) since Sun 2017-07-30 04:53:21 UTC; 4s ago
  Process: 32436 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
Main PID: 32436 (code=exited, status=0/SUCCESS)

Jul 30 04:51:18 ....members.linode.com systemd[1]: Starting Postfix Mail Transport Agent...
Jul 30 04:51:18 ....members.linode.com systemd[1]: Started Postfix Mail Transport Agent.
Jul 30 04:53:21 ....members.linode.com systemd[1]: Stopped Postfix Mail Transport Agent.

# ps auxxwww|grep postfix

root       797  0.0  0.0  12720   972 pts/1    S+   04:57   0:00 grep postfix
root      3222  0.0  0.0  67724  2408 ?        Ss   Jul25   0:00 /usr/sbin/saslauthd -a pam -m /var/spool/postfix/var/run/saslauthd -r -n 5
root      3223  0.0  0.0  67724   844 ?        S    Jul25   0:00 /usr/sbin/saslauthd -a pam -m /var/spool/postfix/var/run/saslauthd -r -n 5
root      3224  0.0  0.0  67724   844 ?        S    Jul25   0:00 /usr/sbin/saslauthd -a pam -m /var/spool/postfix/var/run/saslauthd -r -n 5
root      3225  0.0  0.0  67724   844 ?        S    Jul25   0:00 /usr/sbin/saslauthd -a pam -m /var/spool/postfix/var/run/saslauthd -r -n 5
root      3227  0.0  0.0  67724   844 ?        S    Jul25   0:00 /usr/sbin/saslauthd -a pam -m /var/spool/postfix/var/run/saslauthd -r -n 5
root     15841  0.0  0.0  81164  4708 ?        Ss   Jul25   0:02 /usr/lib/postfix/sbin/master -w
postfix  23000  0.0  0.0  83392  6900 ?        S    Jul29   0:00 qmgr -l -t unix -u
postfix  23287  0.0  0.1  87460  8532 ?        S    Jul29   0:00 tlsmgr -l -t unix -u
postfix  26915  0.0  0.0  83228  6688 ?        S    04:17   0:00 pickup -l -t unix -u
postfix  32651  0.0  0.0  83228  6640 ?        S    04:54   0:00 anvil -l -t unix -u
postfix  32681  0.3  0.1 106960 10472 ?        S    04:55   0:00 smtpd -n submission -t inet -u -o stress= -s 2 -o smtpd_sasl_auth_enable=yes

Hmm, it sounds like something unusual is going on with the Postfix processes there.

You may want to try manually killing the processes related to Postfix, and once they're gone, then try restarting Postfix.

To do that, run these commands:

kill 15841
kill 23000
kill 23287
kill 26915
kill 32651
kill 32681

After that, try restarting Postfix again, and see if it starts within an error now.