My standalone maildrop configuration files
miro <[email protected]>
| Newsgroups | gmane.mail.maildrop |
|---|---|
| Message-ID | <[email protected]> |
At long last I learned the last trick that I was badly lacking, and without which the configuration had some serious flaws. Such as those that I asked for help here: http://article.gmane.org/gmane.mail.getmail.user/4958 I like maildrop and wish to contribute my configuration to the public. Pls. find my configuration either on: http://www.croatiafidelis.hr/gnu/maildrop/ or I'll try and send them to this courier mailing list as signed attachments. Miroslav Rovis Zagreb, Croatia ------------------------------------------------------------------------------ Android is increasing in popularity, but the open development platform that developers love is also attractive to malware creators. Download this white paper to learn more about secure code signing practices that can help keep Android apps secure. http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk _______________________________________________ Courier-maildrop mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/courier-maildrop
.mailfilter
(text/plain, 4.7 KB)
#
# This is configuration file for standalone maildrop:
# ~/.mailfilter
#
# based on:
# http://www.wonkity.com/~wblock/docs/html/maildrop.html
# and the missing trick found on:
# http://www.debian.org/doc/manuals/debian-reference/ch06.en.html#_maildrop_configuration
# (the ...test -d ... if ( $RETURNCODE == 1 ) ... if clause trick)
#
# No warranties of any kind, but freely use as template
# You certainly cannot simply reuse this, but replace with your data (email etc.)
#
# You can cite me, Miroslav Rovis, and www.CroatiaFidelis.hr as source if you wish.
#
# Feedback welcome, but I am lazy at replying to emails sometimes. I prefer public
# correspondence, such as on respective mail-lists.
# See my previous attempts at .mailfilter script
# here: http://www.dovecot.org/list/dovecot/2013-October/092842.html
# as well as here: http://marc.info/?l=mutt-users&m=138178696024182&w=2
# for more info (and to avoid mistakes like mine)
TYPE="maildir"
logfile "$HOME/.mailfilter.log"
ECHO="/bin/echo"
MAIL="/usr/bin/mail"
MAILDIRMAKE="/usr/bin/maildirmake"
REFORMAIL="/usr/bin/reformail"
MBOX=($TYPE =~ /mbox/)
MAILDIR=($TYPE =~ /maildir/)
# use mbox by default
DEFAULT="$HOME/mail"
FOLDERS="$DEFAULT/"
if ( $MAILDIR )
{
DEFAULT="$HOME/Maildir"
FOLDERS="$DEFAULT/."
if ( $DEFAULT )
{
`test -d $DEFAULT`
if ( $RETURNCODE == 1 )
{
`${MAILDIRMAKE} "$DEFAULT"`
if ( $RETURNCODE == 0 )
{
# notify the user when new folders are created
NEWFOLDERMSG="${FOLDERS} folder created"
`${ECHO} "$NEWFOLDERMSG" | ${MAIL} -s "$NEWFOLDERMSG" $LOGNAME`
}
}
}
}
xfilter "reformail -c -U'Received: from'"
# filter out duplicate messages
`${REFORMAIL} -D 131072 $HOME/.duplicate.cache`
if ( $RETURNCODE == 0 )
{
log "File: (duplicate) ($SIZE)\n"
exit
}
if ( /^(To|Cc|Envelope-To|Delivered-To):.*(miro\.rovis@croatiafidelis\.hr)/ )
{
MYFOLDERDOT="$MATCH2"
MYFOLDER=`echo $MYFOLDERDOT|sed 's/\.//g'`
F2MKlevel1="$MYFOLDER"
include .maildirmake.incL1
# handle mailing list messages automatically
if ( /^List-Id:.*<([0-9A-Za-z_\.\-]+)/ )
{
LISTNAMEDOT="$MATCH1"
LISTNAME=`echo $LISTNAMEDOT|sed 's/\.//g'`
F2MKlevel2="$LISTNAME"
include .maildirmake.incL2
to ${FOLDERS}$MYFOLDER.$F2MKlevel2
}
if ( /^(To|Cc):.*postfix-users@postfix\.org/ )
{
LISTNAMEDOT="[email protected]"
LISTNAME=`echo $LISTNAMEDOT|sed 's/\.//g'`
F2MKlevel2="$LISTNAME"
include .maildirmake.incL2
to ${FOLDERS}$MYFOLDER.$F2MKlevel2
}
if ( /^(To|From):.*support@plus\.hr/ )
{
LISTNAMEDOT="[email protected]"
LISTNAME=`echo $LISTNAMEDOT|sed 's/\.//g'`
F2MKlevel2="$LISTNAME"
include .maildirmake.incL2
to ${FOLDERS}$MYFOLDER.$F2MKlevel2
}
if ( /^(To|From|Cc):.*@mutt.org/ )
{
LISTNAMEDOT="@mutt.org"
LISTNAME=`echo $LISTNAMEDOT|sed 's/\.//g'`
F2MKlevel2="$LISTNAME"
include .maildirmake.incL2
to ${FOLDERS}$MYFOLDER.$F2MKlevel2
}
to ${FOLDERS}$F2MKlevel1
}
if ( /^(To|Cc|Envelope-To|Delivered-To):.*(m.rovis@inet\.hr)/ )
{
MYFOLDERDOT="$MATCH2"
MYFOLDER=`echo $MYFOLDERDOT|sed 's/\.//g'`
F2MKlevel1="$MYFOLDER"
include .maildirmake.incL1
if (/^Return-Path:.*@(facebookmail\.com)/)
{
MY2FOLDERDOT="$MATCH1"
MY2FOLDER=`echo $MY2FOLDERDOT|sed 's/\.//g'`
F2MKlevel2="$MY2FOLDER"
include .maildirmake.incL2
# handle Facebook groups/lists messages automatically
if ( /^List-Id:.*<([0-9A-Za-z_\-]+)\.+/ )
{
LIST2NAME="$MATCH1"
F2MKlevel3="$LIST2NAME"
include .maildirmake.incL3
to ${FOLDERS}${MYFOLDER}.${MY2FOLDER}.$F2MKlevel3
}
to ${FOLDERS}${MYFOLDER}.$F2MKlevel2
}
if ( /^(To|From):.*(childrenofmedugorje@gmail\.com)/ )
{
MY2FOLDERDOT="$MATCH2"
MY2FOLDER=`echo $MY2FOLDERDOT|sed 's/\.//g'`
F2MKlevel2="$MY2FOLDER"
include .maildirmake.incL2
to ${FOLDERS}${MYFOLDER}.$F2MKlevel2
}
if ( /^(To|From):.*([email protected])/ )
{
MY2FOLDERDOT="$MATCH2"
MY2FOLDER=`echo $MY2FOLDERDOT|sed 's/\.//g'`
F2MKlevel2="$MY2FOLDER"
include .maildirmake.incL2
to ${FOLDERS}${MYFOLDER}.$F2MKlevel2
}
if ( /^(To|From):.*([email protected])/ )
{
MY2FOLDERDOT="$MATCH2"
MY2FOLDER=`echo $MY2FOLDERDOT|sed 's/\.//g'`
F2MKlevel2="$MY2FOLDER"
include .maildirmake.incL2
to ${FOLDERS}${MYFOLDER}.$F2MKlevel2
}
if ( /^From:\s*EWTN\s*<([email protected])>/ )
{
MY2FOLDERDOT="$MATCH1"
MY2FOLDER=`echo $MY2FOLDERDOT|sed 's/\.//g'`
F2MKlevel2="$MY2FOLDER"
include .maildirmake.incL2
to ${FOLDERS}${MYFOLDER}.$F2MKlevel2
}
# handle mailing list messages automatically
if ( /^List-Id:.*<([0-9A-Za-z_\.\-]+)/ )
{
LISTNAMEDOT="$MATCH1"
LISTNAME=`echo $LISTNAMEDOT|sed 's/\.//g'`
F2MKlevel2="$LISTNAME"
include .maildirmake.incL2
to ${FOLDERS}${MYFOLDER}.$F2MKlevel2
}
to ${FOLDERS}$F2MKlevel1
}
.mailfilter.sig
(application/pgp-signature, 543 B) - not displayed
.maildirmake.incL1
(text/plain, 480 B)
if ( $MAILDIR )
{
DEFAULT="$HOME/Maildir"
FOLDERS="$DEFAULT/."
if ( $F2MKlevel1 )
{
`test -d ${FOLDERS}$F2MKlevel1`
if ( $RETURNCODE == 1 )
{
`${MAILDIRMAKE} -f "$F2MKlevel1" "$DEFAULT"`
if ( $RETURNCODE == 0 )
{
# notify the user when new folders are created
NEWFOLDERMSG="${FOLDERS}$F2MKlevel1 list folder created"
`${ECHO} "$NEWFOLDERMSG" | ${MAIL} -s "$NEWFOLDERMSG" $LOGNAME`
}
}
}
}
.maildirmake.incL1.sig
(application/pgp-signature, 543 B) - not displayed
.maildirmake.incL2
(text/plain, 521 B)
if ( $MAILDIR )
{
DEFAULT="$HOME/Maildir"
FOLDERS="$DEFAULT/."
if ( F2MKlevel2 )
{
`test -d ${FOLDERS}${MYFOLDER}.${F2MKlevel2}`
if ( $RETURNCODE == 1 )
{
`${MAILDIRMAKE} -f "${MYFOLDER}.${F2MKlevel2}" "$DEFAULT"`
if ( $RETURNCODE == 0 )
{
# notify the user when new folders are created
NEWFOLDERMSG="${FOLDERS}${MYFOLDER}.${F2MKlevel2} list folder created"
`${ECHO} "$NEWFOLDERMSG" | ${MAIL} -s "$NEWFOLDERMSG" $LOGNAME`
}
}
}
}
.maildirmake.incL2.sig
(application/pgp-signature, 543 B) - not displayed
.maildirmake.incL3
(text/plain, 549 B)
if ( $MAILDIR )
{
DEFAULT="$HOME/Maildir"
FOLDERS="$DEFAULT/."
if ( $F2MKlevel3 )
{
`test -d ${FOLDERS}${MYFOLDER}.$MY2FOLDER.$F2MKlevel3`
if ( $RETURNCODE == 1 )
{
`${MAILDIRMAKE} -f "${MYFOLDER}.$MY2FOLDER.$F2MKlevel3" "$DEFAULT"`
if ( $RETURNCODE == 0 )
{
# notify the user when new folders are created
NEWFOLDERMSG="${FOLDERS}${MYFOLDER}.$MY2FOLDER.$F2MKlevel3 list folder created"
`${ECHO} "$NEWFOLDERMSG" | ${MAIL} -s "$NEWFOLDERMSG" $LOGNAME`
}
}
}
}
.maildirmake.incL3.sig
(application/pgp-signature, 543 B) - not displayed
signature.asc
(application/pgp-signature, 836 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.15 (GNU/Linux) iQIcBAEBCgAGBQJScq1EAAoJEBi5AB8X1oH8gZgP/iN9ose/IrL++moBw88syC5t OyNbgHt/SpDr80uDYdmqcF/4z5iweSI4+Q2hX8VD5covDkZFCscYqp59C08M5S5D RPtjf1aXYcU+QbKaF7whNQ0eKmO1LCOF9JrgHfnd2RLrbm2gmXkCTLuc4V540xrM 8OM8zgmpdoxQUMAr77q+9wNRKddGUG5ISboWoXHlWridCLUQZsxkP5OpqRa7pbpJ d5RKDNRuW5H3DGVhkUqqFsIaPu6Y2QgjS9c4eRrRRCwA4cWsTo4D+pV1qW0xwqLh K6iQdQnS7fuqzDaVqfZFznJHnlqAnifx6mYnxyWVvhcO6LADI6ibrPS345nmTrqU gy9b4h+JQPVnwPqs0m5zZ9ERphHn6XBtIhoIWqBEEii19sWLnLn74x4zeqKiJgew lx8pMUeuR/tec5mqpe8eEPPvvlgP/J/GW+dh62F306ebGXY+Vocy1LR/2ZstAWf5 lLB5bI+Kus+bMxC95PhPGW/xlwxKSrzUB7bHMP9YBkMlCtDmkO7VDl8+O9vNLzr5 Gj2uhn7hgoJNMovnbHqArgHvVzV4KPIxepEQr87Bobuj+jbfeasLSg7uH2malI4s yDCTYxD27b/15dHJZSLRE5Ehj0Za9/5N+TFemn556XEEg0TP5kwQAB6ZdE0iK6BO tc3YxvFcKGPK/Irnx2gj =2WsM -----END PGP SIGNATURE-----