@lbutlr: > This is what I have to clear the held message and send them to > sa-learn, in case it's useful to anyone else. > > $ cat /usr/local/bin/spamd-learn > #!/bin/bash > > SUSER="spamd" > SPAMF="${SUSER}/trained/spam" > > # search for held messages, get qid, train as spam, and save message, then > remove from queue. > > MYIDS=`mailq | tail -n +2 | grep -v '^ *(' | awk '{print $1}' |grep "!" | tr > -d '!'` > if [[ !$MYIDS ]]; then > for i in ${MYIDS}; do > postcat -bhq $i | sudo -u ${SUSER} sa-learn --spam > postcat -bhq $i > ${SPAMF}/$i > postsuper -d $i > done > fi > > #EOF
Suggestion: enable non-repeating queue IDs otherwise you overwrite existing files in the SPAMF folder. # postconf "enable_long_queue_ids = yes" # postfix reload Wietse > Obviously, this should only be run after looking at the messages > in the mailq to make sure they are spam. > > -- > "How good bad music and bad reasons sound when we march against an > enemy." - Friedrich Nietzsche > >