of times it has been compiled. This serves to distinguish different
compilations of the same version of the program.
+.vitem &$config_dir$&
+.vindex "&$config_dir$&"
+The directory name of the main configuration file. That is, the content of
+&$config_file$& with the last component stripped. The value does not
+contain the trailing slash. If &$config_file$& does not contain a slash,
+&$config_dir$& is ".".
+
+.vitem &$config_file$&
+.vindex "&$config_file$&"
+The name of the main configuration file Exim is using.
+
.vitem &$demime_errorlevel$&
.vindex "&$demime_errorlevel$&"
This variable is available when Exim is compiled with
server certs used for TLS match the result of the MX lookup. It does
not use the same mechanism as DANE.
+ 4. New expansion items $config_file, $config_dir, containing the file
+ and directory name of the main configuration file.
+
Version 4.84
------------
{ "caller_uid", vtype_uid, &real_uid },
{ "compile_date", vtype_stringptr, &version_date },
{ "compile_number", vtype_stringptr, &version_cnumber },
+ { "config_dir", vtype_stringptr, &config_main_directory },
+ { "config_file", vtype_stringptr, &config_main_filename },
{ "csa_status", vtype_stringptr, &csa_status },
#ifdef EXPERIMENTAL_DCC
{ "dcc_header", vtype_stringptr, &dcc_header },
uschar *config_main_filelist = US CONFIGURE_FILE
"\0<-----------Space to patch configure_filename->";
uschar *config_main_filename = NULL;
+uschar *config_main_directory = NULL;
#ifdef CONFIGURE_OWNER
uid_t config_uid = CONFIGURE_OWNER;
extern int config_lineno; /* Line number */
extern uschar *config_main_filelist; /* List of possible config files */
extern uschar *config_main_filename; /* File name actually used */
+extern uschar *config_main_directory; /* Directory where the main config file was found */
#ifdef CONFIGURE_OWNER
extern uid_t config_uid; /* Additional owner */
#endif
if (config_file != NULL)
{
+ uschar *p;
config_filename = config_main_filename = string_copy(filename);
+
+ p = strrchr(filename, '/');
+ config_main_directory = p ? string_copyn(filename, p - filename)
+ : string_copy(".");
}
else
{
# Some fixed variables
exim_path: $exim_path
+config_dir: $config_dir
+config_file: $config_file
primary_hostname: $primary_hostname
primary_hostname: ${primary_hostname}
qualify_domain: $qualify_domain
> # Some fixed variables
>
> exim_path: TESTSUITE/eximdir/exim
+> config_dir: TESTSUITE
+> config_file: TESTSUITE/test-config
> primary_hostname: myhost.test.ex
> primary_hostname: myhost.test.ex
> qualify_domain: myhost.test.ex