Hi, I am trying to configure an smtpd server with mysql as userbase, on my database the mailbox schema is the following (simplified): id 1 login [email protected] email [email protected] uid 5000 gid 5000 maildir /var/vmail/paclan.it/giovanni
With the following conf the table_lookup tries to find a record with login=giovanni instead of [email protected], is there a way to tell that the login field contains an email ? Thanks Giovanni
# # Sample PostgreSQL configuration file # # This is an example configuration file for using OpenSMTPD with the PostgreSQL # backend for lookups. OpenSMTPD does not have hardcoded tables and you may # # host localhost username user password pass database db # Alias lookup query # # rows >= 0 # fields == 1 (user varchar) # query_alias select destination from mail_forwarding where source=?; # Domain lookup query # # rows == 1 # fields == 1 (domain varchar) # query_domain select domain from mail_domain where domain=?; # User lookup query # # rows == 1 # fields == 3 (uid int, gid int, directory varchar) # query_userinfo select uid,gid,maildir from mail_user where login=? and server_id=6; # Credentials lookup query # # rows == 1 # fields == 2 (username varchar, password varchar) # query_credentials select login, password from mail_user where login=?; # Netaddr lookup query # # rows == 1 # fields == 1 (netaddr varchar) # #query_netaddr select value from netaddr where value=$1;
# $OpenBSD: smtpd.conf,v 1.7 2014/03/12 18:21:34 tedu Exp $ # This is the smtpd server system-wide configuration file. # See smtpd.conf(5) for more information. # To accept external mail, replace with: listen on all # listen on lo0 table vusers mysql:/tmp/mysql.conf table vdomains mysql:/tmp/mysql.conf table aliases mysql:/tmp/mysql.conf accept for domain <vdomains> userbase <vusers> alias <aliases> deliver to maildir accept from local for any relay
smtp-in: New session fa16849c56bf0dd1 from host localhost [127.0.0.1] lookup: check "127.0.0.1" as NETADDR in table static:<localhost> -> found lookup: check "paclan.it" as DOMAIN in table proc:vdomains -> found lookup: lookup "giovanni" as ALIAS in table proc:aliases -> 0 lookup: lookup "giovanni" as USERINFO in table proc:vusers -> 0 smtp-in: Failed command on session fa16849c56bf0dd1: "RCPT TO: <[email protected]>" => 550 Invalid recipient
