Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
[Uberspace] Maildrop mailfilter: Sort subaddress-mails into already existing subdirs.
MAILDIR = "$HOME/Maildir"
# EMails an Erweiterungen in Unterordner verschieben falls dieser existiert
if (/^To: .*mail-(.*)
SUBMAILDIR = `find $MAILDIR -iname ".$MATCH1" | head -n 1`
`test -d $EMAILDIR/new && exit 1 || exit 0`
if ( $RETURNCODE == 1 )
# Standardregel:

This comment has been minimized.

Copy link
Owner Author

shuairan commented Aug 20, 2012

Sorts subaddress-mails (mails including a dash: into a subdir if a suitable (case insensitive) directory exists.
This mailfilter doesn't create new subdirectorys, which can be configured via IMAP Client and/or Roundcube (because I don't want to sort ALL my different subaddresses into subdirs)

To use this script change line 5 to match your personal mail address.
If you want all to be placed in a subdirectory "Test", simply create that subfolder and your future mail to "" will be sorted there. (existing mails have to be moved manually, maildrop only applies to incoming mails)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.