possible error in example "configure" (exim.conf) file shipped in master ?

52 views
Skip to first unread message

Matt Darcy

unread,
Jul 24, 2016, 7:42:33 AM7/24/16
to vexim
progressing my test install - got lots of notes for EL based linux distros, hitting a problem with the modified example configure file that's used as a template for exim.conf.

This section of the file has not been modified at all.

the section in question is

virtual_domains:
  driver = redirect
  domains = +local_domains
  address_data = ${lookup mysql{\
        select smtp, users.sa_tag*10 AS sa_tag, users.on_spamassassin AND domains.spamassassin AS on_spamassassin, \
        users.uid AS uid, users.gid AS gid, quota \
        from users,domains \
        where localpart = '${quote_mysql:$local_part}' \
                and domain = '${quote_mysql:$domain}' \
                and domains.enabled = '1' \
                and users.enabled = '1' \
                and users.domain_id = domains.domain_id}{$value}fail}
  allow_fail
  data = ${extract{smtp}{$address_data}}
  headers_add = ${if and { \
                    {>{$spam_score_int}{${extract{sa_tag}{$address_data}}}} \
                    {eq{1}{${extract{on_spamassassin}{$address_data}}}} \
                    } {X-Spam-Flag: YES\n}{} }
  # Whether to use old or new headers_remove behavior.
  .ifndef OLD_HEADERS_REMOVE
    headers_remove = ${if or { { <{$spam_score_int}{1} } \
                              { and {{<{$spam_score_int}{${extract{sa_tag}{$address_data}}} } \
                                     {eq {1}{${extract{on_spamassassin}{$address_data}}}} \
                                    } \
                              } { eq {0}{${extract{on_spamassassin}{$address_data}}}} \
                            }  {X-Spam-Score}}
    headers_remove = ${if or { { <{$spam_score_int}{1} } \
                              { and {{<{$spam_score_int}{${extract{sa_tag}{$address_data}}} } \
                                     {eq {1}{${extract{on_spamassassin}{$address_data}}}} \
                                    } \
                              } { eq {0}{${extract{on_spamassassin}{$address_data}}}} \
                            }  {X-Spam-Report}}
  .else
    headers_remove = ${if or { { <{$spam_score_int}{1} } \
                              { and {{<{$spam_score_int}{${extract{sa_tag}{$address_data}}} } \
                                     {eq {1}{${extract{on_spamassassin}{$address_data}}}} \
                                    } \
                              } { eq {0}{${extract{on_spamassassin}{$address_data}}}} \
                            }  {X-Spam-Score:X-Spam-Report}}
  .endif
  # using local_part_suffixes enables possibility to use user-"something" localparts
  # which could cause you trouble if you're creating email-adresses with dashes in between.
  .ifdef VEXIM_LOCALPART_SUFFIX
    local_part_suffix = VEXIM_LOCALPART_SUFFIX
    local_part_suffix_optional
  .endif
  retry_use_local_part
  file_transport = virtual_delivery
  reply_transport = address_reply
  pipe_transport = address_pipe




so this looks as far as I can see (I diff'd it against the configure file and got no differences as a code block).

When I create a new local domain, exim errors


2016-07-24 12:16:10 1bRHOE-0004tt-78 == postm...@test9.com R=virtual_domains defer (-1): virtual_domains router failed to expand "${if or { { <{$spam_score_int}{1} } { and {{<{$spam_score_int}{${extract{sa_tag}{$address_data}}} } {eq {1}{${extract{on_spamassassin}{$address_data}}}} } } { eq {0}{${extract{on_spamassassin}{$address_data}}}} }  {X-Spam-Score}}:${if or { { <{$spam_score_int}{1} } { and {{<{$spam_score_int}{${extract{sa_tag}{$address_data}}} } {eq {1}{${extract{on_spamassassin}{$address_data}}}} } } { eq {0}{${extract{on_spamassassin}{$address_data}}}} }  {X-Spam-Report}}": missing } at end of string inside "and{...}" condition inside "or{...}" condition


(I added test9.com just as a random test domain) - this looks like a syntax error. I'm not aware of anyway to "lint" the exim config, I ran exim -bv and it doesn't report any syntax errors in the config.

This could be something in my setup or it could be an error in the default example - I'm not %100 sure what this is doing beyond checking the spamassassin score and headers

Input welcome of course.

thanks,

Matt

Rimas Kudelis

unread,
Jul 24, 2016, 8:38:35 AM7/24/16
to vexim
Which Exim version do you have? There was a lot of energy spent
rewriting this headers_remove behavior to fit with a
backwards-incompatible change that Exim introduced. I'm surprised if it
still doesn't work on some Exim version. Have you tried uncommenting the
OLD_HEADERS_REMOVE macro at the top of the configuration file?

Rimas

Matt Darcy

unread,
Jul 24, 2016, 8:47:24 AM7/24/16
to vexim
I'll try uncommenting the line suggested, I'm running  Exim 4.84.2 from EPEL for Centos 7

Matt Darcy

unread,
Jul 24, 2016, 8:49:32 AM7/24/16
to vexim
With old headers uncommented I still get the error

