Solved Missing (but working) option and undocumented option in exim.conf file

Richard G

Verified User
Joined
Jul 6, 2008
Messages
14,304
Location
Maastricht
So with a DA collegue @AlexanderNL we were adjusting some files being the exim.strings.conf.custom file to add RBL's and the exim.variables.conf.custom file and then he discovered something.

In the exim.conf there is no exim.variables.conf.custom file mentioned.
One would expect to see a line like this:
.include_if_exists /etc/exim.strings.conf.custom but then for variables file so like like
.include_if_exists /etc/exim.variables.conf.custom but that does not exist, meaning the exim.variables.conf.custom file (documented in the docs) is not called at all, which is a bug.

So I did a search to see if it was maybe mentioned anywhere else in the exim.conf file, but it was not.
However I did find an undocumented option:
.include_if_exists /etc/exim.variables.conf.post
but this file is not documented. So either this should be the exim.variables.conf.custom which one would expect below the exim.strings.conf.custom or it's a totally different option, but then not described in the docs.

1.) Please fix the first
2.) What is the conf.post file for, or was this a typo and should this .post have been the .custom?
 
I believe /etc/exim.variables.conf is rebuilt with every /usr/local/directadmin/custombuild/build exim_conf by evaluating /etc/exim.variables.conf.default and /etc/exim.variables.conf.custom

That's why you're told to make modifications in /etc/exim.variables.conf.custom.

If a customization for a directive is found in /etc/exim.variables.conf.custom then it is used in the rebuilding of /etc/exim.variables.conf. Otherwise the directive value from /etc/exim.variables.conf.default is used.

I could be wrong though.
 
I could be wrong though.
Yep, you're wrong unfortunately, because I'm using the exim.variables.conf.custom already for some years so also did some exim.conf builds and still not mentioned in exim.conf.
It should be there by default just as the exim.strings.conf.custom is mentioned and (probably wrongly typed) the exim.variables.conf.POST which imho should not read .post but .custom.
 
Well...

I mean... consider the AUTH_BLOCK_SENDER_SPOOFING added in DirectAdmin 1.680.

Remove or insure that no AUTH_BLOCK_SENDER_SPOOFING is mentioned in /etc/exim.variables.conf.custom and then run an exim_conf rebuild.

Check the /etc/exim.variables.conf file.

Is AUTH_BLOCK_SENDER_SPOOFING in the file? Yes.

What is it's value? AUTH_BLOCK_SENDER_SPOOFING = yes

Now add s value? AUTH_BLOCK_SENDER_SPOOFING = no to /etc/exim.variables.conf.custom and run an exim_conf rebuild.

Check the /etc/exim.variables.conf file.

Is AUTH_BLOCK_SENDER_SPOOFING in the file? Yes.

What is it's value? AUTH_BLOCK_SENDER_SPOOFING = no

This proves that /etc/exim.variables.conf is rebuilt with each exim_conf rebuild.

Note that these are more verbose instructions from the DirectAdmin 1.680 changelog - https://docs.directadmin.com/changelog/version-1.680.html#sender-address-spoofing-protection

/etc/exim.variables.conf.custom has been around in DirectAdmin for years! If it were being ignored, it would have been discovered a long time ago.

What may be confusing you... you can't just add any directives to /etc/exim.variables.conf.custom and have them applied to the /etc/exim.conf file. That's what the /etc/exim.variables.conf.post file is for.

/etc/exim.variables.conf.custom is only for customizing variables that are in the /etc/exim.variables.conf.default file.
 
This proves that /etc/exim.variables.conf is rebuilt with each exim_conf rebuild.
You got a good point there indeed. I stand corrected because indeed your example works. I will adjust the title accordingly.

If it were being ignored, it would have been discovered a long time ago.
Correct, but exim.conf changes regularly and we already discovered an issue a couple of years ago only, which caused something not to work becasue of a wrong order of being present in the exim.conf. So it could have been changed later on.

But then still why is it working? That is puzzlingl me. It must be "seen" or loaded (defined) in some way that Exim sees the file?

So it might work indeed as you say, but that still doesn't take away my confusion on it.

1.) If the line .include_if_exists /etc/exim.variables.conf.custom is not required to be in the /etc/exim.conf file, then why -is- the .include_if_exists /etc/exim.strings.conf.custom in there by default? One would expect that this works the same way. So how does Exim knows the exim.variables.conf.custom is to be used if existed, if that is not defined anywhere? That is troubling me at the moment.

2.) Question 2 remains. What is the .include_if_exists /etc/exim.variables.conf.post for and why is this not documented in the documentation?
Can one put other things in there which will be added to the exim.conf or something like that? Do you have an example for it?
And ofcourse, this seems an important function then too. I did a search in the docs and could not find anything with "variables.conf.post" in there. So why is this function not documented and/or where did you found what it was for?
 
P.s. sorry that I doubted you before. I was too focussed on the fact that it was not defined in exim.conf while the strings.conf.custom was.
 
/etc/exim.variables.conf.custom isn't included in the /etc/exim.conf file because it is used by build_exim to build the /etc/exim.variables.conf file, which is included in the /etc/exim.conf file.

