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.

Sending emails fails with the error: failed to expand ACL string ${perl{get_env}{HOME}}

| 00:07:20 17.10.2017

Directadmin developers released BlockCracking 1.8 on October 9th and if you upgraded its version without upgrading /etc/exim.pl and /etc/exim.variables.conf you will most likely have an issue with sending emails. Here is a quick way on fix it.

cd /usr/local/directadmin/custombuild
./build update
./build exim_conf

Why is that so?

It's very important to update version of exim.pl to 23+ and /etc/exim.variables.conf to newer. With older version of exim.pl and exim.variables.conf sending emails from a server with Directadmin + BlockCracking will fail with the following error:

rejected by non-SMTP ACL: failed to expand ACL string "${perl{get_env}{HOME}}": \
Undefined subroutine &main::get_env called.

For example:

2017-10-12 22:45:02 1e2smL-0005WP-ME F=<mail@domain.com> rejected \
by non-SMTP ACL: failed to expand ACL string "${perl{get_env}{HOME}}": Undefined \
subroutine &main::get_env called.

You can find out which version you have with the following command:

grep '#VERSION=' /etc/exim.pl

it should give the following:

#VERSION=23

If you have an older version (with lower number) then you should upgrade it with commands shown above (at the beginning of the article).

Have custom exim.conf version?

If for any reason you can't upgrade exim configs due to a customization, then you can do a partial upgrade with the following commands:

wget -O /etc/exim.pl http://files.directadmin.com/services/exim.pl.23
chmod 755 /etc/exim.pl
perl -pi -e 's/keep_environment=.*/keep_environment=PWD:HOME/' /etc/exim.variables.conf.default
perl -pi -e 's/keep_environment=.*/keep_environment=PWD:HOME/' /etc/exim.variables.conf

Control the version of exim.pl as shown ealier, and run this command:

grep ^keep_environment= /etc/exim.variables.conf /etc/exim.variables.conf.default

Desirable output is as the following:

/etc/exim.variables.conf:keep_environment=PWD:HOME
/etc/exim.variables.conf.default:keep_environment=PWD:HOME

Restart exim:

service exim restart

That's it.

More information:

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