Exim sending messages with ip assigned to other users

HELO is how your machine responds when it receives an email. It has nothing to do with sending an email.

Your HELO should never respond with localhost; I and many others will reject email from you by default if you HELO with localhost. In fact it's the default of the DirectAdmin exim.conf file.

Jeff
 
Thanks for your reply.

So there is something wrong in my conf. Because there is always localhost...

Do you have an idea ?
I post, if I find it before you reply.

best regards

EDIT : I am probably wrong... Maybe only email inside the server have localhost. If I write outsite the server, it seems HELO=name of server.
So probably, it is normal, that email deliver in another email in the same server has localhost ?
 
Last edited:
Unclear....

Here the headers of my email
This is a message send by a domain (with his own IP) in server AAA to an email in server BBB

As to be clear (maybe)

[email protected] has send the email (from his own IP)
IP.DOMAIN is the own IP of the domain who sends the email
reverseIP.domain is the reverse name of IP.DOMAIN
name.server.AAA is the name of the server A
name.server.BBB is the name of the server B
[email protected] receive the email.
Code:
Received: from mail by name.server.BBB with spam-scanned (Exim 4.69)
	(envelope-from <[email protected]>)
	id 1PLF6B-0003pj-Pg
	for [email protected]; Wed, 24 Nov 2010 14:09:24 +0100
Received: from reverseIP.domain ([IP.DOMAIN] helo=name.server.AAA)
	by name.server.BBB with esmtps (TLSv1:AES256-SHA:256)
	(Exim 4.69)
	(envelope-from <[email protected]>)
	id 1PLF6A-0003pg-7v
	for [email protected]; Wed, 24 Nov 2010 14:09:23 +0100
DKIM-Signature: ...;
Received: from reverseIP.domain ([IP.DOMAIN] helo=localhost)
	by name.server.AAA with esmtpsa (TLSv1:AES256-SHA:256)
	(Exim 4.72)
	(envelope-from <[email protected]>)
	id 1PLF6n-0007Pa-KD
	for [email protected]; Wed, 24 Nov 2010 14:10:01 +0100
 
You've munged information which makes it impossible to help you further.

If you'd like help put in real information.

Jeff
 
Another question in the same idea.
I search in different forum, but do not find anything about my problem.

Is it possible to send mail from different IP for different user in the same domain ? As we do for different domains ?

Example to be clear :

domain.com

and 2 emails [email protected] and [email protected]

Is there a method to use different IP for user1 and user2 ?

Thanks for your help
 
Anything is possible with Exim. You can hardcode the values to look for and assign different IPs and hostnames.
 
Perfect if it's possible.
But I have no idea how to do it.

Have you an example for me ? Or a good link to read informations ?
 
Unfortunately, I don't have an example, because I've never had a client ask for something like this, but I can give you pointers:
- Study the IP/hostname switch examples to see how it works to "detect and change"
- Use the authentication address as the condition for the switch
 
It can be used like that:

Code:
remote_smtp:
  driver = smtp
  interface=aaa.bbb.ccc.ddd

But I'm not sure, if you can use any switches here. Please, post your working solution, if you find.
 
zEiter :
I already use different IP for different domains.
Now I want to use different IP for the same domain, depending of the email address of sender. No idea how to do

I just send my question to exim list.
If I have answers or solution, I come back here
 
I just saw an answer to this today on exim-users. Was that in response to you?

Jeff
 
Yes, I have it, and I will test it very soon.
After I post it to answer to my question.
 
With your help, I use this, and it works very well

I do this :
Code:
remote_smtp:
driver = smtp
interface = ${lookup{$sender_address_domain}lsearch{/etc/virtual/interfaces} {$value}{SHARED.IP.FROM.SERVER}}
helo_data = "mail.$sender_address_domain"
#{SHARED.IP.FROM.SERVER} for domains not list in /etc/virtual/interfaces

In /etc/virtual/interfaces, I put :
Code:
domain1.com: xxx.xxx.xxx.xxx
domain2.com: yyy.yyy.yyy.yyy

