DirectAdmin Knowledge Base and Support

DirectAdmin is a web panel for a simple administration of both virtual and dedicated servers. DirectAdmin is faster, safe and more powerful than any other CP. And we know how to customize and support it.

How to patch exim.conf with DirectAdmin and custombuild

| 19:52:47 16.12.2022

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

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

+incoming_interface +outgoing_interface +incoming_port +outgoing_port

to make logging more verbose with these attributes.

Let's create a patch for it.

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

mkdir -p /usr/local/directadmin/custombuild/custom/hooks/exim_conf/post/
cd /usr/local/directadmin/custombuild/custom/hooks/exim_conf/post/
touch poralix_patch_exim_conf.sh
chmod 750 poralix_patch_exim_conf.sh
cat > poralix_patch_exim_conf.sh  <<EOF
#!/bin/bash
#----------------------------------------------------------------------
# Description: A script to patch exim.conf
#----------------------------------------------------------------------
# By Poralix // www.poralix.com

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;
EOF

After the command completes you should see a new file:

  • /usr/local/directadmin/custombuild/custom/hooks/exim_conf/post/poralix_patch_exim_conf.sh

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

In order to apply the patch run the following command as root:

/usr/local/directadmin/custombuild/build exim_conf

The exim.conf will be patched automatically every time you install it with custombuild.

That's it.
About Us
We are a team of professionals, and specialize in installation, configuring and managing of remote virtual and dedicated servers powered by Linux/Unix-like OS with DirectAdmin. We support various sets of software, including web-servers Apache, Nginx; internet domain name servers Bind, PowerDNS; mail-servers with POP3, IMAP and SMTP, FTP-servers, etc. After years of working through the most complex server challenges our team has gathered valuable experience and universal solutions suitable for everyday tasks. We are here to lend you a helping hand and take care of your servers in order to let you have enough time to do more of what you love.




All of the information and data on this site is for informational purposes only and is provided for the convenience of the user.
Powered by: Amiro.CMS - Free edition