Having now got a working configuration, I am trying to simplify/re-adjust it in preparation for moving to using some sql queries rather than hard coded config files.

I have two imap accounts, my personal, as above, and my business ( which is for valid e-mail addresses in domain @hartley-consultants.com),

I also need to pick up messages for computers within my home network these are called kanga.home. owl.home and piserver.home.


In that area, my main.cf currently contains

virtual_transport = lmtp:unix:milter/dspam-lmtp

virtual_mailbox_domains =
    chandlerfamily.org.uk

virtual_mailbox_maps = hash:/etc/postfix/vmailbox

virtual_alias_domains =
    piserver.home
    owl.home
    kanga.home
... (some others)

virtual_alias_maps = hash:/etc/postfix/virtual


/etc/postfix/vmailbox

a...@chandlerfamily.org.uk alan
hart...@chandlerfamily.org.uk hartley
(similar for other family members)

and /etc/postfix/virtual
@piserver.home alan+piser...@chandlerfamily.org.uk
@owl.home alan+...@chandlerfamily.org.uk
@kanga.home alan+ka...@chandlerfamily.org.uk

a...@hartley-consultants.com hart...@chandlerfamily.org.uk
sa...@hartley-consultants.com hartley+sa...@chandlerfamily.org.uk

Basically, I am using virtual alias maps to map everything I am prepared to accept into an e-mail address in the chandlerfamily.org.uk domain and then mapping these into specific mailboxes.

SO I now try to simplify ...

According the explanation of all the parameters for main.cf virtual_mailbox_domains defaults to $virtual_mail_box maps. so I am thinking that I can drop that line in main.cf and move many of the elements in virtual_alias_domains and virtual_alias_maps directly into /etc/postfix/virtual

So I tried a limited experiment of removing the two lines

virtual_mailbox_domains =
    chandlerfamily.org.uk

from main.cf and reloading postfix

This SHOULD (according to my expectation from reading the docs) cause the virtual address mechanism to use the virtual_mail_box lookup table to figure out the acceptable domains to be a virtual mail box for.

But it doesn't work - at least trying to use sendmail -bv r...@kanga.home doesn't work because it now attempts to send the delivery report (which it is trying to send to r...@piserver.home - which should be mapped by the virtual_alias_maps to alan+piser...@chandlerfamily.org.uk) externally, via my normal external relay host - which then rejects it.

If I put those two lines back, the delivery report arrives immediately telling me where r...@kanga.home would have been routed to (alan+ka...@chandlerfamily.org.uk).


SO what is wrong with my thinking.  Why doesn't it work

--
Alan Chandler
http://www.chandlerfamily.org.uk

Reply via email to