Testing a custom exim4.conf file for syntactical errors

Often you will come to a scenario when you want to hack the exim configurations and you end up generating a new exim4.conf file. The beauty of exim is that, you can even copy this file from another instance and make it run perfectly in your instance.
* To make sure that your exim4.conf file contains no syntactical and various other errors :

root@box:~# sudo exim -C </path/to/new/exim4.conf> 

For a syntactically perfect exim4.conf, you will receive a welcome message like:

root@box:~# exim -C /etc/exim4/exim4.conf
Exim is a Mail Transfer Agent. It is normally called by Mail User Agents,
not directly from a shell command line. Options and/or arguments control
what it does when called. For a list of options, see the Exim documentation.

and in the else case

root@box:/etc/exim4# exim -C exim4.conf
2014-09-20 03:36:10 Exim configuration error in line 6 of exim4.conf:
#error message here

Happy exim-hacking 🙂
Ref: http://www.exim.org/exim-html-current/doc/html/spec_html/ch-the_exim_run_time_configuration_file.htmle


Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s