How to deliver an email to a large number of local users directly via doveadm

618 views Asked by At

How to send an email to a large number of local users(about 100K)? Our mail server uses postfix and dovecot. It takes too long to send the email through SMTP. Is there any solution to deliver the email to all local user mailboxes directly? dovecot uses LMTP to transfer local emails. the worst solution is that copy the email to all mailboxes via Linux file system. However, we would prefer to use some tools provided by dovecot like doveadm.

1

There are 1 answers

0
Kondybas On

You have to put message directly to the mailbox with dovecot-lda

#!/bin/sh

for user in `some_source_of_userlist.sh`
do 
   cat << EOT | /path/dovecot-lda -d $user
   From: [email protected]
   To: $user
   Subject: Psssst! Look here!
   Content-Type: text/plain; charset="UTF-8"

   I have a message for you...
EOT
done
####

This method is for local users only, both system and virtual, as far as dovecot-lda share the same config with dovecot. Further reading can be found here: http://wiki2.dovecot.org/LDA