Catch-all virtual alias

2013-11-10 Thread Christoph Kling
Hello,

I experience undesired strange of Postfix 2.10.2 using the following
configuration:

--
virtual_alias_domains =

virtual_alias_maps  = hash file with contents:
"@domain @anotherdomain"

virtual_mailbox_domains = hash file with contents:
"@anotherdomain"

virtual_mailbox_maps = hash file with contents:
"foo@anotherdomain"

virtual_transport = dovecot
--

If I send a mail to foo@anotherdomain, it is being delivered via
dovecot. 
If I send a mail to foo@domain, it is being forwarded to
foo@anotherdomain and then delivered via dovecot. 
If I send a mail to bar@anotherdomain, it is being rejected. 

So far everything as expected.

But if I send a mail to bar@domain, it is being forwarded to
bar@anotherdomain and then delivered via dovecot, although
virtual_mailbox_maps does not contain such an address. Thus,
virtual_mailbox_maps is being ignored in this case. Delivery takes place
without authorization from virtual_mailbox_maps.

The manual for postconf(5)#smptd_reject_unlisted_sender says that 'An
address is always considered "known" when it matches a virtual(5) alias
or a canonical(5) mapping.'. According to this, what I saw is expected
behavior. But should it be this way? Is there any possibility to prevent
postfix from ignoring virtual_mailbox_maps, except providing each and
every single destination address in virtual_alias_maps?

The configuration described is a simplification of my actual
configuration, which you can find without the actual hostnames at
http://pastebin.com/8Jx0q68b

Thank you in advance for your help!

Regards,
Christoph


Re: Catch-all virtual alias

2013-11-10 Thread Ansgar Wiechers
On 2013-11-10 Christoph Kling wrote:
> virtual_alias_domains =
> 
> virtual_alias_maps  = hash file with contents:
> "@domain @anotherdomain"
> 
> virtual_mailbox_domains = hash file with contents:
> "@anotherdomain"
> 
> virtual_mailbox_maps = hash file with contents:
> "foo@anotherdomain"

$virtual_mailbox_domains lists *domains*, so its content should look
like this:

example.net

User mappings, including catch-alls, should go into the respective map.
In case of virtual mailboxes you must map the catch-all to an existing
mailbox in $virtual_mailbox_maps, e.g.:

f...@example.net  example.net/foo
b...@example.net  example.net/bar
@example.net example.net/bar

The catch-all mapping must be the last mapping in the list, and you need
to make sure that you re-hash the file after it's changed.

See the VIRTUAL_README [1] for further details.

Make sure that you don't remove the catch-all as long as you have the
wildcard domain mapping in $virtual_alias_maps, because you'd produce
bounces otherwise.

A better approach (unless you really need a catch-all, which I somehow
doubt) would be to auto-generate a virtual alias map by reading the
virtual mailbox map and creating a mapping for each address found in it:

f...@example.com  f...@example.net
b...@example.com  b...@example.net
...

This can be done with a Makefile or some other script.

[1] http://www.postfix.org/VIRTUAL_README.html

Regards
Ansgar Wiechers
-- 
"Abstractions save us time working, but they don't save us time learning."
--Joel Spolsky


Re: Postfix 2.9.6-2 on debian wheezy with a mysql problem?

2013-11-10 Thread Benny Pedersen

Tobi skrev den 2013-11-08 16:59:


password = X$


postmap: cfg_get_str: /etc/postfix/mysql-blacklist.cf: password = 
london21


ups