Re: [exim] Tracking down regex errors

Etusivu
Poista viesti
Vastaa
Lähettäjä: Graeme Fowler
Päiväys:  
Vastaanottaja: exim-users
Aihe: Re: [exim] Tracking down regex errors
On Tue, 2013-04-23 at 20:43 -0700, Marc Perkel wrote:
> But - don't know where it is. It doesn't show any line numbers or even
> what acl it's in. Wondering how to track it down.


Hand-craft an SMTP dialogue and pass it through "exim -bh" thus:

----------------------------------------------------------------
[user@server $] exim -d+all-memory -bh 1.2.3.4 2>&1 | tee output
EHLO name
MAIL FROM:<sender>
RCPT TO:<recipient>
DATA
From: <sender>
To: <recipient>
Subject: regex test

Some body text goes here
Some more here
.
----------------------------------------------------------------

then page through the file "output" looking for the error. You can work
back from that line to see which ACL you're inside, and which query
you're running.

More generally, it's helpful to put some log message entries into your
config if it's got so big it's impossible to parse by eye, then you can
switch them on if necessary. A bit like this:

acl_smtp_data
  warn condition = ${if exists{/etc/exim/debug_my_acls}}
  log_message    = DEBUG: entering acl_smtp_data


  <your tests go here>
  warn condition = ${if exists{/etc/exim/debug_my_acls}}
  log_message    = DEBUG: leaving acl_smtp_data


next acl...

It might seem a little over-verbose having one at the head and tail of
every ACL (or you can put this into subsets on other lookups) but you
can then switch it on and off for a running daemon by simply doing:

touch /etc/exim/debug_my_acls
...run for a bit...
rm /etc/exim/debug_my_acls

then examine the logfiles.

Graeme