On Wednesday 28 May 2003 15:06, Rick Steeves 
<[EMAIL PROTECTED]> wrote:
> >>Define 'virtual domain'.  There are different kinds of
> >> virtual domains.
>
> There are? Sorry, I was thinking there were only virtual
> domains defined, and the system accounts, or I would have
> been more clear. By virtual domain I mean a domain set up
> using userdb, with no logon accounts. a domain defined in
> 'hosteddomains' instead of in 'locals', with accounts
> added to userdb.

Think of it this way.   There are virtual domains and 
virtual users.  Virtual domains are domains that are NOT 
listed in locals or hosteddomains.  A virtual domain is 
"mapped" to local user.  That's the 

@domain.com:    john

notation that you see.  This means that anytime courier sees 
a message for "[EMAIL PROTECTED]" (where "user" can be 
anything) it rewrites that address as "[EMAIL PROTECTED]".  
("hostname" is either the machine's name or the contents of 
the "me" file.)  Then courier tries to deliver the message 
to user "john".  Inside john's home directory you use 
.courier files to tell courier how to deliver the message.  
But there are no userdb entries or anything like that.  And 
the domain must be mapped to a real user since courier 
needs to deliver this mail to a actual user.  Everything 
addressed to this one domain (domain.com) is delivered to 
that user and the .courier files give delivery 
instructions.

Virtual users on the other hand, are accounts which are NOT 
system accounts - they can't log it to your box, etc. but 
they can send and receive mail because courier keeps track 
of them in some sort of database (userdb, mysql, ldap, 
etc.).  But they are part of a real domain - a domain 
listed either in locals or hosteddomains.  So in my case 
I've got "sil.org" in hosteddomains and all my users are 
virtual users.   None of them have system accounts on the 
server; I use userdb to tell courier how to deliver their 
mail.  

> It appears
> that mail addressed to [EMAIL PROTECTED]:
> [EMAIL PROTECTED] will actually work (although now I don't
> understand in the other direction). sigh.

If you have "virtualdomain.com" in esmtpacceptmailfor then 

[EMAIL PROTECTED]:  [EMAIL PROTECTED]

in an alias file should work.  Courier will accept mail for 
[EMAIL PROTECTED], rewrite it as "[EMAIL PROTECTED]" and 
send it out.   I use this myself.  (If you are relaying the 
domain doesn't even need to be in esmtpacceptmailfor.)

But it will NOT work if you have

@virtualdomain.com:  john
[EMAIL PROTECTED]:  [EMAIL PROTECTED]

Because courier sees the first entry and rewrites the 
incoming mail message as "[EMAIL PROTECTED]".  At that 
point the "[EMAIL PROTECTED]" address is gone and we 
are now working on "[EMAIL PROTECTED]".

Your original post said 

> I have an alias in the /etc/courier/aliases/system file
> [EMAIL PROTECTED]: [EMAIL PROTECTED]
>
> where domain.com is a virtual domain on the courier
> system, there is no account named bob, fred is a account
> on another server
>
> When I send mail to [EMAIL PROTECTED], I get back "User
> unknown: 550"

It looks like "domain.com" is in hosteddomains since you are 
getting a "user unknown" instead of "relaying denied".    
Did you run makealiases after you added the alias?   What 
does "makealiases -chk" and "makealiases -dump" say?  Do 
you see the alias in there?

I just added "[EMAIL PROTECTED]" to my aliases file and 
"domain.com" to my esmtpacceptmailfor file, ran makealiases 
and makeacceptmailfor and then tried to send to 
[EMAIL PROTECTED] and it worked.

[EMAIL PROTECTED] jeff]$ telnet superman 25
Trying 192.168.1.100...
Connected to superman.
Escape character is '^]'.
220 superman.ivb.sil.org ESMTP
helo jeff
250-superman.ivb.sil.org Ok.
<snip>
mail from:<[EMAIL PROTECTED]>
250 Ok.
rcpt to:<[EMAIL PROTECTED]>
250 Ok.

So I think that your original idea will work fine.  See if 
you just forgot a step along the way.  Courier takes some 
work to figure out, but once you do I think you'll agree 
that it has a very elegant design.

Jeff Jansen






-------------------------------------------------------
This SF.net email is sponsored by: eBay
Get office equipment for less on eBay!
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
_______________________________________________
courier-users mailing list
[EMAIL PROTECTED]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users

Reply via email to