here are snippets from my
.muttrc file which allow me to bounce messages to my zimbra server spam / ham mailboxes, for the purposes of training spamassassin. this was taken from Lucas Nussbaum, but his link appears to be down at the moment. i’m including these here in case anyone elses googles “mutt zimbra spam macro”, like i did for a few weeks to no avail.
macro index S "<bounce-message>email@example.com\nyd" "Learn as spam"
macro pager S "<bounce-message>firstname.lastname@example.org\nyd" "Learn as spam"
macro index H "<bounce-message>email@example.com\nyj" "Learn as ham"
macro pager H "<bounce-message>firstname.lastname@example.org\nyj" "Learn as ham"
these allow you to highlight a message in the index or pager, hit “S” for spam (or “H” for ham,) and the message bounces away to the appropriate zimbra mailbox for automated spamassassin learning. (additionally, the “S” for spam macro marks the message for deletion; the “H” for ham macro simply moves to the next message.) the tricky bit for me was understanding that mutt allows the “\n” newline character to simulate <return> at the end of the <bounce-message> command.
note that you must change “spambox” and “hambox” to the appropriately named mailboxes for your domain. to see what your current spam mailboxes are, issue the following command as the zimbra user:
zmprov gacf | grep SpamAccount
to change these values to something more appropriate to your domain, use zmprov again:
zmprov mcf zimbraSpamIsNotSpamAccount <your ham account>@example.com
zmprov mcf zimbraSpamIsSpamAccount <your spam account>@example.com