On 6/14/05, Niblett, David A <[EMAIL PROTECTED]> wrote:
> In my tests what happens now is that your inbound Email, hits
> dbmail, the alias look up says that it has to invoke SMTP to
> send the message, so it's back to your SMTP server, which then
> turns around and sends it back to DBMail with the new address,
> which then, once again, invokes the SMTP to send the message to
> the forward location.
> 
> If the user_idnr is used in the deliver_to then the message is
> immediately stored in the database making it much more efficient.
> 
> The only problem I have with the dbmail_aliases table is that
> there is no DB reference to a user_idnr.  I added a column (called
> user_idnr) in dbmail_aliases, which is a foreign key reference
> to dbmail_users(user_idnr), and support cascade on delete.
> 
> This way when I get rid of a user, everything goes.  I also then
> have an easier way to tie them all together.  The down side is
> that I have broken dbmail-users -a since I can't add an alias now,
> but I'm working on fixing that.
> 
> --
> David A. Niblett               | email: [EMAIL PROTECTED]
> Network Administrator          | Phone: (352) 334-3400
> Gainesville Regional Utilities | Web: http://www.gru.net/

I think I am followig what you are saying, but correct me if I am
wrong.  From what I understand, every user has to have at least 1
alias pointing to them.  Here is how I handle the situation.

When I create a user, I create an alias that points to that user.

Added user msalerno user_idnr=122
Added alias [EMAIL PROTECTED] deliver_to 122
Add alias [EMAIL PROTECTED] deliver_to [EMAIL PROTECTED]
etc...
So every alias I add for user msalerno will point back to the
[EMAIL PROTECTED] alias.

If that is how you have your system setup, couldn't you just look up
all aliases for the user with:

Select
*
from
dbmail_aliases
left join dbmail_users
on dbmail_users.userid = dbmail_aliases.deliver_to or
dbmail_users.user_idnr = dbmail_aliases.deliver_to
where
dbmail_users.userid = '[EMAIL PROTECTED]'

Or did I completely misunderstand what you are saying?

Reply via email to