0

From https://de.wikipedia.org/wiki/Procmail


:0fw
| /usr/bin/spamassassin

:0H
* ^X-Spam-Level: \*\*\*\*\*\*\*\*\*\*
/dev/null

:0H:
* ^X-Spam-Status: Yes
./Spam

I would like to complement the move to /dev/null with a forward to submit.[id]@spam.spamcop.net.

I have only found simple forwarding as an action (!). But Spamcop also needs the headers, so I would have to create an empty email with the email as attachment.

{
    :0 c
    ! submit.[id]@spam.spamcop.net

    :0
    /dev/null
}
  • Please ping me once the [strike](https://meta.stackexchange.com/questions/390106/moderation-strike-update-data-dumps-choosing-representatives-gpt-data-and-wh) is over if you don't have an answer by then – tripleee Jun 26 '23 at 20:25
  • I still don't understand , are they complaing they WANT people to allow GPT answers? That will ruin all human additions and cause a race to fill all possible gaps ahead of the need. – easleyfixed Jun 27 '23 at 20:31
  • Basically a duplicate of https://stackoverflow.com/questions/26709669/using-procmail-to-forward-inline – tripleee Jun 27 '23 at 21:08
  • @tripleee I don't think so: Inline != as MIME attachment – xebeche Jun 29 '23 at 09:24
  • 1
    But it is; just set `Content-type: message/rfc822` in the container message. – tripleee Jun 29 '23 at 10:49
  • I stand corrected. Thanks. I added this to my answer. – xebeche Jun 29 '23 at 21:35

2 Answers2

0

Have you considered using spamassasin/spamc for sending spam reports via SMTP to spamcop.net? See Mail::SpamAssassin::Plugin::SpamCop and --reporttype command line option of spamc. It would require confirmation via WWW unless you use "quick" spamcop reporting.

AnFi
  • 10,493
  • 3
  • 23
  • 47
0

Procmail has no built-in mechanism to forward as attachment. However, a simple shell script does the trick. In fact, spamcop.net offers a simple Perl script for exactly this purpose.

Download this script, edit in your eMail addresses and make it executable, let's say as $HOME/bin/reporter.pl.

Then, in your .procmailrc use the action | ("pipe" or "filter") instead of ! ("forward"). For instance:

:0fw
| /usr/bin/spamassassin

:0w
* ^X-Spam-Level: \*\*\*\*\*\*\*\*\*\*
| $HOME/bin/reporter.pl

:0H:
* ^X-Spam-Status: Yes
./Spam

Note that the 2nd recipe does not use the flag "f" (filter). With "f" procmail would expect the script to return a message at stdout. That's the case e.g. with "|spamassassin", but our "|reporter.pl" is a so-called delivering recipe. It should not create any output. Hence, /dev/null is not needed.

Edit

As tripleee pointed out messages can also be forwarded "inline", and SpamCop.net is accepting and processing this format apparently just fine. So, adapting tripleee's code the recipe could be

:0fw
| /usr/bin/spamassassin

:0w
* ^X-Spam-Level: \*\*\*\*\*\*\*\*\*\*
| (echo "From: me@example.com"; echo "To: submit.[id]@spam.spamcop.net"; \
   echo "Subject: report spam"; echo "MIME-Version: 1.0"; \
   echo "Content-type: message/rfc822"; echo; cat -) | $SENDMAIL -t

:0H:
* ^X-Spam-Status: Yes
./Spam
xebeche
  • 905
  • 7
  • 20