On 02.11.2019 0:41, Reio Remma wrote:
On 31.10.2019 10:06, gil...@poolp.org wrote:
October 26, 2019 1:23 PM, "Reio Remma"<r...@mrstuudio.ee>  wrote:

On 26/10/2019 14:18, Reio Remma wrote:

On the subject of catch all aliases, I tried adding one to my setup > with odd 
results.

My usual setup with virtual users:

action deliver_lmtp lmtp "/var/run/dovecot/lmtp" rcpt-to virtual > <virtuals> 
userbase <userinfo>

match from any for domain <domains> rcpt-to <recipients> action > deliver_lmtp

To get catch all working, I had to remove rcpt-to <recipients> from > the match:

match from any for domain <domains> action deliver_lmtp

Otherwise the response was: 550 Invalid recipient:<a...@abc.abc>

One I removed the actual catch all alias and sent mail to a > non-existent 
account, the usual:

550 Invalid recipient:<a...@abc.abc>

turned into:

524 5.2.4 Mailing list expansion problem:<a...@abc.abc>

Any ideas how I could use a catch all alias _and_ get a proper 550 > Invalid 
recipient if I don't?
This is all with the current (v6.6) portable from a week ago or so.
This error occurs when aliases expansion encounters an error during its 
processing,
there's not enough info here to understand what happened in the expansion loop:

- it is likely a table content issue either in virtuals or in userinfo table or 
both
- using `smtpd -dv -T expand` will help you understand what went wrong during 
expansion

Gilles

A couple of hours reading code and I'm fairly certain catchall aliases don't work at all with database backends.

Mailaddr lookups from static tables use mailaddr_match to compare address parts with catchall aliases, but table-mysql for example doesn't do any extra work.

expand: 0x23b6628: expand_insert() called for address:du...@domain.com[parent=(nil), rule=(nil)]
expand: 0x23b6628: inserted node 0x23b8320
expand: lka_expand: address: du...@domain.com [depth=0]
lookup: match "209.85.167.41" as NETADDR in table static:<anyhost> -> true
lookup: match "domain.com" as DOMAIN in table static:<anydestination> -> true lookup: match "sen...@gmail.com" as MAILADDR in table proc:blacklist -> false
lookup: match "209.85.167.41" as NETADDR in table static:<anyhost> -> true
lookup: match "domain.com" as DOMAIN in table proc:domains -> true
lookup: match "du...@domain.com" as MAILADDR in table proc:recipients -> false lookup: match "209.85.167.41" as NETADDR in table static:<localhost> -> false
lookup: match "209.85.167.41" as NETADDR in table static:<anyhost> -> true
lookup: match "domain.com" as DOMAIN in table static:<anydestination> -> true lookup: match "209.85.167.41" as NETADDR in table static:<localhost> -> false
lookup: match "209.85.167.41" as NETADDR in table static:sources -> false
no rule matched

The only query I see in the query log is trying to match the full recipient address:

SELECT mailaddr FROM virtuals WHERE mailaddr = 'du...@domain.com'

This works:

match from any for domain <domains> rcpt-to {'@domain.com', ... } action deliver

This doesn't:

match from any for domain <domains> rcpt-to <mysql-mailaddr-recipients> action deliver

Reply via email to