I have a mutt macro that classifies mail as either Spam (F9) or Ham (F10) by running it through bogofilter.

However, I would like the X-Bogosity header to be updated when I do this, rather than having the email still say "Unsure".

Does anyone know how I can achieve this? I feel like it's something that should be relatively easy.


Temporary workaround: disable Unsure mode, as explained here: http://bogofilter.sourceforge.net/faq.shtml#unsure

This means it's not necessary to update the header from Unsure to {Spam, Ham}, as the Unsure header never occurs in the first place.


You could use grep -v to strip the existing X-Bogosity line out of the message prior to re-processing.

Then you could add the newly updated header afterwards by running it through bogofilter -p -e again after you've trained on it. Note that due to the nature of statistical spam filters the new header may still not be what you trained it as.

Note that bogofilter itself ignores any pre-existing X-Bogosity header when classifying and learning, so you shouldn't normally need to strip headers out anyway. It may be a better idea just not to worry about the headers that end up on the mail and use the folder that they're in to categorise them instead.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.