1

Topic: iRedMail 0.9.3 - How to scan maildirs for existing spam & delete?

==== Required information ====
- iRedMail version (check /etc/iredmail-release): 0.9.3
- Linux/BSD distribution name and version: CentOS 7.1
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MariaDB
- Web server (Apache or Nginx): Apache
====

Due to some rbl config issues many spam emails were delivered to several accounts on my iRedMail server.

Is there a way for an admin (me) using the command line (bash shell on iRedMail server) to run a job or command that will go down into the user mail directories and search for spam and delete those messages in a bulk manner?

Thanks

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: iRedMail 0.9.3 - How to scan maildirs for existing spam & delete?

Ideas:

*) You can get all users' maildir paths by query SQL db (vmail.mailbox).
*) You can scan with 'sa-learn --spam /path/to/spam/folder'.
*) You can delete messages in spam folder with 'doveadm mailbox' command. FYI: http://wiki2.dovecot.org/Tools/Doveadm/Mailbox

3

Re: iRedMail 0.9.3 - How to scan maildirs for existing spam & delete?

There seems to be a step missing. How do the email messages in the user's inbox directory get tagged as spam and moved to the spam folder for deletion?

The spam filtering was down so there are several hundred horrible spam messages in each users inbox folder. I want to know how to scan the inbox folder, tag messages that are spam and then move them from inbox to spam. Then I can delete the spam folder contents as you described.

4

Re: iRedMail 0.9.3 - How to scan maildirs for existing spam & delete?

Oops, i misunderstood your first post.

You can try to use "spamc -c < /path/to/message".