Skip to content

Instantly share code, notes, and snippets.

@norrs
Created August 22, 2013 15:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save norrs/6308803 to your computer and use it in GitHub Desktop.
Save norrs/6308803 to your computer and use it in GitHub Desktop.
DEFAULT=$HOME/Maildir
MAILDIR=$HOME/Maildir
logfile "$HOME/.getmail/.maildrop.log"
log "Markers: ---------------------------------------------"
log " (**) from config file, (II) informational, (WW) warning"
log "--------------------------------------------------------"
log ""
######################################################################
#
# Adding missing headers for PGP/MIME
#
BPM="-----BEGIN PGP MESSAGE-----"
EPM="-----END PGP MESSAGE-----"
BPS="-----BEGIN PGP SIGNATURE-----"
EPS="-----END PGP SIGNATURE-----"
if (!/^Content-Type: message/ && !/^Content-Type: multipart/ \
&& !/^Content-Type: application\/pgp/)
{
if (/^$BPM/:b && /^$EPM/:b)
xfilter "reformail -A 'Content-Type: application/pgp; format=text; \
x-action=encrypt'"
if (/^$BPS/:b && /^$EPS/:b)
xfilter "reformail -A 'Content-Type: application/pgp; format=text; \
x-action=sign'"
}
#####################################################################
#
# Correcting wrong signature dashes
#
if (/^--($|[ ]{2,}^)/:b)
{
xfilter "sed -r 's/^--($|[ ]{2,}^)/-- /'"
log "(II) Sig Dashes corrected"
}
#''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
# What we can find in the header
if ( /^X-Advertisement:.*/ \
|| /^X-Mailer:.*(Advanced Mass)/ \
|| /^X-Spam-Status: YES / \
|| /^Message-ID:*<>/:h )
{
exception {
to $DEFAULT/.spam/
}
}
# gathering
if (/^From: mailman-bounces@gathering\.org$/)
{
log "(II) [tg-drift] Mailman bounce"
to $DEFAULT/.tg.drift/
}
exception {
log "(II) default mailbox."
to $DEFAULT/
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment