Re: problem with resolution aliases after upgrade to 6.5

2019-05-05 Thread Edgar Pettijohn
Not sure if it's necessary, but it wouldn't hurt to try restarting smtpd and 
see if it works.
On May 5, 2019 4:59 PM, Sergey Bronnikov  wrote:
>
> Hello!
>
> I've found that smtpd behaves suspiciously with different values with
> the same key in aliases file.
>
> aliases(5) allows to append messages to file, so I added
> ay:    /etc/mail/messages
> to /etc/mail/aliases and update aliases db with newaliases(8).
> Mail sent to address ay@domain has been delivered and appended to
> /etc/mail/messages.
>
> expand: 0x6e46fce1018: expand_insert() called for
> address:a...@bronevichok.ru[parent=0x0, rule=0x0]
> expand: 0x6e46fce1018: inserted node 0x6e3e4edd000
> expand: lka_expand: address: a...@bronevichok.ru [depth=0]
> lookup: match "" as STRING in table static: -> false
> lookup: match "209.85.167.42" as NETADDR in table static: -> false
> lookup: match "209.85.167.42" as NETADDR in table static: -> false
> lookup: match "209.85.167.42" as NETADDR in table static: -> true
> lookup: match "bronevichok.ru" as DOMAIN in table static:domains -> true
> rule #4 matched: match from any for domain domains => local
> expand: 0x6e46fce1018: expand_insert() called for
> username:ay[parent=0x6e3e4edd000, rule=0x6e466726c00, di
> spatcher=0x6e3a063db00]
> expand: 0x6e46fce1018: inserted node 0x6e47f71a800
> expand: lka_expand: username: ay [depth=1, sameuser=0]
> lookup: lookup "ay" as ALIAS in table db:aliases -> "/etc/mail/messages"
> expand: 0x6e483569280: expand_insert() called for
> filename:/etc/mail/messages[parent=0x0, rule=0x0]
> expand: 0x6e483569280: inserted node 0x6e3e4edd800
> expand: 0x6e46fce1018: expand_insert() called for
> filename:/etc/mail/messages[parent=0x6e47f71a800, rule=0x6e466726c00,
> dispatcher=0x6e3a063db00]
> expand: 0x6e46fce1018: inserted node 0x6e3e4edc000
> expand: 0x6e483569280: clearing expand tree
> expand: 0x6e483569280: freeing expand tree
> debug: aliases_get: returned 1 aliases
> expand: lka_expand: filename: /etc/mail/messages [depth=2]
>
>
> Let's replace file by valid email address:
> ay: este...@gmail.com
> and update aliases db with newaliases(8).
> Mail sent to address ay@domain has not been delivered with reason "550
> Invalid recipient: ".
>
> 523e4ad980, dispatcher=0x25248b3c440]
> expand: 0x25251721018: inserted node 0x25251724800
> expand: 0x252bdf33d40: clearing expand tree
>    expand: 0x252bdf33d40: freeing
> expand tree
> debug: aliases_get: returned 1 aliases
> expand: lka_expand: address: este...@gmail.com [depth=2]
> lookup: match "" as STRING in table static: -> false
> lookup: match "local" as NETADDR in table static: -> true
> lookup: match "gmail.com" as DOMAIN in table static: ->
> false
> lookup: match "local" as NETADDR in table static: -> true
> lookup: match "gmail.com" as DOMAIN in table static:
> -> true
> lookup: match "local" as NETADDR in table static: -> true
> lookup: match "gmail.com" as DOMAIN in table static:domains -> false
> lookup: match "local" as NETADDR in table static: -> true
> lookup: match "gmail.com" as DOMAIN in table static:
> -> true
> no rule matched
> mproc: lka -> pony : 35 IMSG_SMTP_EXPAND_RCPT
> expand: 0x25251721018: clearing expand tree
> imsg: pony <- lka: IMSG_SMTP_EXPAND_RCPT (len=35)
> smtp: 0x1ad082966000: >>> 550 Invalid recipient: 
> mproc: pony -> lka : 62 IMSG_??? (130)
> 54787b61ff698f5f smtp failed-command command="RCPT
> TO:" result="550 Invalid recipient:
> "
>
> Could anyone explain why it happen?
>
> Sergey
>
> пн, 29 апр. 2019 г. в 23:15, Sergey Bronnikov :
> >
> > > Not sure if this is the only problem but domains is a table in this
> > > version so the line should be (missing <>):
> >
> > Good point, fixed it. But looks like there is more than one error in my 
> > config.
> > Still getting error "no such recipient".
> >
> > Sergey
> >
> > пн, 29 апр. 2019 г. в 11:47, John Cox :
> > >
> > > Hi
> > >
> > > >Hello,
> > > >
> > > >I use aliases in an smtpd config and before upgrade to 6.5 it worked 
> > > >fine.
> > > >After upgrade and rewriting config smtpd starts to reject mails
> > > >addressed to aliases with a reason "550 Invalid recipient". What's
> > > >wrong with new config?
> > > >
> > > >/var/log/maillog:
> > > >
> > > >Apr 29 07:01:48 ns1 smtpd[71399]: e99e9db5916c8789 smtp connected
> > > >address=209.85.167.44 host=mail-lf1-f44.google.com
> > > >Apr 29 07:01:48 ns1 smtpd[71399]: e99e9db5916c8789 smtp tls
> > > >ciphers=TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256
> > > >Apr 29 07:01:49 ns1 smtpd[71399]: e99e9db5916c8789 smtp failed-command
> > > >command="RCPT TO:" result="550 Invalid recipient:
> > > >"
> > > >Apr 29 07:01:49 ns1 smtpd[71399]: e99e9db5916c8789 smtp disconnected 
> > > >reason=quit
> > > >
> > > >smtpd.conf before upgrade to 6.5:
> > > >
> > > >pki mx1. certificate "/etc/ssl/.crt"
> > > >pki mx1. key "/etc/ssl/private/.key"
> > > >
> > > >limit mta inet4
> > > >queue compression
> > > >
> > > 

