[exim] $sender_address rewritten by SMTPAuth

Pàgina inicial
Delete this message
Reply to this message
Autor: Josh Berry
Data:  
A: Exim Users Mailing List
Assumpte: [exim] $sender_address rewritten by SMTPAuth
Hi there,

I am using Exim 4.54 on Solaris 10 X86 and have encountered a problem
with the $sender_address field, autoresponders and SMTP Auth

Basically, I have set up autoresponders using the autoreply router -
based on whether a user has a flag set in a database.

If the user has the autoresponder flag set then the router passes it
into the autoreply router which then sends out the autoresponder from
information in a database.

The problem is that the "to" field in the transport is returning the
message to $sender_address ... which should be the person who has sent
the mail. Unfortunately, the $sender_address value is being overwritten
by the username used for SMTP Auth (which is forced for all clients) and
may be different from the users mail address.

So, for example, a user sends a mail from josh@ to an address with an
autoresponder but is authenticating for SMTP with the username jberry ..
the autoresponder is send back to jberry@ rather than josh@

I have also tried using the $return_path variable with the same results

Weirdly enough, if I turn off SMTPAuth it works fine (as no alternative
username is being sent by the client).

So, has anyone come across this before and how can I retain the actual
from address of the customer to send the autoresponder to?

I have included the appropriate routers, transports and (just in case)
SMTP Auth ACL below.

Thanks,
--
| Josh Berry                        Broadband Solutions for
| Internal Systems Engineer               Home & Business @
| PlusNet plc                                  www.plus.net

+ ----- Plusnet - The smarter way to Broadband! ----- +


begin routers

# Route any mail to non-local domains via SMTP as long as the domain is
valid in DNS

not_local:
driver = dnslookup
domains = ! +local_domains
transport = remote_smtp
retry_use_local_part = true
ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8
no_more

autoresponder:
  driver        = accept
  condition     = ${lookup mysql {MYSQL_Q_CHK_AR}}
  no_verify
  no_expn
  transport     = autoresponder_delivery


# The autorespoder just returns 1 from the DB when an autoresponder is
set

begin transports

autoresponder_delivery:
  driver                = autoreply
  reply_to              = "${local_part}@${domain}"
  to                    = ${sender_address}
  from                  = "${extract{ArFrom}{${lookup mysql
{MYSQL_Q_GET_AR}}}{$value}{}}@$domain"
  subject               = ${extract{ArSubject}{${lookup mysql
{MYSQL_Q_GET_AR}}}{$value}{}}
  text                  = ${extract{ArText}{${lookup mysql
{MYSQL_Q_GET_AR}}}{$value}{}}
  log                   = /var/log/exim/autores
  once_repeat           = 12h


The SQL returns a from address, subject and the message body .. ignore
the log line, its for debugging.

And just in case, my SMTP auth ACL is:

# Accept mail from localhost

accept  hosts           = localhost


# Accept authenticated smtp connections from local domains

accept  hosts           = +auth_relay_hosts
        endpass
        authenticated   = *
        encrypted       = *
        control         = submission
        verify          = recipient


# Accept authenticated, enrypted connections to the MSA port

accept  condition       =  ${if ={$interface_port}{587}{1}{0}}
        endpass
        authenticated   = *
        encrypted       = *
        control         = submission