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
# # 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
Description: PGP signature
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
Description: PGP signature
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
Description: PGP signature
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
Description: PGP signature
signature.asc
Description: Digital signature
