Amish Munshi writes:
Hello All,
I have some very trivial doubt for maildrop filtering for virtual
domains hosting.
Cant find any documentation related to the problem that I am facing.
I am configuring virutal hosting using maildrop.
Assume that I have 2 virtual domains, domain1.com and domain2.com
My current .mailfilter looks like this
if ( hasaddr("use...@domain1.com") )
{
cc "/home/vmail/domain1.com/user1/Maildir/"
}
if ( hasaddr("use...@domain1.com") )
{
cc "/home/vmail/domain1.com/user2/Maildir/"
}
If I send a *single* mail to use...@domain.com,use...@domain1.com then
multiple copies of the same mail gets copied to both users.
Right.
That's because it's a popular myth that the To: header contains the
recipient's address.
It doesn't, and never did, since the Internet came into existence.
If you try to figure out the recipient's address based on the To: header, it
will never work. The message's return address, and its recipient list, is
carried separately by your mail server.
What you need to do is to set up your mail server so that it invokes
maildrop with the -d option that specifies the message's recipient. Then
you will need to set up maildrop using the Courier Authentication library to
map recipient names to mail accounts. maildrop will receive the recipient's
address from the -d option, look it up in the authlib, and deliver the
message to the correct account.