Skip to main content

Any way to process lots of messages in webmail with SpamAssassin?

Comments

5 comments

  • cPanelMichael
    Hello :) It won't scan messages that have already been delivered, but you could develop a bash script that searches for specific content within an email and removes any messages that match the search term. Thank you.
    0
  • Kent Brockman
    ok, that's bad news. well, thanks, I had the hope to automagically been able to run some bash script that make SA scan a delete all those msgs with certain score. Maybe a find command with awk to detect the string "Score: " and evaluate the value and act accordingly?
    0
  • cPanelMichael
    ]Maybe a find command with awk to detect the string "Score: " and evaluate the value and act accordingly?

    Yes, this is one option that you may find helpful. Note that you likely want to move the messages to another location for a set time period before removing them in-case customers complain of the removal of legitimate email. Thank you.
    0
  • Kent Brockman
    I know, I should try piping results to dir command rather than rm until I got it perfectly ok :) And then, I should move the message files to the spam folder. I think I need some senior help here. I built the command to read the Scores, but I don't know how to eval them if the value is, let's say, bigger than 5 (for X-Spam-Score: 5 and upper).
    grep -nr "X-Spam-Score: " /home/accountname/mail/.email@domain_com/new | cut -d':' -f4
    Not sure how to evaluate values from the command line. Is it possible?
    0
  • cPanelMichael
    You may find this third-party URL helpful: [url=http://stackoverflow.com/questions/91899/use-grep-to-find-content-in-files-and-move-them-if-they-match]linux - Use grep to find content in files and move them if they match - Stack Overflow Thank you.
    0

Please sign in to leave a comment.