%s flag should be very useful for this. See 

https://wiki.dovecot.org/Authentication/RestrictAccess

---
Aki Tuomi
Dovecot oy

-------- Original message --------
From: Alexander Dalloz <ad+lists@uni-x.org>
Date: 13/07/2018 17:50 (GMT+02:00)
To: dovecot@dovecot.org
Subject: Re: Whitelist file for LDAP authentication

Am 13.07.2018 um 10:30 schrieb whpang:
> Hi,
>
> The dovecot version is 2.2.33.2 and we are using LDAP to do the authentication for SMTP service.

[ ... ]

> Anyone can help to advice how to configure dovecot to have a whitelist for user LDAP authentication? Thank you very much.
>
> Best regards,
> William Pang
>
> Academic Computing and Technology Services Section
> Information and Communication Technology Office
> University of Macau
> Tel: 8822 8407

Define an LDAP attibute which stands for "being allowed to submit" and
set your LDAP filter accordingly.

Alexander