Michael Monnerie wrote:
> Hi, our admin tool for dbmail always tries to find out if an e-mail 
> address entered in "deliver_to" for an alias is a local dbmail user, 
> and then replaces the e-mail with the user_idnr.
> 
> Example: User enters:
> [EMAIL PROTECTED] -> [EMAIL PROTECTED]
> 
> Then our tools looks up "[EMAIL PROTECTED]", and if it's user #777, it 
> inserts 
> into dbmail_aliases:
> [EMAIL PROTECTED] -> 777

that is valid.

> 
> Now I'd like to know if this is good behaviour, or if I should 
> preferrably enter [EMAIL PROTECTED] instead of 777. 

You're saving some CPU cycles on dbmail delivery, because that is what dbmail
does during delivery: try to resolve a string value in the deliver_to field to a
local user.

> 
> I ask this because I just found a race condition: When a user goes on 
> holidays, he wants to have all his business e-mail at his home account. 
> Example: [EMAIL PROTECTED] wants his e-mails @work and @home:
> dbmail_aliases:
> [EMAIL PROTECTED] -> [EMAIL PROTECTED]
> [EMAIL PROTECTED] -> [EMAIL PROTECTED]

the [EMAIL PROTECTED] -> [EMAIL PROTECTED] is bollock. That is a loop and thus 
skipped by
dbmail's delivery chain. I'm also pretty sure dbmail-users doesn't allow you to
enter such a setup.


> 
> This makes all e-mail sent to [EMAIL PROTECTED] appear on the dbmail 
> user "[EMAIL PROTECTED]", as well as a forward on [EMAIL PROTECTED] Simple.
> BUT if now he has an alias
> [EMAIL PROTECTED] -> [EMAIL PROTECTED]
> this was already replaced with
> [EMAIL PROTECTED] -> 777
> and then [EMAIL PROTECTED] would only go to local user 777 and not the 
> [EMAIL PROTECTED] e-mail, and this is not easy to find.

That is correct. If you setup a forward
(alias:[EMAIL PROTECTED]>deliver_to:[EMAIL PROTECTED]) and have an alias
(alias:[EMAIL PROTECTED]>delivery_to:777) there is no way for dbmail to know 
that
you want the forward to apply to *all* possibly valid addresses that apply to
user 777. In fact, once the destination resolver hits a numeric value in
delivery_to which points to a valid local user, the resolver considers it's job
done.

> So could I say that always using the e-mail address instead of the 
> user_idnr is recommended? Or is there any good reason to enter the 
> user_idnr in deliver_to?

I'm not quite sure I get the picture here, because I get the feeling you are
mixing aliases with usernames as well.

That said, the dbmail_aliases table is a mess. Who ever conceived of that setup
knew barely enough about email delivery, and precious little about database 
design.

The ldap delivery chain is in somewhat better shape using cleaner semantics, but
 even then I always try to do as much destination resolving as possible *before*
hitting dbmail, using ldap maps in postfix.


To do what you want you need to be more specific:

alias:[EMAIL PROTECTED]>deliver_to:[EMAIL PROTECTED]
alias:[EMAIL PROTECTED]>deliver_to:777
alias:[EMAIL PROTECTED]>deliver_to:[EMAIL PROTECTED]


-- 
  ________________________________________________________________
  Paul Stevens                                      paul at nfg.nl
  NET FACILITIES GROUP                     GPG/PGP: 1024D/11F8CD31
  The Netherlands________________________________http://www.nfg.nl
_______________________________________________
DBmail mailing list
[email protected]
https://mailman.fastxs.nl/mailman/listinfo/dbmail

Reply via email to