Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 (.com) [.150] Warning: A
2011-03-31 16:12:00 1Q5ODo-0000iy-9q (.com) [.150] Warning: B
2011-03-31 16:12:00 1Q5ODo-0000iy-9q <= (.com) [.150] P=esmtp S=679 from <> for
2011-03-31 16:12:01 1Q5ODo-0000iy-9q => R=dnslookup T=remote_smtp [.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

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .