Now Reading: How to patch exim.conf with DirectAdmin and custombuild


How to patch exim.conf with DirectAdmin and custombuild

February 9, 20242 min read

There are some parts in exim.conf that you may need to modify. And they cannot be changed in included files. DirectAdmin will rewrite your changes when updating Exim's configuration file. And here's how you can solve it.

Let's try and modify for an example log_selector In /etc/exim.conf, We are going to add the following features:

+incoming_interface +outgoing_interface +incoming_port +outgoing_port

To make logging more functional with these features.

Let's make a patch for this.

The following commands will create a hook for the custombuild, which will be automatically executed by the script. Run this once as root in the server's console:

mkdir -p /usr/local/directadmin/custombuild/custom/hooks/exim_conf/post/
cd /usr/local/directadmin/custombuild/custom/hooks/exim_conf/post/
chmod 750
cat >  <<EOF
# Description: A script to patch exim.conf
# By Poralix //

echo "Patching log_selector in /etc/exim.conf";
perl -pi -e 's/^log_selector = \\/log_selector = +incoming_interface +outgoing_interface +incoming_port +outgoing_port \\/' /etc/exim.conf;
service exim restart;

After the command completes you should see a new file:

  • /usr/local/directadmin/custombuild/custom/hooks/exim_conf/post/

This is a patch for exim.conf that will do what we need.

Run the following command as root to apply the patch:

/usr/local/directadmin/custombuild/build exim_conf

exim.conf will be automatically patched whenever you install it with custombuild.

That’s it.

How do you vote?

0 People voted this article. 0 Upvotes - 0 Downvotes.

What do you think?

Show comments / Leave a comment

Leave a reply

You may like