Exim Configuration Editor Question

HostDime

Well-Known Member
PartnerNOC
Mar 15, 2003
77
0
156
Orlando, Florida
I cannot edit exim.conf because a cPanel update will overwrite it.

I need to change the IP used to send mail, within the Exim Configuration Editor in WHM.

Each time I try, I place the code in the box below:

message_prefix =
message_suffix =

I enter:
interface = ip

I also have tried:
interface=ip

An error displays at each save, "Invalid syntax"

I thought the same thing would be typed as you would type in exim.conf directly.

Does anyone have any advice on this?

:eek:
 

DigitalN

Well-Known Member
Sep 23, 2004
419
1
168
You need to find the folowing section of exim.conf (transports section)

Code:
remote_smtp:
  driver = smtp
and then change that to

Code:
remote_smtp:
  driver = smtp

interface = 123.123.123.123
123.123.123.123 being the IP you want exim to use. Restart exim after making the change.
 
R

Ramsy

Guest
in shell edit /etc/exim.conf.dist (be sure to make a backup first)
then save and do a /scripts/buildeximconf

restart exim with service exim restart and you're done
 
R

Ramsy

Guest
not sure what other modifications you made ....
check out exim.conf.local, exim.conf.localopts and exim.conf.dist
 

HostDime

Well-Known Member
PartnerNOC
Mar 15, 2003
77
0
156
Orlando, Florida
I think I will reword my question at this time. :)

It is to my understanding and also confirmed by my testing, if you change the IP in exim.conf directly, it is overwritten with a cPanel update.

I need to make a change, and have it stay. I don't need it to be overwritten.

Therefore, I want to change it in WHM directly in the editor because it claims to not overwrite your changes if you do it that way.

However, when I do this, I always get an error. Option INTERFACE unknown. Then it states that the changes have been saved, but they have not.

So this is where I am. I need to know what to type since it is not accepting "interface".

Here is what I type and what happens afterwards, with screenshots.

I hope that we can figure this out here and hopefully help someone else out in the future. This problem so far is driving me batty and I wouldn't wish this on anyone. :eek:



 
Last edited:

DigitalN

Well-Known Member
Sep 23, 2004
419
1
168
As mentioned, if you want to change the IP that exim binds to, you need to add this

Code:
remote_smtp:
  driver = smtp

interface = 123.123.123.123

You added the interface config in the wrong section of exim.conf - Try adding it where I suggested and it will work, directly under the existing driver = smtp line, you need interface

You may not be able to edit that using the whm editor, as I don't think it allows an entry there, no box on that part. Enter it manually and see if that works for you, I have been adding this config to exim for near 2 years, so it should work for you 2 :)
 

DigitalN

Well-Known Member
Sep 23, 2004
419
1
168
Ok, fair enough, I was just explaining why you were getting the error, as you seem to be confused with the exim.conf syntax and why the error was being displayed.

I always keep a copy of exim.conf and if it gets wiped, I install the backup copy, write a /scripts/postupcp to make the change automatically, if exim.conf gets updated.
I haven't found it to be too much of a problem, as I liked to make sure that exim updates were done manually and that isn't all that often that exim needs reinstalling or updating.

You may be able to add the interaface config manually to one of the exim.conf.* files to have the changes written back automatically too should it get updated, but I've never looked into that, maybe you could trial and error it or maybe someone else can chime in with that info.
 

HostDime

Well-Known Member
PartnerNOC
Mar 15, 2003
77
0
156
Orlando, Florida
I always edit exim.conf without issues. I recently discovered that a cPanel update wipes changes that I make to the file.

This is why I want to edit the file via WHM. I need to do this to a few servers, and would like the change to stay.

But the edit box does not appear directly below driver = smtp.
Though there is one above that section.

Either box gives me the same error as seen in the screenshot.
 

HostDime

Well-Known Member
PartnerNOC
Mar 15, 2003
77
0
156
Orlando, Florida
DigitalN said:
You may be able to add the interaface config manually to one of the exim.conf.* files to have the changes written back automatically too should it get updated, but I've never looked into that, maybe you could trial and error it or maybe someone else can chime in with that info.
I think what Ramsy mentioned might be the solution but I wasn't sure if he understood what I was doing, since there appeared to be some confusion.

"in shell edit /etc/exim.conf.dist (be sure to make a backup first)
then save and do a /scripts/buildeximconf

