Re: relay_domains parameter for a hosted domain

2009-08-05 Thread Yeray Gutiérrez Cedrés
Well I'm new in the company (and new to Postfix) and the system was
already set, so I'm trying to understand how is this configured. I'm
seeing a warning regarding this in the logfile that tells me that the
domain name must not be listed in  both virtual_mailbox_domains and
relay_domains, so obviously you were right :).

I don't know why $virtual_mailbox_maps is listed in
virtual_mailbox_domains. I've read that $virtual_mailbox_maps is the
default value for virtual_mailbox_domains, so I think that the
previous guy thought that if he set virtual_mailbox_domains just to
hash:/etc/postfix/vmaildomains it would overwrite the default value
and the virtual_mailbox_maps lookup table wouldn't be in use. However,
I'm not sure why having virtual_mailbox_domains set is necessary,
since the virtual(8) delivery agent will use the virtual_mailbox_maps
lookup table anyway (if this have been set) to verify that the
recipient address is valid. Am I right?


On Wed, Aug 5, 2009 at 9:28 AM, Magnus Bäckmag...@dsek.lth.se wrote:
 On Wednesday, August 05, 2009 at 10:25 CEST,
     Yeray Gutiérrez Cedrés yera...@gmail.com wrote:

 I have this in my main.cf file:

 relay_domains = example.com

 virtual_mailbox_domains=$virtual_mailbox_maps hash:/etc/postfix/vmaildomains

 Why are you listing $virtual_mailbox_maps here?

 virtual_mailbox_maps = ldap:ldapvirtualmap
 virtual_mailbox_base = /var/vmail/
 virtual_transport = maildrop

 And this is the content of /etc/postfix/vmaildomains:

 # more /etc/postfix/vmaildomains
 example.com required

 Is it necessary to have this domain in relay_domains or does this work
 without it being there?

 On the contrary -- a domain listed in virtual_mailbox_domains MUST NOT
 be listed in relay_domains.

 --
 Magnus Bäck
 mag...@dsek.lth.se



Re: relay_domains parameter for a hosted domain

2009-08-05 Thread Magnus Bäck
On Wednesday, August 05, 2009 at 10:48 CEST,
 Yeray Gutiérrez Cedrés yera...@gmail.com wrote:

 I don't know why $virtual_mailbox_maps is listed in
 virtual_mailbox_domains. I've read that $virtual_mailbox_maps is the
 default value for virtual_mailbox_domains, so I think that the
 previous guy thought that if he set virtual_mailbox_domains just to
 hash:/etc/postfix/vmaildomains it would overwrite the default value
 and the virtual_mailbox_maps lookup table wouldn't be in use. However,
 I'm not sure why having virtual_mailbox_domains set is necessary,
 since the virtual(8) delivery agent will use the virtual_mailbox_maps
 lookup table anyway (if this have been set) to verify that the
 recipient address is valid. Am I right?

Yes, but Postfix must know which domains are virtual mailbox domains,
i.e. which domains should be passed off to virtual(8). It's not
necessarily wrong to list $virtual_mailbox_maps in
virtual_mailbox_domains (it's there by default for backwards
compatibility reasons), but unless you actually list the virtual
mailbox domains in lookup tables specified in $virtual_mailbox_maps
there is no point in listing $v_m_m in v_m_d.

Bottom line -- if all virtual mailbox domains are listed in the
vmaildomains file you can remove $v_m_m from v_m_d to simply your
configuration, avoid confusion, and relieve your LDAP server from
unnecessary lookups.

The latter is good since qmgr(8) runs in a single thread and is severely
affected by high-latency lookups. It's therefore highly preferable to
have mydestination and the xxx_domains parameters list simple lookup
tables like hash, btree, cdb, pcre etc that always have a quick response
time.

Please do not top-post.

-- 
Magnus Bäck
mag...@dsek.lth.se


Re: relay_domains parameter for a hosted domain

