Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I want to be able to access the recipient email address (or local part, it does not matter which) during ACL as a variable (for instance, I want to be able to use "$local_part")

The documentation seems to imply that the variable $local_part is available during acl, however it is not for me.

Inside the data ACL, as well as the rcpt

warn condition = true
     log_message = A

warn condition = true
     log_message = $local_part

warn condition = true
     log_message = B

produces these log lines

2011-03-31 16:12:00 1Q5ODo-0000iy-9q H=.net (.com) [.150] Warning: A
2011-03-31 16:12:00 1Q5ODo-0000iy-9q H=.net (.com) [.150] Warning: B
2011-03-31 16:12:00 1Q5ODo-0000iy-9q <= no@.com H=.net (.com) [.150] P=esmtp S=679 id=4b3c3206d41afeed@.com from <no@.com> for dude@.com
2011-03-31 16:12:01 1Q5ODo-0000iy-9q => dude@.com R=dnslookup T=remote_smtp H=aspmx.l.google.com [.27] C="250 2.0.0 OK"
2011-03-31 16:12:01 1Q5ODo-0000iy-9q Completed

There should have been an additional log line "Warning: dude" but there is not.

Anyone know why this may be happening?

share|improve this question

1 Answer 1

Since the data ACL is run once for the whole message and a message can have more than one recipient, the recipient information is not available at all in that context. Use the RCPT ACL if you need the recipient information.

From section 42.14 in Exim documentation:

When a MAIL or RCPT ACL, or either of the DATA ACLs, is running, the variables that contain information about the host and the message’s sender (for example, $sender_host_address and $sender_address) are set, and can be used in ACL statements. In the case of RCPT (but not MAIL or DATA), $domain and $local_part are set from the argument address.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.