Changes

Jump to navigation Jump to search
2,331 bytes added ,  18:45, 28 December 2022
Line 1: Line 1:  
==Sorting mail with Maildrop or Procmail==
 
==Sorting mail with Maildrop or Procmail==
 +
 +
=== Version ===
 +
{{#smeversion: smeserver-mailsorting}}
 +
===Installation===
 +
* For sme9 and sme10
 
  yum install smeserver-mailsorting --enablerepo=smecontribs
 
  yum install smeserver-mailsorting --enablerepo=smecontribs
   Line 6: Line 11:  
Procmail or maildrop is used to process your email on the server. It follows user defined rules. Common uses are to sort mail into folders or forward selected email on to other email addresses. The rules that you define are executed as email arrives in your mailbox on the server, and are independent of your email client. If you sort to folders you will need to use a IMAP mail client to read them.
 
Procmail or maildrop is used to process your email on the server. It follows user defined rules. Common uses are to sort mail into folders or forward selected email on to other email addresses. The rules that you define are executed as email arrives in your mailbox on the server, and are independent of your email client. If you sort to folders you will need to use a IMAP mail client to read them.
    +
===Related Contribs===
 +
 +
See https://wiki.koozali.org/Email-Management
    
===Rule List===
 
===Rule List===
Line 11: Line 19:  
Each rule has links to modify or remove them.
 
Each rule has links to modify or remove them.
   −
A yes* in 'copy to' copies the email to your inbox  
+
A yes* in 'copy to' copies the email to your inbox
 +
 
 +
To forward an email to multiple addresses, place a space between them.
      Line 17: Line 27:  
A user defines a pattern for emails that if matched, an action occurs.
 
A user defines a pattern for emails that if matched, an action occurs.
   −
{{note box|Defining a mail rule that includes characters such as "'''<nowiki>[  $ . | \{ ^ + ? ( \</nowiki>''' " breaks the sort rules and standard mail deliveray in general.  It is necessary to escape these special characters in the mail rules so that the sort rules work correctly. Special characters can be entered but you must verify they do not break mail deliver and work as expected. It is recommended you only use alphanumeric, @ and spaces.}}
+
{{note box|Defining a mail rule that includes characters such as "'''<nowiki>[  $ . , ' | " \{ ^ + ? ( \</nowiki>''' " breaks the sort rules and standard mail delivery in general.  It is necessary to escape these special characters in the mail rules so that the sort rules work correctly. Special characters can be entered but you must verify they do not break mail deliver and work as expected. It is recommended you only use alphanumeric, @ and spaces.}}
 +
 
 +
The rule fields are in fact regular expressions compatible with egrep. As a result the above cited characters are interpreted as structure of the language. Refer to "man egrep" for correct syntax. As an example if you want to catch mails with the subject including "[mymailinglist]", your rule will be :
 +
\[mymailinglist\]
 +
 
 +
Also please note that that character "|" (pipe) is the default character used to separate fields in the internal database, so it is forbidden.
    
===Configuration===
 
===Configuration===
Line 39: Line 54:  
ie. deliver locally, forward or both.
 
ie. deliver locally, forward or both.
    +
{{Note box| you can force the creation and the validation of rules of a user by this command line
 +
signal-event mailsorting-conf '''user'''
 +
where '''user''' has to match a real user name on your server}}
 +
 +
====Sieve compatibility====
 +
'''Only For SME9'''
 +
 +
Once Sieve enabled by the Contrib [[dovecot-extras|smeserver-dovecot-extras]],  filter rules defined in a user's ~/.procmailrc or ~/.mailfilter file are applied prior to the mail getting passed to dovecot-lda and Sieve.
 +
If you want to prohibit the use of Sieve for a determined User
 +
db accounts  setprop USERNAME Sieve disabled
 +
signal-event mailsorting-conf
    
====Deleting duplicates====
 
====Deleting duplicates====
Line 76: Line 102:       −
===individual setting===
+
===Geekmode Rules===
   −
if you want to avoid manual editing of an individual .procmailrc
+
By design the mail user .procmailrc file is built from SME templates whenever a system update is performed. You can disable that action by enabling "geekmode", using the command below. With that done, you may write your own .procmailrc file and place it in the appropriate mail directory.
   −
  db account setprop USERNAME geekmode enabled
+
  db accounts setprop USERNAME geekmode enabled
 +
 
 +
Geekmode implies you know what you are doing when creating a custom .procmailrc file.
    
===Testing===
 
===Testing===
Line 87: Line 115:  
Send an email to USERNAME to match, check in USER2's inbox
 
Send an email to USERNAME to match, check in USER2's inbox
   −
View the logs
+
====View the logs====
   −
For Maildrop
+
* For Maildrop
  tail -50 /home/e-smith/files/users/USERNAME/mailfilter.log or
+
  tail -50 /home/e-smith/files/users/USERNAME/mailfilter.log
   −
For Procmail
+
* For Procmail
 
  tail -50 /home/e-smith/files/users/USERNAME/procmail.log
 
  tail -50 /home/e-smith/files/users/USERNAME/procmail.log
    +
====View the rules====
 +
 +
* For Maildrop
 +
less /home/e-smith/files/users/USERNAME/.mailfilter
 +
 +
* For Procmail
 +
less /home/e-smith/files/users/USERNAME/.procmailrc
 +
 +
 +
=== Bugs ===
 +
Please raise bugs under the SME-Contribs section in [http://bugs.contribs.org/enter_bug.cgi bugzilla]
 +
and select the smeserver-mailsorting component or use {{BugzillaFileBug|product=SME%20Contribs|component=smeserver-mailsorting|title=this link}}.
 +
{{#bugzilla:columns=id,product,version,status,summary |sort=id |order=desc |component=smeserver-mailsorting|noresultsmessage="No open bugs found."}}
 +
 +
 +
===Changelog===
 +
Only versions released in smecontrib are listed here.
    +
{{#smechangelog: smeserver-mailsorting}}
    
[[Category: Contrib]]
 
[[Category: Contrib]]

Navigation menu