I need to make an Dovecot IMAP email account receive-only so that the users can browse, move, delete existing emails but without being able to send email from that account.
Sending is done via exim accepting SMTP connections from MUAs. It uses Dovecot as an authenticator like so:
dovecot_plain:
driver = dovecot
public_name = PLAIN
server_socket = /var/run/dovecot/auth-client
server_set_id = $auth1
How can I do something like:
unless_login_name_is = notallowed1@mydomain.com : notallowed2@mydomain.com
Edit: here's what is not working...
acl_smtp_mailauth = acl_check_mailauth
...
acl_check_mailauth:
deny condition = ${if eq{$authenticated_sender}{banned.user@example.com} {yes}{no}}
I thought it might be the condition that's wrong, but doing this:
acl_check_mailauth:
deny
also has no effect. I've read the manual but didn't find it helped me understand what's going on.
Edit 2: trying acl_smtp_auth
As suggested by @wurtel, I tried using this ACL instead. However I am now stuck with another problem: the AUTH comes in PLAIN form which looks like
PLAIN <base64encodedvalue>
To get to the username, I need to decode it, however ${base64d:${sg{$smtp_command_argument}{^PLAIN }{}}}
retuns an empty string.
I think this is because the <base64encodedvalue>
when decoded starts with a NUL byte!