Bowie Bailey wrote:

> If there is no account information, how does the server know if a user
> exists or not?  How would it know to accept [EMAIL PROTECTED], but reject
> [EMAIL PROTECTED]  There has to be account information somewhere.

The relay will not accept the message from the smarthost. The primary system will return to your smarthost an error code. I snipped some logs for you to read. They are at the bottom of this email. You will see an incoming message to the smarthost with 8 recepients. 4 are ilegitimate and 4 are legit. The complete exchange might be a little off, but you should get the idea.

I have no users accounts on the system pertaining to email, except for any forwarded accounts that leave my systems for another remote domain. These are in aliases and it makes sense to just forward these back out at the network edge instead of having them ingress all the way in, and then egress once again.

Here is a real world example (in a small scale);

smtp-gateway.domain.com is the smarthost
mail-internal.domain.com is the internal email system

*your corporate (or main domain) mail is addressed to;

domain.com.


*You host a few virtual domains.


virtualdomain.com
vritualdomain.net
virtualdoamin.org

*You have a customer who owns a small business wanting mydomain.com email instead of broadband.com which is what his broadband provider gave him.

virtualFORWARD.com




Now on the smarthost;


defaultdomain will contain;

domain.com

#adding the main domain to defaultdomain has helped me receive in the postmaster's Maildir/ (in the internal email system) cron messages, system daily outputs, system security checks, etc. As well as the ability to bounce messages correctly from the smarthost itself.


esmtpacceptmailfor will contain;


domain.com
virtualdomain.com
vritualdomain.net
virtualdoamin.org
virtualFORWARD.com

#mail to virtualFORWARD.com is forwarded out to broadbandprovider.com
which is just an address used by a smaller entity wanting their domain email. These you explicitly state in the system aliases, and do not place an entry for this domain in esmtproutes.



esmtproutes will contain;


domain.com:[aaa.bbb.ccc.ddd],25
virtualdomain.com:[aaa.bbb.ccc.ddd],25
virtualdomain.net:[aaa.bbb.ccc.ddd],25
virtualdoamin.org:[aaa.bbb.ccc.ddd],25

#Make sure that you do not place any spaces between these entries. I say this from personal experience...your routes will not work!

locals will contain;


smtp-gateway.domain.com mail-internal.domain.com

