setup_basic_mailserver_with_postfix_dovecot_sieve

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revisionBoth sides next revision
setup_basic_mailserver_with_postfix_dovecot_sieve [02.01.2020 09:01] – [future improvements] Pascal Sutersetup_basic_mailserver_with_postfix_dovecot_sieve [02.01.2020 11:56] – [future improvements] Pascal Suter
Line 476: Line 476:
   * a solution on how to use imap sieve filters to trigger a bash script when a mail is moved into a specific folder can be found in the [[https://workaround.org/ispmail/buster/filtering-out-spam-with-rspamd-2/|all mighty ISPmail tutorial]]   * a solution on how to use imap sieve filters to trigger a bash script when a mail is moved into a specific folder can be found in the [[https://workaround.org/ispmail/buster/filtering-out-spam-with-rspamd-2/|all mighty ISPmail tutorial]]
  
-=== tag and deliver spam instead of quarantine === 
-I'm not sure I or my users would be happy with waiting for reports to find out why a recently sent mail did not reach them. after all it's always a good feeling if you can tell someone on the phone that you didn't find their email in your spam folder either, to convince them that they might have had a typo in your email address :) ..  
- 
-i've started this already. First you need to make sure that spam is no longer quarantined but instead marked and forwarded.  
- 
-in the PMG web interface click on ''Mail Filter'' in the left column. you will now see a list of all active or inactive mail filters. by selecting a filter, you can then see on the right hand side column which actions will be executed. you can simply remove the Quarantine action from the active ones and then drag and drop the "Modify subject" up to activate it.  
- 
-now on to your postfix mail server.. we need to add a global sieve rule to dovecot that will move spam into a spam folder.. edit ''/etc/dovecot/conf.d/90-sieve.conf'' and look for "sieve_after" templates.. add a new line after those that looks like this:  
-  sieve_after = /etc/dovecot/sieve-after 
-now create the sieve-after directory:  
-  mkdir /etc/dovecot/sieve-after 
-all filters found in this directory will be executed AFTER each user's own filters. so a user can create his own filters to whitelist spam in our case.  
-<code> 
-cat > /etc/dovecot/sieve-after/spam-to-folder.sieve <<EOF 
-require ["fileinto","mailbox"]; 
- 
-if header :contains "X-SPAM-LEVEL" { 
- fileinto :create "INBOX.Junk"; 
- stop; 
-} 
-EOF 
-</code> 
-** this filter won't compile.. i need to fix this!** 
-now compile the sieve filter:  
-  sievec /etc/dovecot/sieve-after/spam-to-folder.sieve 
  
 ==== adjustments to postfix settings on our mailserver ==== ==== adjustments to postfix settings on our mailserver ====
  • setup_basic_mailserver_with_postfix_dovecot_sieve.txt
  • Last modified: 20.03.2021 07:47
  • by Pascal Suter