Personal tools
You are here: Home Support Documentation Email x49.html
Document Actions

x49.html

Mail Routing to Folders

Mail Routing to Folders

Users may have messages routed to selected IMAP folders based on patterns in the message headers.

Incoming messages may be sent to folders other than the default INBOX, and this is controlled by a file in the user's $HOME directory, ~/Maildir.rules. The format of this file is quite simple. It is a plain text file with one line per rule specifying, the header type, a pattern, and the folder in which to put the message. Here's a sample of mine.


# This file is very similar to the tcp_wrappers /etc/hosts.allow
# file, and is used to map mail headers to Maildir mailboxes.
# Each line consists of three parts, a header list, pattern, and
# mailbox name in the format:
# Header[,header] : pattern : DROP | mailboxname | emailaddr.
#
# Any whitespace around the first and last ``:'' characters will
# be dropped.
#
# The DROP mailbox name is used to indicate mail that will be
# dropped, and won't go into any mailbox.  The mailbox names are
# used to specify Maildir/ style mailboxes.  Any ``/'' characters
# in the mailbox name will be replaced by ``.'' for compatibility
# with courier-imap.
#

# custom header from PloneFormGen, usually from Contact Us
X-FormGen,X-PloneFormGen: . : vendors
# extraneus message from our accounting software
Subject: AP.POSTING.PERIOD : DROP
# Security update for the SNORT package
Sender: noreply@snort.org : security
Subject: Logwatch : security
# many mailing list programs identify lists with ``List-Id''
List-Id: lists.apple.com : bulk
From: reply.myfamilyinc.com : vendors

# This has two header types separated by ``,'' in the first
# field.
From,Sender: vrmmail@vrm.ca.ibm.com : vendors
From,Sender: vrmmail@us.ibm.com : vendors
From,Sender: billing@ebay.com : vendors
Subject: Postfix.log.summ : postmaster
Subject: cssecscan.errs : security
Subject: BlueSecurity : general
To: checkservices : alert
Subject: missing.checkins : alert
Subject: checkServices|chkhosts.pl : alert
# Final rule to send things to the general folder
Received: . : general


Powered by Plone CMS, the Open Source Content Management System

This site conforms to the following standards: