|
|
Redirecting mail to folders other than your system mailbox is useful for keeping all the mail on a particular subject or the messages sent to an alias to which you belong in one folder.
To deliver mail to different folders, you must first set up the file .maildelivery in your home directory. To do this:
-rw-r--r--
):
#Header Content Action Result Filename
to
login >
?
/usr/spool/mail/
login
The line beginning with the number sign ``#'' is a comment. Replace login with your login name.
The ``>'' character in the ``Action'' column causes these messages to be added to (/usr/spool/mail/login). The ``?'' in the ``Result'' column means that the message will be considered to have been delivered if it arrives safely in the system mailbox. If the message has already been delivered, the message will not be added to the mailbox. This is important if you do not want a message delivered to more than one folder.
To redirect messages with specific patterns
in the ``Subject'' header, specify subject in the
``Header'' column and the pattern
to be matched in the ``Content'' column.
For example, to redirect mail on the subject of ``Style''
to myfolders/style.mail,
add the following line to .maildelivery:
subject "Style" > A /u/
login/myfolders/style.mail
to engr > A /u/
login/myfolders/engr.mail
cc engr > A /u/
login/myfolders/engr.mail
The ``A'' in the ``Result'' column means that a message that has already been delivered will still be added to the folder.
The engr.mail folder is created when it first receives mail; you do not need to create it yourself.
default - > A /usr/spool/mail/
login
#
The ``default'' in the ``Header'' column matches this field if the message has not already been delivered. The dash character (-) indicates that the ``Content'' field is not used here.
For more information on the format of the .maildelivery file, see the maildelivery(F) manual page.