Echelon17

Well-Known Member
May 21, 2006
73
0
156
We're using an external SMTP server to send mail via cPanel and have this setup and working perfectly. The problem is we need to make a small change to the exim.conf file and add the following line to the virtual_aliases_nostar section:

headers_add = "X-MC-Forward: [email protected]$original_domain\n"

The problem with this, of course, is that every time Exim gets updated or rebuilt this change is lost and we have to add it again manually.

I see that cPanel makes use of the exim.conf.local file to save settings which can be imported again during rebuild, however I'm not sure how (or even if) the above line can be added to this file to be incorporated on each rebuild.

There is a "PREVALIASNOSTAR" section but to me that seems to imply content you want added BEFORE this section, not a replacement or addition to this setting. Does anyone have any ideas that could help? Thanks in advance.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,227
463
Hello :)

If you prefer to use the "exim.conf.local" file, then you could simply add the entire "virtual_aliases_nostar" entry to this file, and then rebuild the Exim configuration via:

Code:
/scripts/buildeximconf
Thank you.
 

Echelon17

Well-Known Member
May 21, 2006
73
0
156
I'd suggest you use the WHM Exim Configuration Manager in advanced mode to make your changes, then save. This will automatically update the exim.conf.local file.
Thanks for your response (I love your site by the way, it's been very helpful over the years!). I guess my next question would be in which section would we add this code? None seem specific to this section of the exim.conf file.

- - - Updated - - -

I'd suggest you use the WHM Exim Configuration Manager in advanced mode to make your changes, then save. This will automatically update the exim.conf.local file.
Hello :)

If you prefer to use the "exim.conf.local" file, then you could simply add the entire "virtual_aliases_nostar" entry to this file, and then rebuild the Exim configuration via:

Code:
/scripts/rebuildeximconf
Thank you.
Thanks Michael. In which section (if any) would we add this to? I notice the file is split up into sub sections using @[email protected] references, so where would we put our virtual_aliases_nostar section?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,227
463
The file is empty by default, so you would simply enter the entire "virtual_aliases_nostar" entry as it appears in exim.conf (but with your custom changes) and then save the file.

Thank you.
 

Echelon17

Well-Known Member
May 21, 2006
73
0
156
Just to add to this, there doesn't appear to be a /scripts/rebuildeximconf.

- - - Updated - - -

OK, so I figured out you probably meant /scripts/buildeximconf instead of /scripts/rebuildeximconf. The problem is this isn't working for me and is now throwing up the following error:

Error message from syntax check:
2014-07-24 22:49:30 Exim configuration error in line 1697 of /etc/exim.conf.buildtest.work.LoMwWACWMailkLFf:
transport virtual_aliases_nostar: cannot find transport driver "redirect"

-= BEGIN exim.conf chunk -=
I'm trying to add the following code to the bottom of the exim.conf.local file:

virtual_aliases_nostar:
driver = redirect
allow_defer
allow_fail
require_files = "+/etc/valiases/$domain"
data = ${lookup{[email protected]$domain}lsearch{/etc/valiases/$domain}}
file_transport = address_file
headers_add = "X-MC-Forward: [email protected]$original_domain\n"
group = mail
retry_use_local_part
unseen
The bolded line above is the line I'm attempting to add to the default configuration.