• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

move marked spam mails to specific folder

I

itschemnitz

Guest
Hi,

I used google for a while to find a solution for moving mails marked as spam into an imap folder (ex. spam), but I found only script which will be executed by a cron entry.
I use Plesk 8 with courier-imap and qmail. Is there a possibility to move spam to a users folder with procmail or something else (and where can I find a how-to)?

Thanks, Nico
 
Does anyone have any links for a solution for this? I'm trying to accomplish the same thing.

Basically moving the marked spam assassin messages automatically to a generic spam/junk folder for the user.

I've done a search but can't see any exmaples :(
 
I would like to think it's a case of just setting up procmail rules for each mailbox but I'm having trouble finding the info...
 
I have this setup and running on my box using maildrop.

Simply install maildrop, setup a filter file like mine:

/etc/mail/mailfilter/

SHELL="/bin/sh"

import EXT
import HOST
import USER
import HOME
import LOCAL
import HOST
import SENDER
import DEFAULT

MAILDIRMAKE = "/usr/bin/maildirmake"
DEFAULT = "$HOME/Maildir"

logfile "/var/log/maildrop"

log "$USER $HOME $LOCAL $HOST $SENDER $DEFAULT"

if ((/^X-Spam-Status: Yes/) || (/^Subject:.*(*SPAM*|*[ ]SPAM[ ]*)/))
{
`test -d Maildir/.Spam`
if ($RETURNCODE == 1)
{
log " - Creating Spam Folder"
`$MAILDIRMAKE Maildir/.Spam`
}
log "Moving spam to $DEFAULT/.Spam folder"
to $DEFAULT/.Spam/
}
else
{
log "Moving clean email to $DEFAULT"
to $DEFAULT
}
log "--------------------"
exit;

then, edit the .qmail file of the users you want to run through this filter as follows:

| if [ -z "$SA" ]; then export SA=1; /usr/local/psa/bin/psa-spamc -u [email protected] -U /tmp/spamd_full.sock > spamcheck$$; if [ -s spamcheck$$ ]; then /var/qmail/bin/qmail-local "$USER" "$HOME" "$LOCAL" "" "" "$HOST" "$SENDER" "$DEFAULT" < spamcheck$$; retval=$?; rm -f spamcheck$$; [ $retval = 0 ] && exit 99; exit $retval; fi; rm -f spamcheck$$; fi # ACCEPT UCE
| true
| /usr/bin/maildrop /etc/mail/mailfilter

Obviously, the last line is the important one ... however, if you still want to run the email through SpamAssassin you'll need the first lines. :)

Hope this helps ..

Luke
www.catch22media.com
 
Back
Top