On Friday 23 April 2004 08:20, Thoralf Rickert wrote:
> Hmm, okay, but I've just one system user that accepts mails (called 
> maildrop). I'm using virtual users with virtual domains. Mails for 
> user@<domain1> will be accepted by courier, if the email address is in 
> the mysql database. Users login to IMAP and POP3 using this email 
> address, maildir and a password also saved in the database. 

OK, you lost me here.  Let me see if I can get up to speed with your 
situation.  (And maybe someone who "sees" this better than I do can help you 
better as well.)

If you have an account "[EMAIL PROTECTED]" in your mysql db then as I understand it 
then when courier sees mail coming for "[EMAIL PROTECTED]" it will deliver mail to 
that user's account as defined in the db.  This has nothing to do with 
delivering all mail for a domain to a local user.  This is standard mail 
delivery.   The user is "virtual" in the sense that he's not an actual system 
user on the box.  But he has his own HOME directory, Maildir, etc. all 
specified in the db.  This is not a "virtual" domain; this is an actual 
(hosted) domain on your box.

Now you want to add a new domain "domain2" and make it a true virtual domain.   
I.e. there aren't really any users for this domain on this box - you want to 
do something else with the mail.  So you create the alias

@domain2:       maildrop

because "maildrop" is an actual local account on the machine.  Now all mail 
that comes in addressed to anyone '@domain2' will be delivered to user 
"maildrop".  Or more precisely when mail arrives for "[EMAIL PROTECTED]" 
courier attempts to deliver it to user "maildrop-someuser".  So [EMAIL PROTECTED] 
gets delivered to maildrop-joe, [EMAIL PROTECTED] get delivered to maildrop-bob, 
etc.

So in the case of [EMAIL PROTECTED] courier looks for a user called "maildrop-joe".  
If such a user exists (as a system user, in userdb, in mysql, etc.) then 
courier delivers the mail to that user.  If that user doesn't exist, then 
courier strips whatever's after the dash (-) and tries to deliver to the 
remaining address ('maildrop' in this example), looking to see if that user 
has any instructions for what to do with the information that was after the 
dash. 

> If I want to deliver any mail from <domain2> to a virtual user, do I 
> have to put the .courier-* file into the <maildir-home> directory? But 
> what "user" I have to save in /etc/courier/aliases? maildrop? And then - 
> how do I tell courier to accept messages for that user? I'm using the 
> email addesses as user-account-names.

Well that totally depends on what you want to do with the mail.  If you want 
all mail for [EMAIL PROTECTED] to go to [EMAIL PROTECTED] and so on then you could 
create 
a .courier-default account with

[EMAIL PROTECTED]

because $EXT will grab the part after the dash ("joe" in this case) and so 
forward mail to [EMAIL PROTECTED]   (Of course a much easier way to do this is the 
create an alias domain in hosteddomains, but you get the idea.)

> How to I tell the system to forward 
> emails for *@<domain2> to another email address.

You create a .courier- file that tells courier what to do with the address.  
So .courier-joe (in maildrop's HOME directory) tells courier what to do with 
mail being delivered to maildrop-joe.  .courier-bob tells courier what to do 
with mail being addressed to maildrop-bob, etc.  .courier-default tells 
courier what to do with mail for maildrop-* for which there are no other 
instructions.  

OK, so does that help at all or have I just made everything more confusing?  
("Clear as mud" as they say. :-)

Jeff Jansen


-------------------------------------------------------
This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek
For a limited time only, get FREE Ground shipping on all orders of $35
or more. Hurry up and shop folks, this offer expires April 30th!
http://www.thinkgeek.com/freeshipping/?cpg=12297
_______________________________________________
courier-users mailing list
[EMAIL PROTECTED]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users

Reply via email to