I suppose /etc/exim.strings.conf.custom is listed in the /etc/exim.conf file because it can be used for customization.

I would imagine that DirectAdmin is wanting you to make modifications only to .custom files for exim, which are then either .include_if_exists'd into the /etc/exim.conf or rebuilt into other included files with an build_exim rebuild.

I wouldn't get too caught up in all .custom files having to be included in /etc/exim.conf. /etc/exim.variables.conf.custom is probably a special case in that regard. The purpose still holds true... you edit the /etc/exim.variables.conf.custom file and not the /etc/exim.variables.conf file. Dollars to donuts, the directives listed in /etc/exim.variables.conf.default are required for Exim, but just because DirectAdmin has chosen a default value, doesn't mean that certain server administrators don't want to change those values. And including the changed values in /etc/exim.variables.conf.post is ambigious. So this method insures that all of the directives in /etc/exim.variables.conf.default are made to Exim, but with the ability to be customized.

(Required for Exim is probably wrong... Required for DirectAdmin's Exim is probably a better statement)

/etc/exim.variables.conf.post would be for defining any variables that is not already defined in /etc/exim.variables.conf.default (and thus modified by /etc/exim.variables.conf.custom). As to why there is missing documentation... if you go down that road you're going to find A LOT of missing stuff. There's a lot of things about DirectAdmin that aren't documented. The documentation has definitely gotten better, but it's missing some things.

Still in regards to this, it's a simple enough action to find .include or .include_if_exists in /etc/exim.conf that point to files that customizations can be made. It's easy enough to find /etc/exim.variables.conf.post in /etc/exim.conf and see where it is being included to know what it's doing.
 
The user @sparek already explained the things, and I'm fully agree. One thing though I'd like to add.

The file /etc/exim.variables.conf.post gets included before ACL section in exim.conf is just to give administrators a chance to use their own variables, not defined in other files. The custom variables can be later used in ACL's.
 
It's easy enough to find /etc/exim.variables.conf.post in /etc/exim.conf and see where it is being included to know what it's doing.
Correct. But this explanation is exactly what confused me. I know files which are to be used, must be defined somewhere.
And I know the exim.variables.conf.custom is working if created and something is added, but I can't find it being defined anywhere.

Am I correct then that the exim.variables.conf.custom file is defined in the "build" binary?

The user @sparek already explained the things, and I'm fully agree.
Me too, it's just that a file needs to be defined somewhere for it to be used. So since the exim.strings.conf.custom and exim.variables.conf.post are both defined in exim.conf one would expect the eximvariables.conf.custom to be defined there too (as the default files are also defined in there). The exim.variables.conf.custom file is the only one not defined in there, so where is it defined?
But if I understand correctly now then it must be defined in the build binary?
 
One thing I just discovered, though I use it since ages. It makes the existence of /etc/exim.variables.conf.post unnecessary.

It turned out custom variables added in the file /etc/exim.variables.conf.custom get added in /etc/exim.variables.conf too, even if they do not exist in /etc/exim.variables.conf.default.

The only difference is the following: if you modify /etc/exim.variables.conf.custom you will need to run da build exim_conf, but if you modify /etc/exim.variables.conf.post you will need to restart exim only (if it is required at all?)

Nice)
 
though I use it since ages.
Thank you for the addition. One can indeed wonder if a restart is required as just like with the exim.strings.conf.custom also the exim.variables.conf.post is in the exim.conf already.

Just out of curiosity, what do you have in that custom .post file?
 
Just out of curiosity, what do you have in that custom .post file?

I do not use exim.variables.conf.post. It does not exist on my system. Just figured out I don't need the file exim.variables.conf.post for my own. And I doubt I've ever used it for customers of mine.

My first impression was that we can use the file exim.variables.conf.post for custom variables. But it turned out custom variables can be added in exim.variables.conf.custom as well. You can even specify the following line in exim.variables.conf.custom:

Code:
hostlist block_hosts = /etc/virtual/custom_blocked_hosts.txt

or even multiple lines:

Code:
ANY_CUSTOM_VARIABLE=\
             so_line_1_goes_here \
             so_line_2_goes_here \
             so_line_3_goes_here

and they will work. DirectAdmin will add them in exim.variables.conf

Thus the file exim.variables.conf.post can be used for something more complex. But nothing comes to my mind yet) So do we really need exim.variables.conf.post? I don't know)
 
It does not exist on my system.
Ah oke I thought you did as you said
though I use it since ages
but probably you were pointing to the variables.custom.conf othen.

Oh we can use the hostlist blocklist like that in there too? With the space between hostlist and block_hosts and no double == in there?
Nice! On the other hand, wouldn't that be the same as the /etc/virtual/blacklist_senders file which also has hosts?
 
but probably you were pointing to the variables.custom.conf othen.

Yes, I were. Thanks for clarification.


With the space between hostlist and block_hosts and no double == in there?

That's just a random named variable, not used in Exim. Specified only just as an example)

Bash:
[root@dev roundcube]# grep block_hosts  /etc/*exim*
grep: /etc/exim.blockcracking: Is a directory
grep: /etc/exim.jail: Is a directory
[root@dev roundcube]#
 
Back
Top