exim.variables.conf.custom not working

zmippie

Verified User
Joined
Apr 19, 2015
Messages
161
I upgraded to the SpamBlocker configuration per: https://help.directadmin.com/item.php?id=576

But I need some customized values for these variables in Exim:

Code:
#EDIT#23:
tls_certificate = /etc/exim.cert
tls_privatekey = /etc/exim.key
openssl_options = +no_sslv2 +no_sslv3
tls_require_ciphers = ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM:-LOW:-SSLv2:-EXP
tls_advertise_hosts = *
auth_over_tls_hosts = *

So I did as the tech note says:

Custom variables (changes to the exim behavior/functionality) should be added to:
Code:
/etc/exim.variables.conf.custom

But after that, the tech note says:

They can be values that already exist in /etc/exim.variables.conf.default, or extra variables from the top section of the /etc/exim.conf.

So what is the top section of the /etc/exim.conf? Because if I add my own tls-related variables to exim.variables.conf.custom and issue a ./build exim_conf, the resulting exim.conf will fail:

Exim configuration error in line 185 of /etc/exim.conf: "tls_certificate" option set for the second time

So this is clearly not working. As a quick fix, I commented the default lines in exim.conf out, but that cannot be the correct solution. So, what am I missing?
 
Hello,

Run this:

Code:
[COLOR=#000000][FONT=&quot]cd /usr/local/directadmin/custombuild[/FONT][/COLOR]
[COLOR=#000000][FONT=&quot]./build update[/FONT][/COLOR]
[COLOR=#000000][FONT=&quot]./build set eximconf yes[/FONT][/COLOR]
[COLOR=#000000][FONT=&quot]./build set eximconf_release 4.5[/FONT][/COLOR]
[COLOR=#000000][FONT=&quot]./build update[/FONT][/COLOR]
[COLOR=#000000][FONT=&quot]./build exim_conf
[/FONT][/COLOR]
 
Run this:

Thanks Alex, but it didn't make a difference:

Starting exim: 2016-11-06 14:40:50 Exim configuration error in line 29 of /etc/exim.variables.conf:
"tls_certificate" option set for the second time

But upon closer inspection, things are indeed better now: most of the variables in my custom variables are no longer present in exim.conf. But somehow, they are now duplicated into exim.variables.conf. If I understand it correctly, exim.variables.conf is generated from exim.variables.conf.default and exim.variables.conf.custom. And it should not put duplicate entries into exim.variables.conf. But it seems to fail at that: I see a number of settings duplicated into exim.variables.conf, and I even see tls_advertise_hosts, which is in my custom variables file, still in exim.conf. My guess is that exim is going to fail on that one too, once I resolve the other issues.

So, am I not understanding this feature, or is it not working right?
 
In general you can re-define any variable found in exim.variables.conf by adding them into exim.variables.conf.custom with your own value.

Try and remove white-spaces in both sides of = (left and right). So it would be (for example):

Code:
tls_advertise_hosts=*

but not

Code:
tls_advertise_hosts = *

 
In general you can re-define any variable found in exim.variables.conf by adding them into exim.variables.conf.custom with your own value.

Okay, but I think you meant exim.variables.conf.default.

Try and remove white-spaces in both sides of = (left and right). So it would be (for example):

Code:
tls_advertise_hosts=*

but not

Code:
tls_advertise_hosts = *

That seems to work, thanks! Except for tls_advertise_hosts, because that's not a variable listed in exim.variables.conf.default. So this is maybe not a great example, but for my other variables: they indeed no longer get duplicated if I match the whitespace in exim.variables.conf.default.

To be honest, I'm not impressed by an implementation that breaks on whitespace. Especially since exim.conf isn't really consistent with whitespace. The default line in exim.conf for tls_advertise_hosts is:

Code:
tls_advertise_hosts = *

So, the default has extra whitespace around the assignment operator. But because tls_advertise_hosts is not in exim.variables.conf.default, there's no way to override it properly. Is this an oversight?

Time to log a bug for the whitespace issue and the inability to override tls_advertise_hosts?
 
2) Custom variables (changes to the exim behavior/functionality) should be added to:

Code:
/etc/exim.variables.conf.custom


They can be values that already exist in /etc/exim.variables.conf.default, or extra variables from the top section of the /etc/exim.conf. Once you've set your exim.variables.conf.custom, they need to be merged into /etc/exim.variables.conf, which CB2.0 can do for you, but using:

Code:
./build exim_conf


We used the merge method because exim does not allow a variable to be set twice (== does not work), and also because we may want to add more default variables in the future, but still allow you to override the values you want.

It's important to use the correct method of customizing the data, so that your changes remain when the exim.conf rewrite happens.


https://help.directadmin.com/item.php?id=576
 
I read the KB article Alex, it's what I was quoting from in my initial message. As still unanswered: what are the extra variables from the top section of the /etc/exim.conf. Because tls_advertise_hosts clearly isn't one. I'll log a bug.
 
The abstract from the help article was posted here to address your statement:

Okay, but I think you meant exim.variables.conf.default.

So in short way probably I should say, no, it is still /etc/exim.variables.conf.custom which should be modified if you want exim to use your values. And as a proof please read the article (link from your and mine posts) Instead of this I just posted those words. ;)

As for tls_advertise_host it's missing in exim.variables.conf.default. Since that you can not re-define it in /etc/exim.variables.conf.custom.

Code:
# grep tls_advertise_hosts exim.*conf
exim.conf:tls_advertise_hosts = *

So if you want it to be customize-able, please consider either maintaining of your custom version of exim.conf or bring this to Directadmin developers as a feature request via tickets.
 
Thanks Alex, I created a ticket. And thanks for pointing me to the whitespace issue that caused the duplicate entries. I added that to the ticket as well, because I think the way it works is broken/inconsistent.
 
For anyone reading this thread from 2018 onwards: things work differently now (DA 1.52). I'm not sure when the changes were made, but any variable in exim.variables.conf.custom seems to end up in exim.variables.conf. So, not only the variables in exim.variables.conf.default, as I think was the case earlier. Much better now.
 
Back
Top