On 2015-07-17 09:27, Kevin A. McGrail wrote:
On 7/16/2015 8:00 PM, Allen Marsalis wrote:
Can you elaborate on the macros any?
Sure. Mutt is a very powerful little mail client and it's perfect for
me for analysis of mbox files.
We use maildir most of the time on our servers. Is that a problem or are
you referring to a mbox file on a client machine? I never ran
spamassassin on a client before. Sorry, just trying to understand your
test environment.
Creating a .muttrc file, you can add some macros like ctrl-y (why is
this hitting KAM ;-) ):
macro index \cy "<pipe-message>spamassassin -t -D 2>&1 | grep -e KAM
--e Content\\ analysis<enter>\n" "Test Message with Spamassassin for
KAM Rules"
or prompt for a string to match with ctrl-v
macro index \cv "<pipe-message>spamassassin -t -D 2>&1 | grep -i -e
Content\\ analysis -e " "Test Message with Spamassassin for Rules
Matching Search"
ctrl-o to look at everything:
macro index \co "<pipe-message>spamassassin -t -D<enter>\n" "Test
Message with Spamassassin for all Rules"
And when you view a message I can hit ctrl v to sha1sum an attachment
for example:
macro attach \cv "<pipe-entry>sha1sum<enter>\n" "sha1sum on an
attachment"
Hope this helps and perhaps you can edit our wiki and add any ideas
you find useful for others!
Yes that helps tremendously. Thanks Kevin. I was thinking bash scripts
with spamassassin -t or something when I saw the word "macro". Knowing
these are Mutt Macros set off the light bulb. I will definitely play
around with Mutt and your macros as see what it's all about.
regression_tests.cf is a file you edit with a rule name and strings it
should and should not hit on.
You then run make test and will be told if your rule hits/doesn't hit
as expected. Off-hand not sure exactly which test does it but once
you figure that out you can do prove -v t/testname.t and run just that
test.
I looked for regression_tests.cf but I couldn't find it in any directory
on my server. Not in /etc/mail/spamassassin/ or anyplace else I looked.
I did google sample copies of the file and looking at it, I was a little
confused since it doesn't look like other .cf files I'm familiar with. I
see the "test", "ok" and "fail" attributes but no regex, just words. I'm
guessing this is a .cf file that I need to add alongside my other .cf
files (not part of installation). I never ran make test before either.
But shouldn't be too hard to figure out.
Sorry, not trying to spam my rule tool but just gain insight on where
and if it is truly useful.
I think it is useful for new rule testers. I try and automate my
stuff as much as possible and these days I can pickup spam patterns in
my sleep...
LOL. I may not be so good at coding patterns, but I can smell a good
spam phrase in a heartbeat. I am also very careful to double check, lint
rules, etc. and I can't be too careful.
Anyway, a link or two for (basic|convention|intended) rule checking
might be enough to get me started and more familiar with regular
methods of checking/debugging.
Sorry, only thing I would be doing is a Google search... I'm not sure
such a document exists though it should. Perhaps some of the other
people who write rules can share some of their tricks?
There really isn't much out there on the subject that is clear enough
for someone getting started. I'm not sure I'm Wiki material, but I may
try to put together a few basic howto's that interested folks can be
pointed to on occasions like this.
Thanks again for taking time to help someone down low on the mountain,
help get up the mountain. I surely appreciate it.
Allen
am -at- satester.com