smtpaccess will contain; (all your relay IP's etc.)

127.0.0.1        allow,RELAYCLIENT  <------------A MUST!!!!!!
aaa.bbb          allow,RELAYCLIENT
aaa.bbb.ccc.ddd  allow,RELAYCLIENT


And that is it!!!!!!!!


Have problems check DNS first.

Your smarthost needs to have a lower priority MX record
than your primary server's MX.

Example;

domain.com  preference = 10, mail exchanger = smtp-gateway.domain.com
domain.com  preference = 15  mail exchanger = mail-internal.domain.com

Or you can just have the smarthost.

(remmember the logs below if you want ot see the message exchange between the smarthost and internal - it has 550 and 250 error codes)

Gerardo A. Gregory
Manager Network Administration and Security
Affinitas Corp.

<SNIP LOGS>


SMARTHOST WITH NO LOCAL ACCOUNTS


1 message 8 recepients 4 legit / 4 ilegal

SMTP-GATEWAY is the smarthost
mailq2 is a internal relay

*****[Timestamps might reflect slight indescreptancies (a few seconds) between systems. Internal server needs to log pop, imap, and other things. A few seconds might be discreptant]


START NEW MESSAGE VERIFY SENDERS DNS->


Jan 16 13:09:46 smtp-gateway courierd: newmsg,id=00005D1E.400836ED.0000C79B: dns; some.mx.mta.remote.esmtp (fully.qualified.domain.name [xxx.yyy.zzz.aaa])


Accept the email from the sending MTA, relay to internal email system via ESMTPROUTES -> 8 Users in my domain to receive this email (4 legit / 4 ilegal)


Jan 16 13:09:46 smtp-gateway courierd: started,id=00005D1E.400836ED.0000C79B,from=<[EMAIL PROTECTED]>,module=esmtp,host=mydomain.net,addr=<[EMAIL PROTECTED]>
Jan 16 13:09:46 smtp-gateway courierd: started,id=00005D1E.400836ED.0000C79B,from=<[EMAIL PROTECTED]>,module=esmtp,host=mydomain.net,addr=<[EMAIL PROTECTED]>
Jan 16 13:09:46 smtp-gateway courierd: started,id=00005D1E.400836ED.0000C79B,from=<[EMAIL PROTECTED]>,module=esmtp,host=mydomain.net,addr=<[EMAIL PROTECTED]>
Jan 16 13:09:46 smtp-gateway courierd: started,id=00005D1E.400836ED.0000C79B,from=<[EMAIL PROTECTED]>,module=esmtp,host=mydomain.net,addr=<[EMAIL PROTECTED]>
Jan 16 13:09:46 smtp-gateway courierd: started,id=00005D1E.400836ED.0000C79B,from=<[EMAIL PROTECTED]>,module=esmtp,host=mydomain.net,addr=<[EMAIL PROTECTED]>
Jan 16 13:09:46 smtp-gateway courierd: started,id=00005D1E.400836ED.0000C79B,from=<[EMAIL PROTECTED]>,module=esmtp,host=mydomain.net,addr=<[EMAIL PROTECTED]>
Jan 16 13:09:46 smtp-gateway courierd: started,id=00005D1E.400836ED.0000C79B,from=<[EMAIL PROTECTED]>,module=esmtp,host=host=mydomain.net,addr=<[EMAIL PROTECTED]>
Jan 16 13:09:46 smtp-gateway courierd: started,id=00005D1E.400836ED.0000C79B,from=<[EMAIL PROTECTED]>,module=esmtp,host=host=mydomain.net,addr=<[EMAIL PROTECTED]>



Denied users (4) 550 error and failure on smtp-gateway.
Jan 16 13:09:46 smtp-gateway courieresmtp: id=00005D1E.400836ED.0000C79B,from=<[EMAIL PROTECTED]>,addr=<[EMAIL PROTECTED]>: 550 User unknown.
Jan 16 13:09:46 smtp-gateway courieresmtp: id=00005D1E.400836ED.0000C79B,from=<[EMAIL PROTECTED]>,addr=<[EMAIL PROTECTED]>,status: failure
Jan 16 13:09:54 smtp-gateway courieresmtp: id=00005D1E.400836ED.0000C79B,from=<[EMAIL PROTECTED]>,addr=<[EMAIL PROTECTED]>: 550 User unknown.
Jan 16 13:09:54 smtp-gateway courieresmtp: id=00005D1E.400836ED.0000C79B,from=<[EMAIL PROTECTED]>,addr=<[EMAIL PROTECTED]>,status: failure
Jan 16 13:10:10 smtp-gateway courieresmtp: id=00005D1E.400836ED.0000C79B,from=<[EMAIL PROTECTED]>,addr=<[EMAIL PROTECTED]>: 550 User unknown.
Jan 16 13:10:10 smtp-gateway courieresmtp: id=00005D1E.400836ED.0000C79B,from=<[EMAIL PROTECTED]>,addr=<[EMAIL PROTECTED]>,status: failure
Jan 16 13:10:42 smtp-gateway courieresmtp: id=00005D1E.400836ED.0000C79B,from=<[EMAIL PROTECTED]>,addr=<[EMAIL PROTECTED]>: 550 User unknown.
Jan 16 13:10:42 smtp-gateway courieresmtp: id=00005D1E.400836ED.0000C79B,from=<[EMAIL PROTECTED]>,addr=<[EMAIL PROTECTED]>,status: failure




Accepted Users (4) 250 OK
Jan 16 13:11:46 smtp-gateway courieresmtp: id=00005D1E.400836ED.0000C79B,from=<[EMAIL PROTECTED]>,addr=<[EMAIL PROTECTED]>: 250 Ok. 40083717.00003A18
Jan 16 13:11:46 smtp-gateway courieresmtp: id=00005D1E.400836ED.0000C79B,from=<[EMAIL PROTECTED]> ,addr=<[EMAIL PROTECTED]>: 250 Ok. 40083717.00003A18
Jan 16 13:11:46 smtp-gateway courieresmtp: id=00005D1E.400836ED.0000C79B,from=<[EMAIL PROTECTED]>,addr=<[EMAIL PROTECTED]>: 250 Ok. 40083717.00003A18
Jan 16 13:11:46 smtp-gateway courieresmtp: id=00005D1E.400836ED.0000C79B,from=<[EMAIL PROTECTED]>,addr=<[EMAIL PROTECTED]>: 250 Ok. 40083717.00003A18




Relay Passes Mail to Internal Mail System
Jan 16 13:11:46 smtp-gateway courieresmtp: id=00005D1E.400836ED.0000C79B,from=<[EMAIL PROTECTED]>,addr=<[EMAIL PROTECTED]>,size=1629,success: delivered: [bbb.zzz.aaa.xxx] [bbb.zzz.aaa.xxx]
Jan 16 13:11:46 smtp-gateway courieresmtp: id=00005D1E.400836ED.0000C79B,from=<[EMAIL PROTECTED]>,addr=<[EMAIL PROTECTED]>,size=1629,status: success
Jan 16 13:11:46 smtp-gateway courieresmtp: id=00005D1E.400836ED.0000C79B,from=<[EMAIL PROTECTED]>,addr=<[EMAIL PROTECTED]>,size=1629,success: delivered: [bbb.zzz.aaa.xxx] [bbb.zzz.aaa.xxx]
Jan 16 13:11:46 smtp-gateway courieresmtp: id=00005D1E.400836ED.0000C79B,from=<[EMAIL PROTECTED]>,addr=<[EMAIL PROTECTED]>,size=1629,status: success
Jan 16 13:11:46 smtp-gateway courieresmtp: id=00005D1E.400836ED.0000C79B,from=<[EMAIL PROTECTED]>,addr=<[EMAIL PROTECTED]>,size=1629,success: delivered: [bbb.zzz.aaa.xxx] [bbb.zzz.aaa.xxx]
Jan 16 13:11:46 smtp-gateway courieresmtp: id=00005D1E.400836ED.0000C79B,from=<[EMAIL PROTECTED]>,addr=<[EMAIL PROTECTED]>,size=1629,status: success
Jan 16 13:11:46 smtp-gateway courieresmtp: id=00005D1E.400836ED.0000C79B,from=<[EMAIL PROTECTED]>,addr=<[EMAIL PROTECTED]>,size=1629,success: delivered: [bbb.zzz.aaa.aaa] [bbb.zzz.aaa.xxx]
Jan 16 13:11:46 smtp-gateway courieresmtp: id=00005D1E.400836ED.0000C79B,from=<[EMAIL PROTECTED]>,addr=<[EMAIL PROTECTED]>,size=1629,status: success



Finishing Up & send Undeliverable notice back to sender
Jan 16 13:11:46 smtp-gateway courierd: completed,id=00005D1E.400836ED.0000C79B
Jan 16 13:11:46 smtp-gateway courierd: started,id=00005D1E.400836ED.0000C79B,from=<>,module=dsn,host=,addr=<[EMAIL PROTECTED]>
Jan 16 13:11:47 smtp-gateway courierd: completed,id=00005D1E.400836ED.0000C79B






[On the Internal email this is what is happening (Before the users are 550 on the smtp-gateway the TCP connection between both systems it up
550 error is just passed from internal email to smatp-gateway.]




Meanwhile at the internal relay users are marked 550


Relay Connection is started Jan 16 13:09:48 mailq2 courieresmtpd: started,ip=[192.168.2.111]

Rejected users 550
Jan 16 13:09:51 mailq2 courieresmtpd: error,relay=bbb.zzz.aaa.xxx,from=<[EMAIL PROTECTED]>,to=<[EMAIL PROTECTED]>: 550 User unknown.
Jan 16 13:09:59 mailq2 courieresmtpd: error,relay=bbb.zzz.aaa.xxx,from=<[EMAIL PROTECTED]>,to=<[EMAIL PROTECTED]>: 550 User unknown.
Jan 16 13:10:15 mailq2 courieresmtpd: error,relay=bbb.zzz.aaa.xxx,from=<[EMAIL PROTECTED]>,to=<[EMAIL PROTECTED]>: 550 User unknown.
Jan 16 13:10:47 mailq2 courieresmtpd: error,relay=bbb.zzz.aaa.xxx,from=<[EMAIL PROTECTED]>,to=<[EMAIL PROTECTED]>: 550 User unknown.


Accept the remainder for delivery courierd starts a new message ID
Jan 16 13:11:51 mailq2 courierd: newmsg,id=00ACE821.40083717.00003A18

Jan 16 13:11:51 mailq2 courierd: started,id=00ACE821.40083717.00003A18,from=<[EMAIL PROTECTED]>,module=local,host=Accepted_user_1!!UID!GID!/some/unix/directory/Accepted_user_1!!,addr=<Accepted_user_1>
Jan 16 13:11:51 mailq2 courierd: started,id=00ACE821.40083717.00003A18,from=<[EMAIL PROTECTED]>,module=local,host=Accepted_user_2!!UID!GID!/some/unix/directory/Accepted_user_2!!,addr=<Accepted_user_2>
Jan 16 13:11:51 mailq2 courierd: started,id=00ACE821.40083717.00003A18,from=<[EMAIL PROTECTED]>,module=local,host=Accepted_user_3!!UID!GID!/some/unix/directory/Accepted_user_3!!,addr=<Accepted_user_3>
Jan 16 13:11:51 mailq2 courierd: started,id=00ACE821.40083717.00003A18,from=<[EMAIL PROTECTED]>,module=local,host=Accepted_user_4!!UID!GID!/some/unix/directory/Accepted_user_4!!,addr=<Accepted_user_4>



Notice that only Maildrop runs with the users permissions. Hence why the relay does not require the local accounts on the system. As Courier runs as the Courier user with the Courier permissions..



Jan 16 13:11:51 mailq2 courierlocal: id=00ACE821.40083717.00003A18,from=<[EMAIL PROTECTED]>,addr=<[EMAIL PROTECTED]>,size=1729,success: Message delivered.
Jan 16 13:11:51 mailq2 courierlocal: id=00ACE821.40083717.00003A18,from=<[EMAIL PROTECTED]>,addr=<[EMAIL PROTECTED]>,size=1729,success: Message delivered.
Jan 16 13:11:51 mailq2 courierlocal: id=00ACE821.40083717.00003A18,from=<[EMAIL PROTECTED]>,addr=<[EMAIL PROTECTED]>,size=1729,success: Message delivered.
Jan 16 13:11:51 mailq2 courierlocal: id=00ACE821.40083717.00003A18,from=<[EMAIL PROTECTED]>,addr=<[EMAIL PROTECTED]>,size=1729,success: Message delivered.


(I have no idea why the message size grows. I imagine it is added headers to the message from AV, relaying, and spam filter)

Jan 16 13:11:52 mailq2 courierd: completed,id=00ACE821.40083717.00003A18

FINISHED!!!!!!!!!!!!!!!!!!!!!!!!

<SNIP END>



-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
courier-users mailing list
[EMAIL PROTECTED]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users

Reply via email to