2016-07-24 13:48:19 1bRIpP-0004zt-7j == postm...@test10.com R=virtual_domains defer (-1): virtual_domains router failed to expand "${if or { { <{$spam_score_int}{1} } { and {{<{$spam_score_int}{${extract{sa_tag}{$address_data}}} } {eq {1}{${extract{on_spamassassin}{$address_data}}}} } } { eq {0}{${extract{on_spamassassin}{$address_data}}}} }  {X-Spam-Score:X-Spam-Report}}": missing } at end of string inside "and{...}" condition inside "or{...}" condition

Rimas Kudelis

unread,
Jul 24, 2016, 8:53:23 AM7/24/16
to ve...@googlegroups.com
Hi,

2016-07-24 15:49, Matt Darcy wrote:
> With old headers uncommented I still get the error
>
> 2016-07-24 13:48:19 1bRIpP-0004zt-7j == postm...@test10.com
> R=virtual_domains defer (-1): virtual_domains router failed to expand
> "${if or { { <{$spam_score_int}{1} } { and
> {{<{$spam_score_int}{${extract{sa_tag}{$address_data}}} } {eq
> {1}{${extract{on_spamassassin}{$address_data}}}} } } { eq
> {0}{${extract{on_spamassassin}{$address_data}}}} }
> {X-Spam-Score:X-Spam-Report}}": missing } at end of string inside
> "and{...}" condition inside "or{...}" condition

OK, comment it out again, then please comment out the second
headers_remove statement in the .ifndef OLD_HEADERS_REMOVE block and see
if you get the error. Then uncomment it and comment out the first one
instead, and do the same. Do you get any errors when any one of these
statements is active, but not both?

Rimas

Udera Udera

unread,
Jul 24, 2016, 9:38:14 AM7/24/16
to Rimas Kudelis, vexim
We did most testing on debian-based systems who included the important patches. There were some fixes for headers_add/remove: https://github.com/Exim/exim/blob/master/doc/doc-txt/ChangeLog

The changelog for the EPEL-packages (I'm not really sure if this is the right place to look for) doesn't clearly state that they put this bugfixes in (perhaps the defuzzified patches?): http://koji.fedoraproject.org/koji/buildinfo?buildID=755543
Perhaps someone should report it to them...
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted

Matt Darcy

unread,
Jul 24, 2016, 1:27:47 PM7/24/16
to vexim
if you're deleting posts - could you at least explain why you are deleting legit responses to a thread please ?
Message has been deleted

Rimas Kudelis

unread,
Jul 24, 2016, 6:47:36 PM7/24/16
to vexim
Hi Matt,

OK, this doesn't make any sense. I indented all of these strings that
Exim was "unable to expand", and certainly, no curly braces are missing.
Perhaps Udera is right and CentOS haven't applied some of the patches?

This could be related to https://bugs.exim.org/show_bug.cgi?id=1533 .
According to Exim changelog (pointed to by Udera), this was finally
fixed only in v. 4.85. Perhaps the easiest workaround (especially if
Spamassassin is disabled anyway) is to comment out these headers_remove
statements altogether. And lobby CentOS Exim maintainers to fix this
issue on their side.

Rimas


2016-07-24 20:34, Matt Darcy wrote:
> Rimas,
>
> I'm really sorry to mail you directly, but I have little choice as
> someone is deleting posts every time I try to respond to you in the group.
>
> I was trying to respond to say that with code block one commented out
> I see
>
> 2016-07-24 15:56:25 1bRJjO-00051E-Te == postm...@test11.com
> R=virtual_domains defer (-1): virtual_domains router failed to expand
> "${if or { { <{$spam_score_int}{1} } { and
> {{<{$spam_score_int}{${extract{sa_tag}{$address_data}}} } {eq
> {1}{${extract{on_spamassassin}{$address_data}}}} } } { eq
> {0}{${extract{on_spamassassin}{$address_data}}}} } {X-Spam-Score}}":
> missing } at end of string inside "and{...}" condition inside
> "or{...}" condition
>
> and with code block 2 commented out
>
> 2016-07-24 16:50:03 1bRJnm-000525-Tq == postm...@test12.com
> R=virtual_domains defer (-1): virtual_domains router failed to expand
> "${if or { { <{$spam_score_int}{1} } { and
> {{<{$spam_score_int}{${extract{sa_tag}{$address_data}}} } {eq
> {1}{${extract{on_spamassassin}{$address_data}}}} } } { eq
> {0}{${extract{on_spamassassin}{$address_data}}}} } {X-Spam-Score}}":
> missing } at end of string inside "and{...}" condition inside
> "or{...}" condition
>
> the error messages look the same.
>
> The code block are the two statements before "else" statement.
>
> Really sorry for the direct mail but it's the only way I can see to
> get you the information.
>
> Matt


Matt Darcy

unread,
Jul 28, 2016, 8:15:13 AM7/28/16
to vexim
Hi Rimas,

ok - so that worked perfectly.

What I plan to do is (if you look at my documentation thread) is explain this limitation in the enterprise linux install guide (this sort of issue is one of the reasons I split out the files as I have done)

I'll update the EPEL exim package to be one that includes the changes made, test it - confirm it's working as expected and that was the problem, then submit that upstream to EPEL for review and accept. Once thats done I can then update the enterprise linux specific documentation to re-include this functionality.

thanks for your efforts on this.

Matt
Reply all
Reply to author
Forward
0 new messages