Hi list,

I have a postfix server with virtualdomains delivery only. I use sqlite as db backend to lookup virtual aliases, domains and mailboxes.

relay_domains = sqlite:/etc/postfix/sqlite_relay_domain_maps.cf
relay_recipient_maps = sqlite:/etc/postfix/sqlite_relay_recipient_maps.cf
virtual_alias_maps = sqlite:/etc/postfix/sqlite_virtual_alias_maps.cf
virtual_mailbox_domains = sqlite:/etc/postfix/sqlite_virtual_domain_maps.cf virtual_mailbox_maps = sqlite:/etc/postfix/sqlite_virtual_mailbox_maps.cf

So here my problem. I wanted to enable catchall address for a virtualdomain to gather some spam to train my dspam. I used an address with recipient_delimiter to recieve the messages (something like someone+s...@domain.tld). I like to use the recipient_delimiter addresses for other purposes as well, but when a lookup is made for someone+someth...@domain.tld (some...@domain.tld exists in the db) it finds only the catchall domain alias because of my query:

query = SELECT alias FROM alias WHERE address='%s' AND active='1' UNION ALL SELECT alias FROM alias WHERE address='@%d' AND active='1' AND NOT EXISTS (SELECT alias FROM alias WHERE address='%s' AND active='1' UNION ALL SELECT username FROM mailbox WHERE username='%s' AND active='1')

Is there a better way of doing this? Or do I have to somehow manipulate %s to remove +part where it exists? I could use some hints.

Thank you very much.

Palica

Reply via email to