Is it possible to verify the sender alias against the authenticated user, WITHOUT rewriting the From field? For example, given a (much simplified) alias file like:
email@example.com: firstname.lastname@example.org email@example.com: firstname.lastname@example.org email@example.com: firstname.lastname@example.org email@example.com: firstname.lastname@example.org email@example.com: firstname.lastname@example.org
I want an authenticated user1 to be able to send as a1,a2,a3 or email@example.com, but NOT firstname.lastname@example.org, and I only want an authenticated user2 to be able to send as email@example.com AND I want them to be able to use the aliases in the From: field of the emails they send (i.e. I don't want Exim to rewrite the From/Sender fields like for "control=submission").
Functionally, this would require Exim to reduce the sender alias to the final routable address, and then allow me access to that value in an acl to compare it against the authenticated user. I thought verify=sender would do that, but testing does not show that to be the case.
In my acl_check_rcpt I tried the following with no effect, as any authenticated user can still send as any valid alias or other local user, and the $sender_address is the alias and not the underlying real account:
accept authenticated = * verify = sender logwrite = authenticated user '$authenticated_id' sending as '$sender_address' which \ is '$sender_address_data' or '$address_data', if error: '$sender_verify_failure'
According to the Exim Documentation (Sec. 26), $sender_address_data should contain the result of the sender lookup after a verify=sender, but the logs show that variable as always empty:
authenticated user 'user1' sending as 'firstname.lastname@example.org' which is '' or '', if error: ''
(Note that control=submission has little effect on this except to rewrite the From/Sender headers.)
Am I just going about this wrong? Is there a way to verify that the authenticated user can validly sent the alias they're sending from?