Postfix smtp auth w/mysql


Subject: Postfix smtp auth w/mysql
From: Arthur W. Neilson III (art at pilikia dot net)
Date: Tue Apr 01 2003 - 21:21:48 EST


Does anyone have postfix smtp auth working using mysql lookups?
I can't seem to get it going, I get a smtp 535 error authentication
failed. I've got the following software installed on FreeBSD 4.7

postfix-2.0.6,1
cyrus-sasl-1.5.28
mysql-client-3.23.55
mysql-server-3.23.55

These are all installed from /usr/ports, the mysql patch in the
FreeBSD cyrus-sasl-1.5.28 port is apparently from David Mattew Zenzian
http://www.dmzs.com/~dmz (dmz at dmzs dot com)

I looked at his website, information is sparse at best.

Here's what I've got setup:

in main.cf ...

#
# Recipient restrictions
#
smtpd_recipient_restrictions =
        permit_sasl_authenticated,
        permit_mynetworks,
        check_client_access hash:/usr/local/etc/postfix/client_checks,
        reject_unauth_destination,
#
# SMTP AUTH (SASL) support
#
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
#smtpd_sasl_security_options = noanonymous, noplaintext
smtpd_sasl_local_domain = $myhostname
#broken_sasl_auth_clients = yes

in /usr/local/etc/sasl/Smtpd.conf, per the sparse docs ...

pwcheck_method: mysql
mysql_user: postfix
mysql_password: xxxxx
mysql_host: localhost
mysql_database: maildb
mysql_table: users
mysql_uidcol: id
mysql_pwdcol: clear

And here's my users table in mysql... there's a lot of fields
not needed for smtp auth here however they are used by both
pstfix for virtual users and for courier imap, the virtual account
hosting works freat I just can't get the authentication for
relaying to work.

#
# Table structure for table 'users'
#
CREATE TABLE users (
  id varchar(128) NOT NULL default '',
  address varchar(128) NOT NULL default '',
  crypt varchar(128) NOT NULL default '',
  clear varchar(128) NOT NULL default '',
  name varchar(128) NOT NULL default '',
  uid smallint(5) unsigned NOT NULL default '5000',
  gid smallint(5) unsigned NOT NULL default '5000',
  home varchar(128) NOT NULL default '/',
  domain varchar(128) NOT NULL default '',
  maildir varchar(255) NOT NULL default '',
  imapok tinyint(3) unsigned NOT NULL default '1',
  bool1 tinyint(3) unsigned NOT NULL default '1',
  bool2 tinyint(3) unsigned NOT NULL default '1',
  PRIMARY KEY (id), UNIQUE KEY id (id),
  UNIQUE KEY address (address), KEY id_2 (id),
  KEY address_2 (address)) TYPE=MyISAM;

--
   __
  /  )    _/_  It is a capital mistake to theorise before one has data.
 /--/ __  /    Insensibly one begins to twist facts to suit theories,
/  (_/ (_<__   Instead of theories to suit facts.
                    -- Sherlock Holmes, "A Scandal in Bohemia"
Arthur W. Neilson III, WH7N - FISTS #7448
Bank of Hawaii Distributed Systems Services
http://www.pilikia.net
art at pilikia dot net, aneilson at boh dot com, wh7n at arrl dot net







Hosted Email Solutions

Invaluement Anti-Spam DNSBLs



Powered By FreeBSD   Powered By FreeBSD