[Exim] Problem with Subject expansion in autoresponder

Top Page
Delete this message
Reply to this message
Author: Matt Zito
Date:  
To: 'exim-users@exim.org'
Subject: [Exim] Problem with Subject expansion in autoresponder
Hello,

We're running exim version 3.16, backended by a mysql database. A feature
request was made for the ability to have an autoresponder reply message have
a subject of: "out-of-office: " followed by the original subject. So, we
modified our vacation transport to read:

virtvacation:
driver = autoreply
subject = ${expand: ${lookup mysql {VIRTSUBJECT}{$value}}}
text = ${expand: ${lookup mysql {VIRTBODY}{$value}}}
user = 2000
group = 2000
once = /usr/mail/messages/$domain/$local_part.vacation.dbm
once_repeat = 4d
to = $sender_address
from = "$local_part@$domain"

Which worked, except that in messages with extremely long subject lines, the
user's mua would insert a newline into the subject, which would result in a
message with the error:

--------
This message was created automatically by mail delivery software.

A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es) failed:

  adam@???:
    Expansion of "${expand:
    ${lookup mysql {select subject from mailrouting where
local_part='${quote_mysql:$local_part}' and
domain='${quote_mysql:$domain}'}{$value}}}" in virtvacation transport
contains non-printing character 10
---------


So, we modified the "subject" directive to read:

subject = ${expand: ${escape: ${lookup mysql {VIRTSUBJECT}{$value}}}}

Hoping that that would cause the newline character to be escaped. That did
not fix the problem, and it became obvious why when we realized we were
actually escaping the response from the mysql server, which has no newlines
in it. We also tried ${escape 'ing the $value key, but it seems to have no
effect. Is there a workaround for this? Are we doing something wrong? Any
help would be greatly appreciated.

Thanks much,
Matt

--
Matthew J. Zito
Systems Engineer
Register.com, Inc., 11th Floor, 575 8th Avenue, New York, NY 10018
Ph: 212-798-9205
PGP Key Fingerprint: 4E AC E1 0B BE DD 7D BC D2 06 B2 B0 BF 55 68 99