Exim and Acl variable storage

Rick Cooper rcooper at DIMENSION-FLM.COM
Tue Oct 28 16:06:17 GMT 2003

Exim (as of 4.23) now stores acl variables  for use later in filters and
(set acl_c2 for example). This has caused MailScanner to barf big time on
-H files that contain acl data with newlines. An example of such a header:

root 0 0
<postmaster at senderdomain.com>
1067008350 0
-helo_name senderheloname.com
-host_address xxx.xx.xxx.xxx.33694
-host_name senderdomainhost.com
-interface_address yy.yy.yyy.yy.25
-received_protocol esmtp
-acl 2 14                        <- designate acl_c2 data len 14
xxx.xx.xxx.xxx                   <- data following newline can also contain
-body_linecount 7122

The relevant code from exim's spool_out.c :

/* Preserve any ACL variables that are set. Because the values may contain
newlines, we use an explicit length. */

for (i = 0; i < ACL_C_MAX + ACL_M_MAX; i++)
  if (acl_var[i] != NULL)
    fprintf(f, "-acl %d %d\n%s\n", i, Ustrlen(acl_var[i]), acl_var[i]);

It appears that MailScanner is having the trouble here:


  # Loop through -line section, setting metadata
  # items corresponding to Exim's names for them,
  # and tracking them in %{$metadata{dashvars}}
  while (chomp($line = <$RQf>)) {
    $line =~ s/^-(\w+) ?// or last;
    $metadata{dashvars}{$1} = 0;
    $line eq "" and $metadata{"dv_$1"} = 1, next;
    $metadata{"dv_$1"} = $line;
    $metadata{dashvars}{$1} = 1;

When MailScanner encounters the data that belongs to the -acl line above it,
MailScanner bails and issues an invalid queue file error. Since the "save
acl" code directly precedes the -body_linecount code I think the best way to
handle it would be to check $line, if it
eq -acl, then continue to read/parse data until the -body_linecount line is
encountered. I may take a crack at this problem my self, but frankly perl is
not my cup of tea... Perl is a write only language for me. Is this an issue
that the MailScanner author(s) are working on, or aware of?

 Rick Cooper

This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

More information about the MailScanner mailing list