4

I'm trying to set up a mail server on a fresh Ubuntu 16.04 machine but I can't get it to work properly.

I'm using a Postfix/Courier setup with MySQL for authentication.

Receiving emails and reading them using any email client (using POP3 and IMAP) works as expected but when I'm trying to send something all I get is a authentication error and these errors appear in the log:

saslauthd[29975]: PAM unable to dlopen(pam_mysql.so): /lib/security/pam_mysql.so: undefined symbol: make_scrambled_password
saslauthd[29975]: PAM adding faulty module: pam_mysql.so
saslauthd[29975]: DEBUG: auth_pam: pam_authenticate failed: Module is unknown
saslauthd[29975]: do_auth         : auth failure: [user=office@testubuntu1604.com] [service=smtp] [realm=testubuntu1604.com] [mech=pam] [reason=PAM auth error]

This used to work perfectly in Ubuntu 14.04.

Are there any changes in Ubuntu 16.04 regarding PAM authentication I should know about?

5 Answers 5

5

Using Courier's authdaemon works, but it is necessary to perform the following to make the courier authdaemon usable from within Postfix's chroot:

sudo service courier-authdaemon stop
sudo rm -rf /var/run/courier/authdaemon/ /var/spool/postfix/var/run/courier/authdaemon/
sudo mkdir -p /var/spool/postfix/var/run/courier/authdaemon/
sudo ln -s /var/spool/postfix/var/run/courier/authdaemon/ /var/run/courier/authdaemon
sudo service courier-authdaemon start

Then just include the following in /etc/postfix/sasl/smtpd.conf

pwcheck_method: authdaemond
authdaemond_path: /var/run/courier/authdaemon/socket
mech_list: plain login
log_level: 9

source: https://www.hostsom.com/postfix-mysql-courier-imap-ubuntu-16-04-part3/

source: http://wiki.tolien.co.uk/Postfix_w/o_Maildrop#Courier-Authdaemon

(posting this as a new solution rather than a comment on the existing solution because I don't have the reputation to comment yet, and the existing solution was missing an important step)

2
  • +1mil man.....this shit is ridiculous. Tonight all of our email functionality completely broke just fixed IMAP and SMTP was next. Your solution fixed it for me
    – meanbunny
    Sep 15, 2016 at 4:09
  • Your answer has saved me after hours of research! All these postfix-courier-mysql guides are wrong for Ubuntu 16.04.
    – Petr
    Apr 12, 2017 at 22:10
2

Open and add these lines into sudo vim /etc/default/saslauthd file,

MECHANISMS="rimap" 
MECH_OPTIONS="127.0.0.1"
0
1

From what I understand pam_mysql is no longer being developed and that particular feature in it was deprecated years ago, the new update finally "broke" it. I have found no solution as of yet, other then migrating your authentication away from mysql, which for me isn't an option really, so still looking for a solution.

update: I just found this page, though I've not tested it out yet: http://osdir.com/ml/ubuntu-bugs/2016-04/msg23005.html

1
  • I gave those packages a shot but they didn't work. They kept throwing stack overflow errors. Moving away from MySQL wasn't an option so I migrated to Dovecot. This way I managed to keep the existing database with just a few alterations to the domains and users tables.
    – Alex M
    May 14, 2016 at 10:11
0

If you have a working IMAP server authentication setup, you can easily change postfix/saslauthd to use it instead of PAM:

"/etc/default/saslauthd": MECHANISMS="rimap" MECH_OPTIONS="127.0.0.1"

-1

If you use courier IMAP it's also possible to authenticate using its authdaemon like this https://www.hostsom.com/postfix-mysql-courier-imap-ubuntu-16-04-part3/

1
  • 1
    Welcome to Ask Ubuntu! Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference.
    – Thomas Ward
    Jul 18, 2016 at 19:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.