Error with an Exim ACL String

paisley

Verified User
Joined
Aug 17, 2013
Messages
63
Hi,

I have a CentOS VPS with Directadmin and Exim/Dovecot, for forwarders, i changed some headers with a file called, Exim.acl_check_recipient.pre.conf, but now I get this error:

failed to expand ACL string "${lookup{$local_part}lsearch{/etc/virtual/${domain}/aliases}{1}{0}}":

this is the line in the file:

condition = ${lookup{$local_part}lsearch{/etc/virtual/${domain}/aliases}{1}{0}}

Normally it worked but maybe because of a newer Exim version, can I maybe do another lookup or search to get the aliases?
 
Thanks to @zEitEr
The problems are since updating to Exim version 4.94 our higher, their changelog shows:
32 Some Transports now refuse to use tainted data in constructing their delivery
33 location; this WILL BREAK configurations which are not updated accordingly.
34 In particular: any Transport use of $local_part which has been relying upon
35 check_local_user far away in the Router to make it safe, should be updated to
36 replace $local_part with $local_part_data.

You can easily fix it by using the below scripts and change:

condition = ${lookup{$local_part}lsearch{/etc/virtual/${domain}/aliases}{1}{0}}

to:
condition = ${lookup{${local_part}@${domain}}lsearch{/etc/virtual/all_aliases}{1}{0}}


/etc/cron.d/directadmin_mail_aliases (CRON)
Code:
#
# Added by Poralix (www.poralix.com)
#
*/5 * * * * root /usr/local/directadmin/scripts/custom/poralix_list_all_aliases.sh


cat /usr/local/directadmin/scripts/custom/poralix_list_all_aliases.sh (custom script)
Code:
#!/bin/bash
#
# by Alex S Grebenschikov (Poralix // www.poralix.com)
#
ALIASES_FILE="/etc/virtual/all_aliases";
touch "${ALIASES_FILE}" "${ALIASES_FILE}.new";
chmod 600 "${ALIASES_FILE}" "${ALIASES_FILE}.new";
chown mail:mail "${ALIASES_FILE}" "${ALIASES_FILE}.new";
echo -n > "${ALIASES_FILE}.new";
for DOMAIN in $(cut -d: -f1 < /etc/virtual/domainowners | sort | uniq);
do
    test -s "/etc/virtual/${DOMAIN}/aliases" || continue;
    for LOCAL_PART in $(egrep -v "^\*" /etc/virtual/${DOMAIN}/aliases | grep \@ | cut -d: -f1);
    do
        echo ${LOCAL_PART}@${DOMAIN} >> "${ALIASES_FILE}.new";
    done;
done;
cat "${ALIASES_FILE}.new" | sort | uniq > "${ALIASES_FILE}";
rm -f "${ALIASES_FILE}.new";


It will create via cronjob a auto-updated (list) file:
  • /etc/virtual/all_aliases
 
Back
Top