Exim to a different IP

ialex03

Well-Known Member
May 15, 2003
56
0
156
Hello.

Could someone help me to bind Exim to a different IP address?

Now it sends emails from main server IP but I need it to send from a secondary IP. It is possible?

Thank you.
 

RaveKnights

Well-Known Member
Nov 5, 2003
81
0
156
Some Where Out There!
Originally posted by ialex03
Hello.

Could someone help me to bind Exim to a different IP address?

Now it sends emails from main server IP but I need it to send from a secondary IP. It is possible?

Thank you.
Inside both incoming and outgoing you will need to add an interface like so:

find
remote_smtp:
driver = smtp

inside:
/etc/exim_outgoing.conf
/etc/exim.conf

and add interface = ip.you.want.to.use

example as shown below:

________________________
remote_smtp:
driver = smtp
interface = 22.22.22.22
_________________________

IP needs to be on server in order for this to work

save and restart exim
 

ialex03

Well-Known Member
May 15, 2003
56
0
156
Thank you very much, you are rock :)
You saved my time, I was going to start looking for solution in the Exim docs.
 

RaveKnights

Well-Known Member
Nov 5, 2003
81
0
156
Some Where Out There!
Originally posted by ialex03
Thank you very much, you are rock :)
You saved my time, I was going to start looking for solution in the Exim docs.
If there is an exim update when you upgrade your cpanel you will need to re-enter the interface again.

Just a reminder.
 

mr_hack

Member
Dec 8, 2001
8
0
301
RaveKnights said:
Inside both incoming and outgoing you will need to add an interface like so:

find
remote_smtp:
driver = smtp

inside:
/etc/exim_outgoing.conf
/etc/exim.conf

and add interface = ip.you.want.to.use

example as shown below:

________________________
remote_smtp:
driver = smtp
interface = 22.22.22.22
_________________________

IP needs to be on server in order for this to work

save and restart exim

If i make it, exim work without SMTP auth. Why?
 

ialex03

Well-Known Member
May 15, 2003
56
0
156
You are not quite right.
The thing is cpanel uses SMTP auth. and POP3 before SMTP.
If you receieve an email via POP it puts your IP into
/etc/relayhosts
and you can send emails without any authentication for 30 minutes.

To make sure just empty the file /etc/relayhosts and try to send a test email with SMTP auth. turned OFF in your browser. It won't allow you to send.
 

jeroman8

Well-Known Member
Mar 14, 2003
410
0
166
This is really great :) - Thanks!!

I couldn't find the outgoing.conf file so I added all in

exim.conf
exim.conf.mailman2.dist
exim.conf.dist

Seesm to work just fine but I have only done using SMTP.
Anyone done this using sendmail - will thsi affect sendmail or
will it still ahve same IP as before ?
 

grega

Member
Jan 22, 2004
9
0
151
Ljubljana, Slovenia
You may prevent Cpanel from overwriting your EXIM conf file by chattrib the config itself:
chattr +e /etc/exim.conf

To "unprotect" he file use:
chattr -e /etc/exim.conf

This way the file is unwritable even with permissions set to 755.
However this method may be problematic with Cpanel upgrades. If possible use EXIm editor in Service Configuration / Exim Configuration Editor / Switch to advanced mode. But it is true that you can not enter values for remote_smtp.

Maybe Cpanel team should extend the editor a little bit more to allow more control over Cpanel updating conf file :cool:
 

chirpy

Well-Known Member
Verifed Vendor
Jun 15, 2002
13,437
33
473
Go on, have a guess
That won't work (using chattr) as the cPanel exim scripts remove the immutable flag from the configuration files before they modify them.
 

sbd

Registered
Oct 5, 2006
3
0
151
Ahmmm. I have a more complecated question in my head.

First of all let me tell you that I did not find the exim_outgoing file in the system.
Is this normal ? I saw another guy says he didnt find it.
I simply create it and add the interface line ???
Which command inside exim.conf can limit the max send of emails per once ?

Also exim in its beggining has a command which gives him all local domain names etc.
But how can you define exims name ? Ex : mail.yourdomain.com
As I have read and under the rfcs mailservers need even a PTR (reverse) record in order they can function correctly.

Excuse my lameness in exim. I have never worked with exim before and generally I am a noob in mailservers in general. I ask for your help since I am really tight in time right now and I really need your assistance !

Thanks you all for your time.

Regards
sbd
 

nickp666

Well-Known Member
Jan 28, 2005
769
2
168
/dev/null
sbd said:
Ahmmm. I have a more complecated question in my head.

First of all let me tell you that I did not find the exim_outgoing file in the system.
Is this normal ? I saw another guy says he didnt find it.
I simply create it and add the interface line ???
Which command inside exim.conf can limit the max send of emails per once ?

