Mutt has a mime_forward setting that must be enabled so that forwarded messages are sent as MIME-formatted attachments with full
headers. This may be added to your ~/.muttrc
file or entered after starting Mutt:
set mime_forward=yes
Once this is set, simply forward each message to your SpamCop submit address using the f
(forward) command.
Unfortunately, most people get more than one or two spam messages per day, and no one has their SpamCop submit address memorized (or always in their copy-paste buffer), so it's a good idea to create a macro for forwarding spam to SpamCop.
The following macros will submit all of the currently tagged messages to SpamCop via email in a single message. It will work while
viewing the list of messages in your mailbox (macro index
) or while viewing a single message (macro pager
) using the
Ctrl-X command:
macro index \cx ":set autoedit=no fast_reply=yes
editor=\"/bin/true\"\n<tag-prefix><forward-message>submit.xxxxxxxxxx
xxxxxx@spam.spamcop.net\n<send-message>:set autoedit=yes fast_
reply=no editor=\"/usr/bin/editor\"\n" \
"Forward mail to SpamCop"
macro pager \cx ":set autoedit=no fast_reply=yes
editor=\"/bin/true\"\n<tag-prefix><forward-message>submit.xxxxxxxxx
xxxxxxx@spam.spamcop.net\n<send-message>:set autoedit=yes fast_
reply=no editor=\"/usr/bin/editor\"\n" \
"Forward mail to SpamCop"
Macro configuration notes:
- The macro must be defined on one line, with a backslash continuation character at the end of the line for the description.
- Replace
submit.xxxxxxxxxxxxxxxx@spam.spamcop.net
with your SpamCop submit address in both macros. - The macros assume that
mime_forward
is set toyes
. If not, it may be set and unset within the macro definitions likefast_reply
is set and then unset. - If you set
autoedit
tono
in your.muttrc
, it may be removed from the macro definitions. - If you set
fast_reply
toyes
in your.muttrc
, it may be removed from the macro definitions. - You must change
editor
from/usr/bin/editor
to the path of your real editor (unless you're also using Debian GNU/Linux). - If you want to change the macros to only forward one message at a time (i.e., the currently highlighted or currently viewed message), then remove
<tag-prefix>
from the macro definitions.
Thanks to Martijn Pieters for submitting his .muttrc
file in a bug report on bugs.guug.de with these macros originally defined.
[Append to This Answer]