# Postfix smtpd & saslauthd errors in /var/log/auth.log

## Souperman

I have the following errors in /var/log/auth.log:

```
Oct 30 08:41:15 wizard postfix/smtpd[18442]: mysql plugin couldnt connect to any host

Oct 30 08:41:15 wizard postfix/smtpd[18442]: mysql plugin couldnt connect to any host

Oct 30 08:41:15 wizard saslauthd[16203]: pam_mysql: error: sqllog set but logtable not set

Oct 30 08:41:15 wizard saslauthd[16203]: pam_mysql: error: sqllog set but logmsgcolumn not set

Oct 30 08:41:15 wizard saslauthd[16203]: pam_mysql: error: sqllog set but logusercolumn not set

Oct 30 08:41:15 wizard saslauthd[16203]: pam_mysql: error: sqllog set but loghostcolumn not set

Oct 30 08:41:15 wizard saslauthd[16203]: pam_mysql: error: sqllog set but logtimecolumn not set

```

I have Googled my fingers raw but I can't figure out the cause of the messages.  Has anyone seen these before?

----------

## UberLord

Looks like you've got PAM logging to a MySQL DB.

Why not just use syslog?

----------

## Souperman

 *UberLord wrote:*   

> Looks like you've got PAM logging to a MySQL DB.
> 
> Why not just use syslog?

 

Fair enough, where do I start looking to figure out how to do that?

----------

## UberLord

try looking in /etc/pam.d

and have a look at mysql and smtp entries

I don't have mysql installed so I can't tell you exactly where

----------

## Souperman

Hmmm nothing seems to stand out.  There isn't even an /etc/pam.d/mysql at all.  The way I see it the files in /etc/pam.d provide details for programs that want to use PAM as an authentication provider, which MySQL isn't doing.  Maybe I'm wrong.

I'll see what docs I can dig up in the meantime though.

----------

## UberLord

Maybe you've set postfix/sasl to authenticate users via MySQL?

----------

## Souperman

Yes, Postfix, Courier and SASL use a common MySQL DB for authentication.  I still don't understand those log messages. SASL works fine so I'm not sure what the problem is.

----------

## NickDaFish

Dammit.... I have exactally the same problem.

.......

Or should i say had!

I just trawled the pam_mysql forums on sourceforge and found this:

http://sourceforge.net/forum/forum.php?thread_id=773652&forum_id=17691

 *Quote:*   

> 
> 
> you can fix this by adding sqllog=0 to your smtp pam config file.
> 
> ie.
> ...

 

That seems to have done the trick   :Wink: 

----------

## Souperman

Thanks!  :Smile: 

----------

## hanj

Hello

I'm experiencing the same problem as mentioned in the other posts. I've added the sqllog=0 as suggested in the last post, but I'm still receiving this log entry for every SMTP connection.

I followed the virtual-mta howto. Everything appears to be working correctly. I'm using postfix/mysql/courier. Users are authenticated against the mysql database. I have SMTP_AUTH and tls working. I receive no errors besides the plugin error.

I'll supply my /etc/postfix/main.cf output, and /etc/pam.d/smtp

main.cf (IP/server removed):

```

alias_database = hash:/etc/mail/aliases

alias_maps = mysql:/etc/postfix/mysql-aliases.cf

broken_sasl_auth_clients = yes

command_directory = /usr/sbin

config_directory = /etc/postfix

daemon_directory = /usr/lib/postfix

debug_peer_level = 2

default_destination_concurrency_limit = 2

disable_vrfy_command = yes

home_mailbox = .maildir/

inet_interfaces = all

local_destination_concurrency_limit = 0

local_recipient_maps = $alias_maps $virtual_mailbox_maps

local_transport = local

mail_name = Secret

mail_owner = postfix

mailq_path = /usr/bin/mailq

manpage_directory = /usr/share/man

message_size_limit = 10485760

mydestination = $myhostname, localhost.$mydomain

mydomain = removeddomain.com

myhostname = server.removeddomain.com

mynetworks = xxx.xxx.xxx.xxx, 127.0.0.0/8

newaliases_path = /usr/bin/newaliases

queue_directory = /var/spool/postfix

readme_directory = /usr/share/doc/postfix-2.0.19/readme

relocated_maps = mysql:/etc/postfix/mysql-relocated.cf

sample_directory = /usr/share/doc/postfix-2.0.19/sample

sendmail_path = /usr/sbin/sendmail

setgid_group = postdrop

smtp_tls_note_starttls_offer = yes

smtp_use_tls = yes

smtpd_banner = My Banner Message.

smtpd_client_restrictions = permit_mynetworks,    permit_sasl_authenticated,    reject_rbl_client sbl-xbl.spamhaus.org

smtpd_helo_required = yes

smtpd_helo_restrictions = permit_mynetworks,    permit_sasl_authenticated

smtpd_recipient_restrictions = permit_mynetworks,   permit_sasl_authenticated,   check_helo_access regexp:/etc/postfix/helo_access   reject_invalid_hostname,   reject_non_fqdn_sender,   reject_non_fqdn_recipient,   reject_unknown_sender_domain,   reject_unknown_recipient_domain,   reject_unauth_destination,   reject_rbl_client sbl-xbl.spamhaus.org,   reject_rbl_client combined.njabl.org,   reject_rbl_client list.dsbl.org,   reject_rbl_client dul.dnsbl.sorbs.net,   reject_rbl_client cbl.abuseat.org,   reject_unauth_destination

smtpd_sasl_auth_enable = yes

smtpd_sasl_local_domain =

smtpd_sasl_security_options = noanonymous

smtpd_tls_CAfile = /etc/postfix/cacert.pem

smtpd_tls_cert_file = /etc/postfix/newcert.pem

smtpd_tls_key_file = /etc/postfix/newreq.pem

smtpd_tls_loglevel = 1

smtpd_tls_received_header = yes

smtpd_tls_session_cache_timeout = 3600s

smtpd_use_tls = yes

tls_random_source = dev:/dev/urandom

unknown_local_recipient_reject_code = 450

virtual_alias_maps = mysql:/etc/postfix/mysql-virtual.cf

virtual_gid_maps = static:1001

virtual_mailbox_base = /

virtual_mailbox_domains = mysql:/etc/postfix/mysql-transport.cf

virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual-maps.cf

virtual_minimum_uid = 1000

virtual_transport = virtual

virtual_uid_maps = static:1001

```

pam.d/smtp

```

auth     optional       pam_mysql.so host=localhost db=mailsql user=myuser \

  passwd=mypass table=users usercolumn=email passwdcolumn=clear crypt=0 sqllog=0

account  required       pam_mysql.so host=localhost db=mailsql user=myuser \

  passwd=mypass table=users usercolumn=email passwdcolumn=clear crypt=0 sqllog=0

```

Here is example error log entries:

```

postfix/smtpd[1244]: mysql plugin couldnt connect to any host 

postfix/smtpd[1244]: mysql plugin couldnt connect to any host 

postfix/smtpd[31309]: mysql plugin couldnt connect to any host 

postfix/smtpd[31309]: mysql plugin couldnt connect to any host 

postfix/smtpd[17466]: mysql plugin couldnt connect to any host 

postfix/smtpd[17466]: mysql plugin couldnt connect to any host 

postfix/smtpd[5479]: mysql plugin couldnt connect to any host 

postfix/smtpd[5479]: mysql plugin couldnt connect to any host 

postfix/smtpd[12379]: mysql plugin couldnt connect to any host 

postfix/smtpd[12379]: mysql plugin couldnt connect to any host 

```

Any help will greatly be appreciated.

Thanks

hanj

----------

