Red Hat LINUX 7.2 - OFFICIAL LINUX CUSTOMIZATION GUIDE Guida di Installazione Pagina 217

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 282
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 216
Chapter 16. Email 217
:0:
new-mail.spool
Figure 16-10. Example with no conditions
The first line starts the recipe by specifying that a local lockfile is to be created but does not specify
a name, leaving Procmail to use the destination filename and the LOCKEXT to name it. No condition
is specified, so every message will match this recipe and, therefore, will be placed in the single spool
file called new-mail.spool, located within the directory specified by the MAILDIR environment
variable. An MUA can then view the messages in this file.
This basic recipe could go at the end of all rc files to direct messages to a default location. A more
complicated example might grab messages from a particular email address and throw them away, as
can be seen in Figure 16-11.
:0
/dev/null
Figure 16-11. Example of email sent to /dev/null
With this example, any messages sent by [email protected] are immediately moved to
/dev/null, deleting them.
Caution
Be very careful that a rule is working correctly before moving messages matching it to /dev/null,
which is a permanent deletion. If your recipe conditions inadvertently catch unintended messages,
you will not even know you are missing those messages unless the sender tells you.
A better solution is to point the recipe’s action to a special mailbox that you can check from time to
time in order to look for false positives, or messages that inadvertently matched the conditions. Once
you are satisfied that no messages are accidentally being matched, you can delete the mailbox and
direct the action to send the messages to /dev/null.
Procmail is primarily used as a filter for email, automatically placing it in the right place so that you
do not have to sort it manually. The recipe in Figure 16-12 grabs email sent from a particular mailing
list and puts in the correct folder for you.
:0:
* ^(From|CC|To).*tux-lug
tuxlug
Figure 16-12. Example of list filtering
Any messages sent from the [email protected] mailing list will be placed in the tuxlug mail-
box automatically for your MUA. Note that the condition in this example will match the message if it
has the mailing list’s email address on the From, CC, or To lines.
Procmail can also be used to block spam, although this is not a good long-term solution for junk mail.
Consider the following temporary spam filtering solution in Figure 16-13, where multiple recipes are
set to use a common mailbox to store the junk.
Vedere la pagina 216
1 2 ... 212 213 214 215 216 217 218 219 220 221 222 ... 281 282

Commenti su questo manuale

Nessun commento