Find specific mails and move them to different folder through shell

Find e-mails inside the inbox that are sent by info@domein.nl and move them to Sent items (Verzonden items in Dutch).

# Test first:
find '/var/vmail/domein.nl/info/Maildir/cur' -type f -exec grep -qiF 'From: "Project" <info@domein.nl>' {} \; -exec ls {} \;

# Should return matching files.

# Do real task:
find '/var/vmail/domein.nl/info/Maildir/cur' -type f -exec grep -qiF 'From: "Project" <info@domein.nl>' {} \; -exec mv {} '/var/vmail/domein.nl/info/Maildir/.Verzonden items/cur/' \;
Share on facebook
Share on twitter
Share on linkedin
Share on whatsapp