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 

Re: problem with resolution aliases after upgrade to 6.5

2019-04-29 Thread 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 domains {  }
>
>accept for local deliver to mbox
>accept for local alias  deliver to mbox
>accept for domain "" relay via
>"tls+auth://gm...@smtp.gmail.com:587" auth 
>accept from any for domain "" alias  deliver to mbox
>#accept from local for any relay
>
>accept tagged DKIM_OUT for any relay
>accept from local for any relay via smtp://127.0.0.1:10027
>
>expire 2d
>bounce-warn 2h, 4h, 1d
>
>
>pki mx1. cert "/etc/ssl/.crt"
>pki mx1. key "/etc/ssl/private/.key"
>
>mta limit inet4
>bounce warn-interval 2h, 4h, 1d
>queue ttl 4d
>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 25 tls pki mx1. auth-optional hostname 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 domains {  }
>
>action "local" mbox alias 
>action "gmail" relay host "smtp+tls://gm...@smtp.gmail.com:587" auth 
>action "relay_dkim" relay host smtp://127.0.0.1:10027
>action "relay" relay
>
>match tag DKIM_OUT for any action "relay"
>match from local for local action "local"
>match from local for any auth action "relay_dkim"
>match from any for domain domains action "local"

Not sure if this is the only problem but domains is a table in this
version so the line should be (missing <>):

match from any for domain  action "local"

>match from any for any auth action "gmail"
>
>
>output from smtpd -dv -Texpand:
>
>queue: queue compression enabled
>debug: pony: rsae_init
>debug: pony: rsae_init
>debug: smtp: will accept at most 498 clients
>debug: smtpd: scanning offline queue...
>debug: smtpd: offline scanning done
>debug: queue: done loading queue into scheduler
>1ae957d6afeb0dfa smtp connected address=209.85.208.171
>host=mail-lj1-f171.google.com
>debug: looking up pki "mx1."
>debug: session_start_ssl: switching to SSL
>debug: pony: rsae_priv_enc
>1ae957d6afeb0dfa smtp tls ciphers=TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256
>smtp: 0x15892c37000: smtp_cert_verify_cb: no-client-cert
>debug: smtp: SIZE in MAIL FROM command
>expand: 0x1ed226c59018: expand_insert() called for
>address:sergeyb@[parent=0x0, rule=0x0]
>expand: 0x1ed226c59018: inserted node 0x1ed2341cb800
>expand: lka_expand: address: sergeyb@ [depth=0]
>expand: 0x1ed226c59018: clearing expand tree
>1ae957d6afeb0dfa smtp failed-command command="RCPT TO:"
>result="550 Invalid recipient: "
>1ae957d6afeb0dfa smtp disconnected reason=quit
>
>Sergey

Hope that helps

JC


-- 
You received this mail because you are subscribed to misc@opensmtpd.org
To unsubscribe, send a mail to: misc+unsubscr...@opensmtpd.org