James
Translated
Downloads
Current Documentation
Older Documentation
Project
Jakarta Information (web)
Related Projects (web)
|
The problem |
This document explains how to configure sendmail to route all mail generated by /usr/sbin/sendmail or local mail on a host through James on the same host, including mail to local addresses without @host.
All sendmail configuration file locations are for Redhat Linux 7.2, other installations may have different locations.
We take no responsibility for the quality of the information in this document.
You should back-up any configuration files *before* you alter them.
|
Solution |
Step 2: Set up sendmail to use relay |
Ok, so far so good, now you need to tell sendmail to relay everything, regardless of its rules, through James. James will take the roles of "local relay" (destination for all unqualified local addresses), "mail hub" (destination for all qualified local addresses) and "smart relay" (destination for all other mail) for this instance of sendmail, thereby catching everything.
So open /etc/sendmail.cf and..
- Look for the line beginning DS make this line DSesmtp:localhost
- Look for the line beginning DR make this line DResmtp:localhost
- Look for the line beginning DH make this line DHesmtp:localhost
Now that wasn't too hard was it?
What we have done is to tell sendmail to use its "mailer" called esmtp to relay mail using ESMTP to localhost for each role.
Of course no-one in their right mind would relay mail to localhost, because it would loop forever right?
|
Step 3: Stop sendmail complaining about mail apparently looping back |
The developers of sendmail have, wisely, built sendmail in such a way as to prevent, by default, mail being sent by sendmail back to itself, this is done by making a quick check on outgoing mail to see if its destination is our machine. If it is you'll see this message config error: mail loops back to me when you try to send mail.
But we *want* to relay mail to localhost, and because sendmail isn't receiving our mail, James is, we won't be creating a loop. (make sure you've followed step one though).
So open /etc/sendmail.cf again and go to the bottom of the file, start scrolling upwards until you see the declaration of the esmtp mailer it'll look something like this
 |  |  |
 |
Mesmtp, P=[IPC], F=mDFMuXa, S=EnvFromSMTP/HdrFromSMTP, R=EnvToSMTP, E=\r\n, L=990,
T=DNS/RFC822/SMTP,
A=TCP $h
|  |
 |  |  |
You need to change it so its more like this: :-D
 |  |  |
 |
Mesmtp, P=[IPC], F=kmDFMuXa, S=EnvFromSMTP/HdrFromSMTP, R=EnvToSMTP, E=\r\n, L=990,
T=DNS/RFC822/SMTP,
A=TCP $h
|  |
 |  |  |
But seriously, we've added a k to the "F=" list F=mDFMuXa becomes F=kmDFMuXa
And again, thats it, sendmail will now skip the loopback test on mail leaving through the esmtp mailer.
Now you have to make some tests. Try each of the following, replace names in [] with names of the kind described.
 |  |  |
 |
/[root@apache root]# mail -v [real-localusername]
[root@apache root]# mail -v [nonexistant-localusername]
[root@apache root]# mail -v [real-localusername]@localhost
[root@apache root]# mail -v [real-localusername]@[myhostname.mydomainname]
[root@apache root]# mail -v [real-username]@[real-remote-account]
|  |
 |  |  |
Sendmail echoes each conversation to STDOUT so you can see what its trying to do with each mail.
|
Thats it, good luck and happy mailing :) Danny Angus
|
|