[exim] best practice on checking local virtual users before …

Startseite
Nachricht löschen
Nachricht beantworten
Autor: Emilio Augusto Lazo Zaia
Datum:  
To: exim-users
Betreff: [exim] best practice on checking local virtual users before delivering (dsearch /srv/vmail or mysql lookup)
Hello people,

I'm using exim 4.96 from Debian bookworm.

I have some questions regarding verifying local virtual users before deliverying messages.

This is my local_user router:

local_user:
 debug_print = "R: local_user for $local_part@$domain"
 driver = accept
 domains = +local_domains
# check_local_user
 local_parts = ! root
 condition = ${lookup{$local_part@$domain}dsearch{/srv/vmail}}
 transport = dovecot_lda
 cannot_route_message = Unknown user

I did comment check_local_user because there are no system users, only virtual users defined in a mysql database, used in conjunction with dovecot to authenticate. The 'condition' directive will check the existence of a directory in /srv/vmail whose name is the email address and that's the Maildir base directory. If this directory exists, the email account exists. It does the job but I would like to be sure if this rule is OK.

- It is a good idea checking sender this way?

- Would be better checking in a file with lsearch? i.e. /etc/exim4/email_addresses which contains all virtual users email addresses?

- What about checking a MySQL table the existence of virtual users? Such table exists because is the table used by the dovecot authenticator. How can this check be coded?

- When the text 'Unknown user' on directive 'cannot_route_message' is sent on SMTP session? when the check fails, the messages are550-Verification failed for <...> 550-Unrouteable address 550 Sender verification failed".

I'm using the following transport:

dovecot_lda:
 driver = lmtp
 socket = /var/run/dovecot/lmtp
 delivery_date_add
 envelope_to_add
 return_path_add
 user = vmail
 group = vmail

Thanks in advance for any help

Emilio

--
Emilio Augusto Lazo Zaia

--
## subscription configuration (requires account):
## https://lists.exim.org/mailman3/postorius/lists/exim-users.lists.exim.org/
## unsubscribe (doesn't require an account):
## exim-users-unsubscribe@???
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/