restart exim with service exim restart and you're done"

Ramsy, can you confirm that it's a permanent change? Thanks!
 

fmalekpour

Well-Known Member
PartnerNOC
Dec 4, 2002
85
1
158
Changes will not be permanent, Here is what you need to do:

In WHM on Exim Configuration Editor, rewrite two routers, There is an edit box bellow "ROUTERS CONFIGURATION", Box is before "lookuphost" router, Put these lines to that box:


(7th box from top in exim configuration)
mylookuphost:
driver = dnslookup
condition = "${perl{checkspam}}"
domains = ! +local_domains
ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8 : 64.94.110.0/24
headers_add = "${perl{mailtrapheaders}}"
transport = my_remote_smtp

myliteral:
driver = ipliteral
condition = "${perl{checkspam}}"
domains = ! +local_domains
headers_add = "${perl{mailtrapheaders}}"
transport = my_remote_smtp

Then move down to "TRANSPORTS CONFIGURATION", On edit box there (just up the remote_smtp transporter) put these lines:

(12th box from top in exim configuration)
my_remote_smtp:
driver = smtp
interface = 72.29.75.244
This will be permanent and will not change by CPanel updates.


Good Luck
F.Malekpour
Dayana Networks Ltd.
 

SubZero

Well-Known Member
Apr 21, 2005
100
0
166
Balmumcu, Istanbul, TR
Hi,

Thanks for the lift. I now managed to set some hosts to avoid TLS with this modification:
Code:
my_remote_smtp:
  driver = smtp
  hosts_avoid_tls = lsearch;/etc/tlsdisabledhosts
Thank you.. :)

I have another question for this setup.

I have 3 IPs and hosting 15 domains. They all use the same IP (my 1st IP) for sending out emails. Lets say I list my domains on /etc/mysecondip and /etc/mythirdip. Lets say if the domain is on the /etc/mysecondip, send the mail thru my second IP; and if the domain is on the /etc/mythirdip, send the mail thru my third IP; and for all remaining mails, send them using my first ip. Can you please help me with this configuration?
 

brianoz

Well-Known Member
Mar 13, 2004
1,146
7
168
Melbourne, Australia
cPanel Access Level
Root Administrator
There's a command line option to exim to provide this functionality that I found one day when I was looking for an answer to this problem when I was being blocked by a somewhat difficult to deal with email service.

The -oMi option is the option in question. I ended up using the "interface =" method myself, so I'm not sure whether it works, or whether I've actually correctly understood what the option is for.

It's documented in: http://www.exim.org/exim-html-4.10/doc/html/spec_5.html
 

katmai

Well-Known Member
Mar 13, 2006
564
4
168
Brno, Czech Republic
quoting subzero

Hi,

Thanks for the lift. I now managed to set some hosts to avoid TLS with this modification:
Code:
my_remote_smtp:
driver = smtp
hosts_avoid_tls = lsearch;/etc/tlsdisabledhostsThank you..

I have another question for this setup.

I have 3 IPs and hosting 15 domains. They all use the same IP (my 1st IP) for sending out emails. Lets say I list my domains on /etc/mysecondip and /etc/mythirdip. Lets say if the domain is on the /etc/mysecondip, send the mail thru my second IP; and if the domain is on the /etc/mythirdip, send the mail thru my third IP; and for all remaining mails, send them using my first ip. Can you please help me with this configuration?


would you mind updating us for this issue?
 
Last edited:

DaveT

Active Member
Aug 20, 2004
29
0
151
No longer works under cPanel 11 exim

Changes will not be permanent, Here is what you need to do:

In WHM on Exim Configuration Editor, rewrite two routers, There is an edit box bellow "ROUTERS CONFIGURATION", Box is before "lookuphost" router, Put these lines to that box:


(7th box from top in exim configuration)



Then move down to "TRANSPORTS CONFIGURATION", On edit box there (just up the remote_smtp transporter) put these lines:

(12th box from top in exim configuration)


This will be permanent and will not change by CPanel updates.


Good Luck
F.Malekpour
Dayana Networks Ltd.
Hi,

It appears that the re-written routers are ignored since updating to cPanel 11. Everything gets sent using remote_smtp instead of my_remote_smtp even though the routers are identical (apart from the name) and the my_remote_smtp router in earlier in the exim config file.

Has anyone got a solution to this which won't get overwritten by every cPanel / exim update?

Thanks,
Dave.