Version 5 (modified by Jamie McClelland, 3 years ago) (diff)


Filter check

May First/People Link regularly checks to see if our servers are sending email messages into the spam/junk boxes of corporate providers. These scripts are installed and configured on

There are three parts to the check:

  • mf-monitor-filtercheck - This script runs on a cron job and updates the nagios server is the status changes. When run on the terminal it will take 15 minutes to complete (to leave enough time for all messages to be delivered) and will output either OK: or CRITICAL: depending on whether all messages laned in the inbox or not.
  • mf-filtercheck - This script is the one executed by mf-monitor-filtercheck - by default it provides verbose output so you can see which corporate providers are filtering our email. You can pass the environment variable MF_SLEEP=60 if you want the script to sleep for only 60 seconds instead of the full 15 minutes.
  • filter-check - This is the generic script that powers mf-filercheck. See more below...


The filter-check program sends email via our servers to various corporate providers and checks to see if they land in the inbox or the spam box.

Current providers checked: Gmail, Yahoo and

Basic usage:

usage: filter-check [-h] [--sendvia SENDVIA] [--sendto SENDTO] [--quiet]
                    [--gtube] [--headers] [--sleep SLEEP]
                    [--emailfrom EMAILFROM] [--subject SUBJECT] [--msg MSG]
                    [--sendonly] [--fetchfrom FETCHFROM]
                    [--messageid MESSAGEID]

Check deliverability to various mail providers. Configuration file is in

optional arguments:
  -h, --help            show this help message and exit
  --sendvia SENDVIA     the host to relay the email
  --sendto SENDTO       the host to send the email
  --quiet               surpress all output, use exit codes only
  --gtube               use spamassassin code to identify the message as spam
                        (for debugging)
  --headers             output full headers, instead of brief headers
  --sleep SLEEP         number of seconds to wait between sending and checking
  --emailfrom EMAILFROM
                        send the test message from this email
  --subject SUBJECT     specify the subject for the test message
  --msg MSG             specify the body of the test message
  --sendonly            don't fetch the message, only send it and output the
                        message-id sent
  --fetchfrom FETCHFROM
                        don't send a message, only fetch a message from this
                        host matching the passed messageid
  --messageid MESSAGEID
                        when using fetchfrom, fetch the messageid specified in
                        this option

Exit codes: 0 if message is found in Inbox, 1 if found in spam box, 2 if not
delivered, 255 if error.

Code is available via git clone git://