Re: problem with resolution aliases after upgrade to 6.5

2019-05-05 Thread Sergey Bronnikov
Hello!

I've found that smtpd behaves suspiciously with different values with
the same key in aliases file.

aliases(5) allows to append messages to file, so I added
ay:/etc/mail/messages
to /etc/mail/aliases and update aliases db with newaliases(8).
Mail sent to address ay@domain has been delivered and appended to
/etc/mail/messages.

expand: 0x6e46fce1018: expand_insert() called for
address:a...@bronevichok.ru[parent=0x0, rule=0x0]
expand: 0x6e46fce1018: inserted node 0x6e3e4edd000
expand: lka_expand: address: a...@bronevichok.ru [depth=0]
lookup: match "" as STRING in table static: -> false
lookup: match "209.85.167.42" as NETADDR in table static: -> false
lookup: match "209.85.167.42" as NETADDR in table static: -> false
lookup: match "209.85.167.42" as NETADDR in table static: -> true
lookup: match "bronevichok.ru" as DOMAIN in table static:domains -> true
rule #4 matched: match from any for domain domains => local
expand: 0x6e46fce1018: expand_insert() called for
username:ay[parent=0x6e3e4edd000, rule=0x6e466726c00, di
spatcher=0x6e3a063db00]
expand: 0x6e46fce1018: inserted node 0x6e47f71a800
expand: lka_expand: username: ay [depth=1, sameuser=0]
lookup: lookup "ay" as ALIAS in table db:aliases -> "/etc/mail/messages"
expand: 0x6e483569280: expand_insert() called for
filename:/etc/mail/messages[parent=0x0, rule=0x0]
expand: 0x6e483569280: inserted node 0x6e3e4edd800
expand: 0x6e46fce1018: expand_insert() called for
filename:/etc/mail/messages[parent=0x6e47f71a800, rule=0x6e466726c00,
dispatcher=0x6e3a063db00]
expand: 0x6e46fce1018: inserted node 0x6e3e4edc000
expand: 0x6e483569280: clearing expand tree
expand: 0x6e483569280: freeing expand tree
debug: aliases_get: returned 1 aliases
expand: lka_expand: filename: /etc/mail/messages [depth=2]


