@tessa67, @Hangover2,
I checked it again with the mail logs of my server (Plesk Obsidian on Debian 13, Postfix + Courier; forwarding addresses with a mailbox). The test in #12 was a sender on the SpamAssassin blocklist of the mailbox (USER_IN_BLOCKLIST, score 98), sent once with each spam action.
The log shows the order of the steps during local delivery – the spam filter runs first, the forwarding afterwards:
"action=text" is "mark only" – that one was forwarded. Over all spam mails to active forwarding addresses in my logs (about 10 days):
So on this setup: marked spam is forwarded, moved or deleted spam is not. Hangover2, maybe your setup differs (Dovecot, a spam filter extension, or forwarding addresses without a mailbox) – I can only speak for this one.
To check it on your own server:
It counts, per spam action, the spam mails to active forwarding addresses and whether a forwarded copy was sent.
I checked it again with the mail logs of my server (Plesk Obsidian on Debian 13, Postfix + Courier; forwarding addresses with a mailbox). The test in #12 was a sender on the SpamAssassin blocklist of the mailbox (USER_IN_BLOCKLIST, score 98), sent once with each spam action.
The log shows the order of the steps during local delivery – the spam filter runs first, the forwarding afterwards:
Code:
spam[1213455]: 814BC60029: SPAM detected_by=spamassassin action=text
postfix-local[1213452]: 814BC60029: spam: stderr: PASS
postfix-local[1213452]: 814BC60029: send message: id=S1213452 from=<SRS0=...> to=<[email protected]>
"action=text" is "mark only" – that one was forwarded. Over all spam mails to active forwarding addresses in my logs (about 10 days):
Code:
40 action=delete forwarded=0
1 action=text forwarded=1
1 action=move forwarded=0
So on this setup: marked spam is forwarded, moved or deleted spam is not. Hangover2, maybe your setup differs (Dovecot, a spam filter extension, or forwarding addresses without a mailbox) – I can only speak for this one.
To check it on your own server:
Code:
zcat -f /var/log/maillog* > /tmp/all.log
export fw=$(plesk db -Ne "select distinct lower(concat(m.mail_name,'@',d.name)) from mail m join domains d on d.id=m.dom_id join mail_redir r on r.mn_id=m.id where m.mail_group='true'")
awk 'BEGIN{n=split(ENVIRON["fw"],a,"\n"); for(i=1;i<=n;i++) F[a[i]]=1}
/postfix-local\[[0-9]+\]: [0-9A-Za-z]+: from=.*to=</ {q=$6; sub(/:$/,"",q); if(!(q in T)){match($0,/to=<[^>]+>/); T[q]=tolower(substr($0,RSTART+4,RLENGTH-5))}}
/spam\[[0-9]+\]: [0-9A-Za-z]+: SPAM .*action=/ {q=$6; sub(/:$/,"",q); match($0,/action=[^ ]+/); A[q]=substr($0,RSTART+7,RLENGTH-7)}
/: send message:/ {q=$6; sub(/:$/,"",q); S[q]=1}
END{for(q in A) if(T[q] in F) c["action=" A[q] " forwarded=" ((q in S)?1:0)]++; for(k in c) print c[k], k}' /tmp/all.log
It counts, per spam action, the spam mails to active forwarding addresses and whether a forwarded copy was sent.