Also exim in its beggining has a command which gives him all local domain names etc.
But how can you define exims name ? Ex : mail.yourdomain.com
As I have read and under the rfcs mailservers need even a PTR (reverse) record in order they can function correctly.

Excuse my lameness in exim. I have never worked with exim before and generally I am a noob in mailservers in general. I ask for your help since I am really tight in time right now and I really need your assistance !

Thanks you all for your time.

Regards
sbd
exim_outgoing.conf isnt there by default, people running mailscanner will have it though
 

sbd

Registered
Oct 5, 2006
3
0
151
Mailscanner is something like spamassasign ?

If you dont have mailscanner you only need to add the interface line on the exim.conf ?

On my other queries do you have any solution?

Thanks for your reply nickp.

Regards
sbd
 

grega

Member
Jan 22, 2004
9
0
151
Ljubljana, Slovenia
sbd said:
Ahmmm. I have a more complecated question in my head.

First of all let me tell you that I did not find the exim_outgoing file in the system.
Is this normal ? I saw another guy says he didnt find it.
I simply create it and add the interface line ???
Which command inside exim.conf can limit the max send of emails per once ?

Also exim in its beggining has a command which gives him all local domain names etc.
But how can you define exims name ? Ex : mail.yourdomain.com
As I have read and under the rfcs mailservers need even a PTR (reverse) record in order they can function correctly.

Excuse my lameness in exim. I have never worked with exim before and generally I am a noob in mailservers in general. I ask for your help since I am really tight in time right now and I really need your assistance !

Thanks you all for your time.

Regards
sbd
What would you like to accomplish ?
Would you like to enable exim listening or sending on certain IP address ?

cPanel's exim has all main configuration made in /etc/exim.conf.
So if you would like to bind listening interface to certain IP address open /etc/exim.conf and add this line at the beginning of conf file:
local_interfaces = xxx.xxx.xxx.xxx : xxx.xxx.xxx.xxx

You can add more IP address, delimit them with a ":"

If you would like to limit from which IP you are sending mail add to conf file, just under:

begin transports
remote_smtp:
driver = smtp
interface = xxx.xxx.xxx : xxx.xxx.xxx.xxx

Rule for more IP address apply as mentioned above.

But be carefull !

cPanel overwrites custom modiffications so change those custom rules in WHM / Service Configuration / Exim Configuration Editor
Open "Advanced Editor" and add in first edit field under "#!!# cPanel Exim 4 Config":
local_interfaces = xxx.xxx.xxx.xxx : xxx.xxx.xxx.xxx

You cannot add sending smtp interface yo make sure you check conf file after cPanel upgrades.

Regards,
Grega
 

nickp666

Well-Known Member
Jan 28, 2005
769
2
168
/dev/null

sbd

Registered
Oct 5, 2006
3
0
151
First of all many thanks to all of you that have replied !!!
Yes I wish as well there was no exim and there was a postfix .... But thats cpanel that customers want and customer is always right :)

Last question. Does anyone know how to setup the mailservers name ?
 

Spiral

BANNED
Jun 24, 2005
2,018
8
193
chirpy said:
That won't work (using chattr) as the cPanel exim scripts remove the immutable flag from the configuration files before they modify them.
I put a wrapper replacement for chattr that seems to work for protecting certain
items that I don't want updated.

When the chattr command is called on my servers, it basically checks a list of
protected files and if the target is on the list then it aborts the real chattr
command but reports successful completion of the script.

Pretty basic but works
 

isputra

Well-Known Member
May 3, 2003
574
0
166
Mbelitar
What would you like to accomplish ?
Would you like to enable exim listening or sending on certain IP address ?

cPanel's exim has all main configuration made in /etc/exim.conf.
So if you would like to bind listening interface to certain IP address open /etc/exim.conf and add this line at the beginning of conf file:
local_interfaces = xxx.xxx.xxx.xxx : xxx.xxx.xxx.xxx

You can add more IP address, delimit them with a ":"

If you would like to limit from which IP you are sending mail add to conf file, just under:

begin transports
remote_smtp:
driver = smtp
interface = xxx.xxx.xxx : xxx.xxx.xxx.xxx

Rule for more IP address apply as mentioned above.

But be carefull !

cPanel overwrites custom modiffications so change those custom rules in WHM / Service Configuration / Exim Configuration Editor
Open "Advanced Editor" and add in first edit field under "#!!# cPanel Exim 4 Config":
local_interfaces = xxx.xxx.xxx.xxx : xxx.xxx.xxx.xxx

You cannot add sending smtp interface yo make sure you check conf file after cPanel upgrades.

Regards,
Grega
This is not work anymore on CPanel 11 Stable