Let's replace file by valid email address:
ay: este...@gmail.com
and update aliases db with newaliases(8).
Mail sent to address ay@domain has not been delivered with reason "550
Invalid recipient: ".

523e4ad980, dispatcher=0x25248b3c440]
expand: 0x25251721018: inserted node 0x25251724800
expand: 0x252bdf33d40: clearing expand tree
   expand: 0x252bdf33d40: freeing
expand tree
debug: aliases_get: returned 1 aliases
expand: lka_expand: address: este...@gmail.com [depth=2]
lookup: match "" as STRING in table static: -> false
lookup: match "local" as NETADDR in table static: -> true
lookup: match "gmail.com" as DOMAIN in table static: ->
false
lookup: match "local" as NETADDR in table static: -> true
lookup: match "gmail.com" as DOMAIN in table static:
-> true
lookup: match "local" as NETADDR in table static: -> true
lookup: match "gmail.com" as DOMAIN in table static:domains -> false
lookup: match "local" as NETADDR in table static: -> true
lookup: match "gmail.com" as DOMAIN in table static:
-> true
no rule matched
mproc: lka -> pony : 35 IMSG_SMTP_EXPAND_RCPT
expand: 0x25251721018: clearing expand tree
imsg: pony <- lka: IMSG_SMTP_EXPAND_RCPT (len=35)
smtp: 0x1ad082966000: >>> 550 Invalid recipient: 
mproc: pony -> lka : 62 IMSG_??? (130)
54787b61ff698f5f smtp failed-command command="RCPT
TO:" result="550 Invalid recipient:
"

Could anyone explain why it happen?

Sergey

пн, 29 апр. 2019 г. в 23:15, Sergey Bronnikov :
>
> > Not sure if this is the only problem but domains is a table in this
> > version so the line should be (missing <>):
>
> Good point, fixed it. But looks like there is more than one error in my 
> config.
> Still getting error "no such recipient".
>
> Sergey
>
> пн, 29 апр. 2019 г. в 11:47, John Cox :
> >
> > Hi
> >
> > >Hello,
> > >
> > >I use aliases in an smtpd config and before upgrade to 6.5 it worked fine.
> > >After upgrade and rewriting config smtpd starts to reject mails
> > >addressed to aliases with a reason "550 Invalid recipient". What's
> > >wrong with new config?
> > >
> > >/var/log/maillog:
> > >
> > >Apr 29 07:01:48 ns1 smtpd[71399]: e99e9db5916c8789 smtp connected
> > >address=209.85.167.44 host=mail-lf1-f44.google.com
> > >Apr 29 07:01:48 ns1 smtpd[71399]: e99e9db5916c8789 smtp tls
> > >ciphers=TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256
> > >Apr 29 07:01:49 ns1 smtpd[71399]: e99e9db5916c8789 smtp failed-command
> > >command="RCPT TO:" result="550 Invalid recipient:
> > >"
> > >Apr 29 07:01:49 ns1 smtpd[71399]: e99e9db5916c8789 smtp disconnected 
> > >reason=quit
> > >
> > >smtpd.conf before upgrade to 6.5:
> > >
> > >pki mx1. certificate "/etc/ssl/.crt"
> > >pki mx1. key "/etc/ssl/private/.key"
> > >
> > >limit mta inet4
> > >queue compression
> > >
> > >listen on lo0
> > >listen on lo0 port 10028 tag DKIM_OUT
> > >listen on egress port 25 tls pki mx1.
> > >listen on egress port 465 smtps pki mx1. auth mask-source hostname 
> > >mx1.
> > >listen on egress port 587 tls-require pki mx1. auth mask-source
> > >hostname mx1.
> > >
> > >table aliases db:/etc/mail/aliases.db
> > >table secrets db:/etc/mail/secrets.db
> > >table