Re: Debugging MySQL backend
> can you run with -T tables -T lookup ? Here is the output with this : lookup: check "ipv6:::1" as NETADDR in table static: -> found lookup: check "domain.tld" as DOMAIN in table proc:vdomains -> found lookup: lookup "t...@domain.tld" as ALIAS in table proc:vusers -> "t...@domain.tld" debug: aliases_virtual_get: 't...@domain.tld' resolved to 1 nodes lookup: check "local" as NETADDR in table static: -> found lookup: check "domain.tld" as DOMAIN in table proc:vdomains -> found lookup: lookup "t...@domain.tld" as ALIAS in table proc:vusers -> "t...@domain.tld" debug: aliases_virtual_get: 't...@domain.tld' resolved to 1 nodes lookup: check "local" as NETADDR in table static: -> found lookup: check "domain.tld" as DOMAIN in table proc:vdomains -> found lookup: lookup "t...@domain.tld" as ALIAS in table proc:vusers -> "t...@domain.tld" debug: aliases_virtual_get: 't...@domain.tld' resolved to 1 nodes lookup: check "local" as NETADDR in table static: -> found lookup: check "domain.tld" as DOMAIN in table proc:vdomains -> found lookup: lookup "t...@domain.tld" as ALIAS in table proc:vusers -> "t...@domain.tld" debug: aliases_virtual_get: 't...@domain.tld' resolved to 1 nodes lookup: check "local" as NETADDR in table static: -> found lookup: check "domain.tld" as DOMAIN in table proc:vdomains -> found lookup: lookup "t...@domain.tld" as ALIAS in table proc:vusers -> "t...@domain.tld" debug: aliases_virtual_get: 't...@domain.tld' resolved to 1 nodes lookup: check "local" as NETADDR in table static: -> found lookup: check "domain.tld" as DOMAIN in table proc:vdomains -> found lookup: lookup "t...@domain.tld" as ALIAS in table proc:vusers -> "t...@domain.tld" debug: aliases_virtual_get: 't...@domain.tld' resolved to 1 nodes lookup: check "local" as NETADDR in table static: -> found lookup: check "domain.tld" as DOMAIN in table proc:vdomains -> found lookup: lookup "t...@domain.tld" as ALIAS in table proc:vusers -> "t...@domain.tld" debug: aliases_virtual_get: 't...@domain.tld' resolved to 1 nodes lookup: check "local" as NETADDR in table static: -> found lookup: check "domain.tld" as DOMAIN in table proc:vdomains -> found lookup: lookup "t...@domain.tld" as ALIAS in table proc:vusers -> "t...@domain.tld" debug: aliases_virtual_get: 't...@domain.tld' resolved to 1 nodes lookup: check "local" as NETADDR in table static: -> found lookup: check "domain.tld" as DOMAIN in table proc:vdomains -> found lookup: lookup "t...@domain.tld" as ALIAS in table proc:vusers -> "t...@domain.tld" debug: aliases_virtual_get: 't...@domain.tld' resolved to 1 nodes lookup: check "local" as NETADDR in table static: -> found lookup: check "domain.tld" as DOMAIN in table proc:vdomains -> found lookup: lookup "t...@domain.tld" as ALIAS in table proc:vusers -> "t...@domain.tld" debug: aliases_virtual_get: 't...@domain.tld' resolved to 1 nodes smtp-in: session 420e7f864e710497: received invalid command: "RCPT TO:" Thanks for the help, Kevin Lemonnier -- You received this mail because you are subscribed to misc@opensmtpd.org To unsubscribe, send a mail to: misc+unsubscr...@opensmtpd.org
Re: Debugging MySQL backend
On Mon, Feb 29, 2016 at 04:03:05PM +0100, Kevin Lemonnier wrote: > Hi, > Hi, > I've been using opensmtpd for a few weeks for my personal e-mails, and > it's been working well. At work we usually install postfix + > postfixadmin + dovecot for our clients, but I've decided to try and > replace postfix with opensmtpd. I am also trying to replace postfixadmin > with vimbadmin, but that shouldn't really be relevant to my problem. > > With my current setup, I get a 550 invalid recipient when I try to send > an e-mail to an existing account on the server, and I can't figure out a > way to debug the MySQL backend. Here are the configurations : > > [...] > > I'm guessing the result aren't formatted like opensmtpd is expecting > them (since it's more targeted at dovecot and postfix), but I can't > figure out what is wrong. > Thanks ! > can you run with -T tables -T lookup ? gilles -- Gilles Chehade https://www.poolp.org @poolpOrg -- You received this mail because you are subscribed to misc@opensmtpd.org To unsubscribe, send a mail to: misc+unsubscr...@opensmtpd.org
Debugging MySQL backend
Hi, I've been using opensmtpd for a few weeks for my personal e-mails, and it's been working well. At work we usually install postfix + postfixadmin + dovecot for our clients, but I've decided to try and replace postfix with opensmtpd. I am also trying to replace postfixadmin with vimbadmin, but that shouldn't really be relevant to my problem. With my current setup, I get a 550 invalid recipient when I try to send an e-mail to an existing account on the server, and I can't figure out a way to debug the MySQL backend. Here are the configurations : cat /etc/smtpd-mysql.conf hostlocalhost usernameuser passwordpass databasevimbadmin # Alias lookup query # # rows >= 0 # fields == 1 (user varchar) # query_aliasSELECT goto AS user FROM alias WHERE address =? AND active = '1'; # Domain lookup query # # rows == 1 # fields == 1 (domain varchar) # query_domainSELECT domain FROM domain WHERE domain =? AND backupmx = '0' AND active = '1'; # User lookup query # # rows == 1 # fields == 3 (uid int, gid int, directory varchar) # query_userinfoSELECT uid, gid, homedir FROM mailbox WHERE username =? AND active = '1'; # Credentials lookup query # # rows == 1 # fields == 2 (username varchar, password varchar) # query_credentialsSELECT username, password FROM mailbox WHERE username =? AND active = '1'; cat /etc/smtpd.conf listen on localhost table vusers mysql:/etc/smtpd-mysql.conf table vdomains mysql:/etc/smtpd-mysql.conf table aliases mysql:/etc/smtpd-mysql.conf accept from any for domain virtual deliver to mda "/usr/lib/dovecot/dovecot-lda -f %{sender} -d %{dest}" accept from local for any relay I have changed the SQL queries according to the database, but even when I enable the global MySQL logs, I don't get the queries logged (Only the prepare queries when I start smtpd). So I have no idea what queries opensmtpd is actually sending (or what results it gets), and when I run it in debug mode I don't get much informations : smtp-in: session 193a8b1376aabfb1: connection from host localhost [IPv6:::1] established debug: aliases_virtual_get: 't...@domain.tld' resolved to 1 nodes debug: aliases_virtual_get: 't...@domain.tld' resolved to 1 nodes debug: aliases_virtual_get: 't...@domain.tld' resolved to 1 nodes debug: aliases_virtual_get: 't...@domain.tld' resolved to 1 nodes debug: aliases_virtual_get: 't...@domain.tld' resolved to 1 nodes debug: aliases_virtual_get: 't...@domain.tld' resolved to 1 nodes debug: aliases_virtual_get: 't...@domain.tld' resolved to 1 nodes debug: aliases_virtual_get: 't...@domain.tld' resolved to 1 nodes debug: aliases_virtual_get: 't...@domain.tld' resolved to 1 nodes debug: aliases_virtual_get: 't...@domain.tld' resolved to 1 nodes smtp-in: session 193a8b1376aabfb1: received invalid command: "RCPT TO:" I'm guessing the result aren't formatted like opensmtpd is expecting them (since it's more targeted at dovecot and postfix), but I can't figure out what is wrong. Thanks ! Regards, Kevin Lemonnier -- You received this mail because you are subscribed to misc@opensmtpd.org To unsubscribe, send a mail to: misc+unsubscr...@opensmtpd.org