Qmail. Send email from Maildir\new folder

449 Views Asked by At

I have a bunch of emails within .../Maildir/new folder. How to send them via qmail?

Also maybe you can advise how to block all emails from specific domain? I've tried to block using control/badmailfrom file, but seems that it doesn't work

.*\ @.*
!.*@.*\..*
.*%.*
@domain.com

Thanks in advance, Nick

1

There are 1 best solutions below

0
Nick Sinyakov On

The answer how to send emails from /Maildir/new folder below:

Create a new script:

for file in /var/vpopmail/domains/.../username/Maildir/new/* ; do
qmail-inject -f [email protected] -a [email protected] <"$file"
done

And execute it: # bash script_name