courier-imap
worked for me on Debian 10 with these simple steps after apt install gamin courier-mta courier-imap
as root:
Courier authenticates using PAM out of the box.
Maildir setup for future users:
sudo maildirmake /etc/skel/Maildir
sudo maildirmake /etc/skel/Maildir/.Drafts
sudo maildirmake /etc/skel/Maildir/.Sent
sudo maildirmake /etc/skel/Maildir/.Trash
sudo maildirmake /etc/skel/Maildir/.Templates
Then, for an existing user:
sudo cp -r /etc/skel/Maildir /home/myuser/
sudo chown -R myuser:usergroup /home/myuser/Maildir
sudo chmod -R 700 /home/myuser/Maildir
I only have to add allowed hosts for courier-mta
now, to send email. This guide should help.