![]() The advantage is the dovecot will have its databases up to date at all times.Groupware setups like Zarafa often leave the spam scanning to external tools – but still has to sort the tagged mails. The deliver will be the first attempt then Default will be the back up.ĭELIVER="/usr/lib/dovecot/deliver -d $LOGNAME" ![]() To forward to dovecot change the following assignments This was tested on Arch's standard Exim 4.94-2 package. # Next 2 lines unneeded unless using obsolete MBOX files Require_files = $local_part_data:$home/.procmailrcĬommand = /usr/bin/procmail -d $local_part_data # only invoke procmail for users with a conf file: # under "Routers" (order important, define before the "localuser:" router) forward file, or edit /etc/mail/nf to use it directly as a local delivery agent: To use with Exim, invoke procmail in the. Mailbox_command = /usr/bin/procmail -a "$EXTENSION"Īfter reloading rvice, email will be send to procmail for filtering and delivery. To pipe from postfix open /etc/postfix/main.cf then add If a coworker keeps using forward to send you jokes and other non serious stuff, but at the same time, writes you work related mails, you could save the forwarded mails (most likely not-work-related mails) on a different mailbox. | formail -i "X-Virus-Report: $AV_REPORT" -i "Subject: $AV_REPORT" # Since we are using the f flag, the mail is going to be delivered anyway. # And if we just added "X-Virus: Yes", we will also add another header with the scan result, and alter the subject, again, with the scan result. We use it here to add/alter a header called # formail is a filter that can alter a mail message, while keeping the correct format. # We check if the word FOUND was in the result and save "Yes" or "No" according to that # We will scan the mail with clam using the standard input, and saving the result on the AV_REPORT variableĪV_REPORT=`clamdscan -stdout -no-summary - |sed 's/^stream: //'` Mostly needed for mail-only account that have /sbin/nologin as shell # We make sure its going to use the sh shell. # Since we do not want the possibility of one procmail instance messing with another procmail instance, we use a lockfile ![]() So its going to be sent to an spam mailbox instead. # If a mail with spam-status:yes was not deleted by previous line, it could be a false positive. # And since we never touch any inbox, no lockfile is needed. # Messages with a 5 stars or higher spam level are going to be deleted right away # By using the f and w flags and no condition, SpamAssassin is going add the X-Spam headers to every single mail, and then process other recipes. You should already have SpamAssassin installed and working. Here is an example using SpamAssassin to block spam. In this example, the SpamAssassin command will add headers to the mail, with its spam status level, which later can be used by another recipe to block it, or store it on a different mailbox. If the f flag was used, the command can alter the message and keep reading recipes. For example:īy default, once a recipe's action is done, the processing is over. In that case, the mail that complies with the condition will be saved in the work inbox.Īn action can also start with a pipe, which means the message is going to be passed to the standard input of the command following the pipe. You can set the name of the lockfile after the : ConditionsĪ condition starts with an asterisk, following an extended regexp, like this one: A lockfile is necessary to prevent problems if 2 or more instances of procmail are working at the same time (that may happen if 2 or more email arrive almost at the same moment). Using a : after the :0 is to use a lockfile. w Wait for the filter or program to finish and check its exitcode (normally ignored) if the filter is unsuccessful, then the text will not have been filtered.Here is a list of some of the most used flags: But they can be necessary if your script calls an external command. The action can be only a mailbox name, or an external program.įor basic recipes, you do not need any flags. Conditions always start with an asterisk. The conditions are extended regular expressions, with some few extra options. Recipes are the main section, they are the actual filters that do the actions. The assignments section provides variables for procmail The configuration is composed of two sections assignments and recipes. To avoid this potentially embarrassing situation, turn off bounces by passing -t to procmail, or setting the DELIVERED environment variable ( procmailrc(5)). Note: Be careful when testing your procmail configuration on sample messages you have received, as messages can be automatically bounced back to sender if there is an error in your configuration file.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |