:: RootR :: | Hosting | Order | Map | Login | Secure Inter-Network Operations | |
What is procmail ? Procmail is an email tool to sort, redirect, copy, and do all sort of things to incoming email. its syntax is not too instinctive, but it is a powerful tool worth its effort. you can pretty much do anything you want to incoming email using procmail. Also many other programs such as spamassassin make use of procmail. How to sort my incoming email into separate folders ?
On rootr.net servers, mailboxes are just directories, and each mail message
is stored as a file. Here is an example .procmailrc how to do it,
Note the / at the end of mailbox paths. #----------------------------------------------------------------------- # example - simple procmail receipes # mail from the nasa about venus goes into own backup folder, # as well as the main inbox, and a directory visible online. # note: '*' lines are AND'ed. :0 * ^From: .*@nasa\.gov * ^Subject: .*venus { :0c $HOME/mail/ :0c $HOME/mail/nasa-backup/ :0 $HOME/web/example.com/nasa-mail/ } # forward all mail sent to this subscribed list to another email # (mailing lists often appear as if they are sent to themselves) :0 * ^(To|Cc): .*list-ruby@ruby-lang.org { # save me a copy in the main inbox as well :0c $HOME/mail/ :0 ! some-other-email@example.com } # put all mail matching these keywords in the suspicious folder: :0 * ^Subject: .*(VIAGRA|V.I.A.G.R.A|XANAX|X.A.N.A.X|VICODIN|V.I.C.O.D.I.N|ENLARGEMENT) $HOME/mail/suspicious/ # note: don't ever reply to spam mail, it will increase to more spam, # even if you strongly notify them they're not welcome. #-----------------------------------------------------------------------note: $HOME/mail/ is the main inbox, and is the
incoming mail for POP3, POP3-SSL, and POP3-TLS. It is also the main
inbox for the IMAP equivalents.
Using Procmail to sort incoming mail into IMAP sub-folders
The sub-directories in #----------------------------------------------------------------------- # example - procmail with IMAP folders # put all mail from that guy in its own folder, as he sends a lot of mail. # we use a dot-folder, so we can view it under IMAP :0 * ^From: .*dude@example.com $HOME/mail/.dude/ # this will go into the IMAP sub-folder inbox/foo/bar :0 * ^From: .*someone@example.com $HOME/mail/.foo.bar #----------------------------------------------------------------------- More on procmail
Those docs can also be accessed from the command line with |
:: Contact Information :: ©2024 ROOTR :: |