I just discovered this thread while looking for something else, but thought I would add my experiences to it if it will help anyone.
Here are some mods I made to the SpamBlocker.exim.conf.2.0-release (Thank you, Jeff). So far, the mods have worked fine for me. It's been so long ago that I did these that I forget all of the sources I researched.
Anyway, in exim.conf, right before "# Specify your host's canonical name here" I have added:
Code:
smtp_active_hostname = ${lookup{$interface_address}lsearch{/etc/virtual/smtp_active_hostnames}{$value}}
smtp_banner = "$smtp_active_hostname server is ready"
To work, it requires the interface mod I'll mention shortly.
The two lines above effectively do several things, but mainly and oversimplified, when the mail server is queried, it returns the appropriate message for the domain in question. I created a separate file in etc/virtual called "smtp_active_hostnames" which is a listing of all the domains on the server and looks like this:
Code:
69.61.61.198: mail.refs.org
69.61.61.196: mail.refereehosting.com
.....etc
So, for refs.org, the mail greeting message sent states, "220 mail.refs.org server is ready", with no server hostname showing at all.
After those two lines above, I have also added the following:
Code:
received_header_text = "Received: \
${if def:sender_rcvhost {from ${sender_rcvhost}\n\t}\
{${if def:sender_ident {from ${sender_ident} }}\
${if def:sender_helo_name {(helo=${sender_helo_name})\n\t}}}}\
by ${lookup{$sender_address_domain} lsearch{/etc/virtual/interface_names}{$value}} \
${if def:received_protocol {with ${received_protocol}}} \
(Refereemail Version 1.72)\n\t\}"
Ironically, at the end of my conf file under remote_smtp , my interface entry is almost identical to the one mentioned by ballyn :
Code:
interface = "${lookup{$sender_address_domain}lsearch{/etc/virtual/interfaces}{$value}}"
helo_data = "mail.$sender_address_domain"
That requires another file that is easily created; ballyn uses 'domainips', mine is '/etc/virtual/interfaces' - containing the domain names and the ip addresses.
Code:
refs.org: 69.61.61.198
refereehosting.com: 69.61.61.196
etc..
etc...
This works for virtual hosts like a charm, which was already mentioned earlier in the thread.
Lots of other things here, but I'll keep it simple.
The mods I made remove the server hostname from the received headers and replaces it with the name of the domain sending the mail.
Also, by default, exim identifies itself as the MTA, and includes the version number. Not that there is anything wrong with that, but I feel some obscurity is still better than none at all (thus I use 'Refereemail" - you can make up your own name as an MTA.)
I'll give you a real example to let you see the impact. Here are part of two sets of genuine mail headers which will show the difference before adding all the additional lines above and after adding the additional lines. The mail that was sent was generated by a domain that was auto-responding to input from a php form.
BTW, for clarification, the server's primary_hostname is set as sv1.officiatingonline.com.
Here are the "before" headers:
Code:
Received: from [69.61.61.194] (HELO sv1.officiatingonline.com)
by fe2.cluster1.echolabs.net (CommuniGate Pro SMTP 5.0.11)
with ESMTPS id 39181571 for [email][email protected][/email]; Sun, 03 Dec 2006 21:42:33 -0500
Received-SPF: neutral
receiver=fe2.cluster1.echolabs.net; client-ip=69.61.61.194; [email protected]
Received: from apache by sv1.officiatingonline.com with local (Exim 4.63)
(envelope-from <[email protected]>)
id 1Gr3n0-0001c6-Hw
for [email][email protected][/email]; Sun, 03 Dec 2006 21:42:42 -0500
To: [email][email protected][/email]
Subject: Our response
And the "after" headers
(took me about five minutes to repatch Exim, verify that all was well, and then resend myself an email):
Code:
Received: from mail.gspaldingrefs.com ([69.61.61.200] verified)
by fe2.cluster1.echolabs.net (CommuniGate Pro SMTP 5.0.11)
with ESMTPS id 39184461 for [email][email protected][/email]; Sun, 03 Dec 2006 21:47:22 -0500
Received-SPF: pass
receiver=fe2.cluster1.echolabs.net; client-ip=69.61.61.200; [email protected]
Received: from apache by mail.gspaldingrefs.com with local (Refereemail Version 1.72)
; Sun, 03 Dec 2006 21:47:32 -0500
To: [email][email protected][/email]
Subject: Our response
Take note of the Received-SPF part of the headers.
More documentation from exim on different variables with which to use can be found at:
Exim Expansion Variables
Just thought I'd add what I have made work for me. All the mail being sent from the server now shows the domain from which it originated. I've tested it with users sending mail from Outlook and Thunderbird with smtp authentication, and it seems to be working fine. I've a small dedicated server with only a few domains, so YMMV depending upon your situation.
One thing I'm still working on, though, is how to modify the Message-ID; I haven't figured out how to get it to show the sender domain name instead of the server hostname. Any thoughts or clues on that are appreciated.
Mike