Now, I see in logs, maybe something wrong :
91.121.35.44 -> 1.2.3.4 SMTP S: 221 serveur3.3go.fr closing connection

91.121.35.44 is IP used for the domain sending the email.
serveur3.3go.fr is the hostname of my server, not the reverse of 91.121.35.44

If I understand, serveur3.3go.fr is send by primary_hostname in exim.conf
In exim.conf, I have :
Code:
# primary_hostname =
Comment, so it uses the default hostname ? Right ?

My question : is it possible to change like this :
Code:
primary_hostname = ${lookup{$sender_address_domain}lsearch{/etc/virtual/primary_hostnames} {$value}{serveur3.3go.fr}}
And do a file /etc/virtual/primary_hostnames like this
Code:
sg-autorepondeur.com: 91.121.53.61
domain1.fr: serveur3.3go.fr
domain2.fr: serveur4.3go.fr
domain3.fr: serveur5.3go.fr

Thanks for your help
 
working solution - for everyone who wants to use different ip for each domain

1. add to exim.conf line:
Code:
local_interfaces = a.a.a.a : b.b.b.b : c.c.c.c : d.d.d.d
smtp_active_hostname = ${lookup{$interface_address}lsearch{/etc/virtual/smtp_active_hostnames}{$value}}
smtp_banner = "$smtp_active_hostname ESMTP $tod_full"
where a.a.a.a b.b.b.b ... are ip addresses for each domain

2. add to exim.conf line in driver section:
Code:
remote_smtp:
  driver = smtp
  interface = "${lookup{$sender_address_domain}lsearch{/etc/virtual/domainips}{$value}}"
  helo_data = "mail.$sender_address_domain"
2. create new file called "smtp_active_hostname" with :
Code:
a.a.a.a: mail.hostname_for_domain_a
b.b.b.b: mail.hostname_for_domain_b
- for every domain and ip address one line

4. create file "domainips" with:
Code:
domain_a: a.a.a.a
domain_b: b.b.b.b
- for every domain and ip address one line

This soultion works great for me and I don't have problem with sending messages.

if there will be any questions ask here or write private message for me.

Best Regards
Piter
 
Code:
helo_data = "mail.$sender_address_domain"

This part is a little bit dangerous for using, as it makes to use NOT fully-qualified hostname like mail. in case if $sender_address_domain is not determined. This is very actual for outgoing from directadmin powered server bounce emails. I can not say, that's true for all of 100% cases. But if you see <> instead of real email address for an email stuck in exim queue, then exim trying to deliver such an email will get:

Helo command rejected: need fully-qualified hostname

or
<mail.>: Helo command rejected: need fully-qualified hostname

from a remote SMTP server, and in certain cases it make risks to get into a ban list higher.
 
To solve the issue mentioned by me in the previous reply, I'd suggest using this:

Code:
  interface = "${lookup{$sender_address_domain}lsearch{/etc/virtual/domainips}{$value}{11.22.33.44}}"
  helo_data = "${lookup{$sending_ip_address}lsearch{/etc/virtual/helo_data}{$value}{$primary_hostname}}"


and /etc/virtual/helo_data should be as following:
Code:
11.22.33.44: mail.domain.net
11.22.33.45: mail.domain2.com
11.22.33.46: mail.domain3.com
11.22.33.47: mail.domain4.com

Note, I have not tested that quite enough, just for couple days till now. Anyway none issue has been faced since that with it.

Remember, that CBL does not like multiple/several HELO/EHLO from one IP, and if they catch you, then your IP might get into their blacklist.
 
Last edited:
I have problem with this solution.

Let guess that I have 2 IP address:
111.222.333.444
555.666.777.888

every time when i add new user, I must manually add his domain in domainips file ? How I can manage my users to send email from shared IP of server, and only specific user from specific IP. How I understand this solution is working but the problems is in manually edit helo_data and domainips files.

So I edited my configuration and make all my domains to address 111.222.333.444 and only one specific user to his address 555.666.777.888 and now after adding new user to my server hi is not able to send email if I do not add him to domainips and helo_data files.

Is there any solution for this ?


Best regards
 
Last edited:
Back
Top