Auteur: Luca Bertoncello Date: À: exim-users Sujet: [exim] Problem with string expansion
Hi list!
I'm configuring a Mailserver with Exim 4.86.2 (compiled from source).
I use the configuration file from another Mailserver (with Exim 4.75) as
template and I have a problem in the router:
localWrite_gw:
driver = redirect
allow_filter
domains = +local_domains
user = EXIM_UID
group = EXIM_GID
data = ${lookup mysql {select concat('# EXIM Filter\n\n', replace(concat(concat(case hasAutoresponder when 'f' then '' else replace(replace('if not error_message and \$message_headers does not contain "\\\\nX-SPAM:" and \$message_headers does not contain "\\\\nX-Infected:" then if personal then mail text "%%TEXT%%" from "$local_part@$domain" subject "%%SUBJ%%" extra_headers "MIME-Version: 1.0\\\\nContent-Type: text/plain; charset=ISO-8859-15" endif endif', '%%SUBJ%%', autoresponderSubject), '%%TEXT%%', autoresponderText) end, '\n\n'), case when filters is not null then concat(filters, "\n", dataHam) else dataHam end), '%%FINALDEST%%', finaldest)) from aliases left join account using (accountname) left join domain using (domainname) where lower(aliasname) = lower('${quote_mysql:$local_part}') and lower(domainname) = lower('$domain')}}
redirect_router = loopbackRouter
reply_transport = autoresponder
pipe_transport = address_pipe
file_transport = address_file
directory_transport = address_file
headers_remove = ${if def:h_X-DefSubject:{Subject}}:X-DefSubject:
headers_add = ${if def:h_X-DefSubject: {Subject: $h_X-DefSubject:}}
no_more
If I try exim -bt I always get the error:
lucabert@??? cannot be resolved at this time:
localWrite_gw router failed to expand remove_headers item "NULL": ":"
expected after "def"
The problem is at the line with headers_remove, I suppose, then if I remove
this line it works...
But I cannot find the problem...
Can someone help me? X-DefSubject will be defined in a ACL if a Spam-E-Mail
was received and the Subject has to be changed.