2009-08-05 Thread Yeray Gutiérrez Cedrés
On Wed, Aug 5, 2009 at 10:18 AM, Magnus Bäckmag...@dsek.lth.se wrote:
 On Wednesday, August 05, 2009 at 10:48 CEST,
     Yeray Gutiérrez Cedrés yera...@gmail.com wrote:

 I don't know why $virtual_mailbox_maps is listed in
 virtual_mailbox_domains. I've read that $virtual_mailbox_maps is the
 default value for virtual_mailbox_domains, so I think that the
 previous guy thought that if he set virtual_mailbox_domains just to
 hash:/etc/postfix/vmaildomains it would overwrite the default value
 and the virtual_mailbox_maps lookup table wouldn't be in use. However,
 I'm not sure why having virtual_mailbox_domains set is necessary,
 since the virtual(8) delivery agent will use the virtual_mailbox_maps
 lookup table anyway (if this have been set) to verify that the
 recipient address is valid. Am I right?

 Yes, but Postfix must know which domains are virtual mailbox domains,
 i.e. which domains should be passed off to virtual(8). It's not
 necessarily wrong to list $virtual_mailbox_maps in
 virtual_mailbox_domains (it's there by default for backwards
 compatibility reasons), but unless you actually list the virtual
 mailbox domains in lookup tables specified in $virtual_mailbox_maps
 there is no point in listing $v_m_m in v_m_d.

So qmgr(8) checks that the domain is a virtual mailbox domain
(performing a lookup in a hash listed in virtual_mailbox_domains)
before passing it off to virtual(8). Then, the mail delivery agent
virtual(8) performs a lookup in the LDAP server (listed in
virtual_mailbox_maps). Is my reasoning right?

If it's right and virtual_mailbox_domain is not set, so its default
value is virtual_mailbox_maps (wich lists an LDAP database), Postfix
would perform twice the same LDAP lookup (one time in qmgr(8) and
another time in virtual(8)).

I suppose that I'm wrong with that, but I can't see how does this
behave. If I were right, that would mean that's much better to list
virtual domains in virtual_mailbox_domains with a simple hash than
just leaving it to its default value.




 Bottom line -- if all virtual mailbox domains are listed in the
 vmaildomains file you can remove $v_m_m from v_m_d to simply your
 configuration, avoid confusion, and relieve your LDAP server from
 unnecessary lookups.

 The latter is good since qmgr(8) runs in a single thread and is severely
 affected by high-latency lookups. It's therefore highly preferable to
 have mydestination and the xxx_domains parameters list simple lookup
 tables like hash, btree, cdb, pcre etc that always have a quick response
 time.



 Please do not top-post.


Sorry for that.

 --
 Magnus Bäck
 mag...@dsek.lth.se



Re: relay_domains parameter for a hosted domain

2009-08-05 Thread /dev/rob0
On Wednesday 05 August 2009 05:37:12 Yeray Gutiérrez Cedrés wrote:
 If it's right and virtual_mailbox_domain is not set, so its
 default value is virtual_mailbox_maps (wich lists an LDAP
 database), Postfix would perform twice the same LDAP lookup
 (one time in qmgr(8) and another time in virtual(8)).

Minor nitpick: that is not the same lookup. The _maps lookup is for
u...@example.com, the domain lookup is merely example.com.

 I suppose that I'm wrong with that, but I can't see how does this
 behave. If I were right, that would mean that's much better to
 list virtual domains in virtual_mailbox_domains with a simple hash
 than just leaving it to its default value.

Indeed, the domain class definitions (virtual_*_domains, relay_domains
and mydestination, see ADDRESS_CLASS_README) are very important; in
general not something I would want to trust to an external daemon. If
they change so frequently as to benefit from being maintained in an
external database, your site is so large that you should have some
redundancy for both the database and the MTA.

Note that there's no reason why virtual_mailbox_maps cannot also be a
hash: lookup.
-- 
Offlist mail to this address is discarded unless
/dev/rob0 or not-spam is in Subject: header