TWiki
>
Main Web
>
Computing
>
Mail
>
MailFilters
>
Procmail
(2020-02-06,
WilliamSeligman
)
(raw view)
E
dit
A
ttach
---+ Using Procmail on the Nevis mail server ---++ Short version Look at =/a/mail/procmailrc/seligman=. Edit your own =/a/mail/procmailrc/$USER= and include/edit the recipes from my file to suit your needs. ---++ Using Procmail [[http://www.nevis.columbia.edu/cgi-bin/man.sh?man=procmail][Procmail]] is a program that delivers your mail. You can create a file =/a/mail/procmailrc/$user= to filter messages, automatically direct mail into certain folders, and other advanced operations. There are two places where you can put a procmail command file: =/a/mail/procmailrc/$user= or =~/.procmailrc=. The former location is preferred, since the file will remain available to the mail server if your home directory becomes unavailable; e.g., if your [[list of machines][group's server]] goes down. The latter name is the standard for many computer systems, and it's allowed at Nevis though I don't suggest it. If you have both files, they will both be executed. If you glance at =/a/mail/procmailrc/seligman= or at the example below, you'll see that using procmail requires learning a new scripting language. The constant =:0= seems a bit off-putting, until you learn that in an early version of the language you were required to use =:N= where "N" was the number of lines in the recipe; that's no longer necessary, but you still need =:0= to maintain consistency. Also, procmail makes heavy use of [[https://www.geeksforgeeks.org/perl-regular-expressions/][regular expressions]]. That is natural, since regular expressions (or just "regexes") are frequently used in searching and processing text, which is fundamental in handling mail. ---++ Why bother? _Why should I bother configuring Procmail on the Nevis mail server? The mail reader on my laptop (e.g., [[https://www.thunderbird.net/en-US/][Thunderbird]], [[https://support.apple.com/mail][Apple Mail]], [[https://products.office.com/en-us/outlook/][Outlook]]) already has a mail filter._ * Speed: The mail server is faster at processing your email than your laptop/desktop. * Configuration: In general, Procmail provides a greater level of control than your mail reader. _(Boast: It certainly provides a greater level of control than Gmail or Columbia's !LionMail.)_ * Multiple devices: If you read your mail on different devices (e.g., your laptop, a desktop, your phone) then the Procmail rules will apply to all your incoming mail. If you set up mail filtering on Apple Mail on your laptop, that will have no effect on mail you receive via the Mail app on your !iPhone. ---++ A practical example. Reminder from the [[Mail Filters]] page: Every time a [[https://larsoft.org/][LArSoft]] developer makes a change to the [[https://cdcvs.fnal.gov/redmine/projects/larsoft/wiki/_Quick-start_guide_to_using_and_developing_LArSoft_code_][LArSoft git repository]], I get an email message from =larsoftcommit@fnal.gov= or =uboonecommit@fnal.gov=. Frequently I get dozens of such emails every day. I don't want to automatically delete them, since there may be something that impacts my work, but I don't want them cluttering my INBOX either. So I use a mail filter to test if the "From" address of each email I receive includes =larsoftcommit@fnal.gov= or =uboonecommit@fnal.gov=. If it does, the mail is immediately sent to my =LArSoft commit= folder instead of my INBOX. Periodically I review the contents of that folder to see if any code changes are relevant to me. If you look in =/a/mail/procmailrc/seligman=, you'll see this code to implement the filter: <pre> :0 * ^TO_.*(larsoft|uboone)commit\@fnal\.gov { :0: "LArSoft Commit" } </pre> ---++ References If you're interested in exploring procmail, I recommend the following resources: * Procmail [[http://www.iki.fi/era/procmail/mini-faq.html][FAQ]] and [[http://pm-doc.sourceforge.net/doc/][tips]]. * The [[http://www.nevis.columbia.edu/cgi-bin/man.sh?man=procmail][procmail man page]]. * The [[http://www.nevis.columbia.edu/cgi-bin/man.sh?man=procmailrc][procmailrc man page]]. * The [[http://www.nevis.columbia.edu/cgi-bin/man.sh?man=procmailex][procmailex man page]]. * %MAINWEB%.WilliamSeligman's procmail file at =/a/mail/procmailrc/seligman=.
E
dit
|
A
ttach
|
Watch
|
P
rint version
|
H
istory
: r2
<
r1
|
B
acklinks
|
V
iew topic
|
Ra
w
edit
|
M
ore topic actions
Topic revision: r2 - 2020-02-06
-
WilliamSeligman
Main
Log In
or
Register
Main Web
Create New Topic
Index
Search
Changes
Notifications
RSS Feed
Statistics
Preferences
Webs
ATLAS
DOE
DZero
FutureTev
Main
TWiki
Veritas
Copyright © 2008-2021 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback