dovecot sieve tutorial

Discussion in 'ISPConfig 3 Priority Support' started by misterm, Dec 12, 2017.

  1. misterm

    misterm Member HowtoForge Supporter

    Hello
    I found this for the configuration is the adaptation of dovecot sieve to add spam to the junk folder:
    https://wiki2.dovecot.org/HowTo/AntispamWithSieve
    My question is, is this adaptation good or should it be modified to work well with ISPConfig?

    Thank you for your help
    Mz
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    ISPConfig has a sieve spam to junk folder function implemented, just enable the move to junk checkbox in the mailbox settings.
     
  3. misterm

    misterm Member HowtoForge Supporter

    Ok, Till, good news
    If integration is done with Rspamd, that's my case.
    I have to make a change in my configuration?
    thanks for your help
    Mz
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    If rspamd is not setting a mail header flag X-Spam-Flag: YES then you have to adjust the sieve_filter_1.2.master sieve template on your server.
     
  5. misterm

    misterm Member HowtoForge Supporter

    till, no other info should fit to what you show me to the answer you give me?
    as for example this "/usr/lib/dovecot/sieve/report-spam.sieve" which sends the info when the user says that it is spam or that the server says that it is likely to be spam
    " /usr/lib/dovecot/sieve/report-ham.sieve"

    Mz
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    What ISPConfig is moving emails that have a spam header to the junk folder. What you posted now is something different, it's not about moving mails to junk, its a kind of feedback system to report false positives back to an bayes learner or similar. Such a system is not used or implemented in ISPConfig, if you want to use it then you will have to build that up yourself.
     
  7. misterm

    misterm Member HowtoForge Supporter

    Hello Till
    I have this as info:
    Mz
     
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    What is in the line X-Spamd-Result: when the email is spam?
     
  9. misterm

    misterm Member HowtoForge Supporter

    Yes :
    Code:
    X-Spamd-Result: default: False [-0.45 / XX.00]
     
  10. till

    till Super Moderator Staff Member ISPConfig Developer

    The part that moves mail to junk in the sieve master file is this (exists in two places):

    Code:
    # Move spam to spam folder
    if header :contains "X-Spam-Flag" "YES" {
      fileinto "Junk";
      # Stop here so that we do not reply on spams
      stop;
    }
    I just took a look at the rspamd docs and it seems as if there is an additional header
    X-Spamd-Bar: which might be easier to use here. When you change the sieve master code to e.g.:

    Code:
    # Move spam to spam folder
    if header :contains "X-Spamd-Bar" "+++" {
      fileinto "Junk";
      # Stop here so that we do not reply on spams
      stop;
    }
    then emails where X-Spamd-Bar contains '+++' will be filtered out. You might have to adjust the filter level by using more or less plus'es. Please note that you have to deactivate the move to junk ckeckbox, save, and activate it again in case it is already active to get the new config written for that specific mailbox.
     
  11. misterm

    misterm Member HowtoForge Supporter

    Hello Till
    via this tutorial under debian 9 :
    This is the right way to move spam into the right folder.

    Mz
     
  12. till

    till Super Moderator Staff Member ISPConfig Developer

    This is the way that ISPConfig is doing it already. So this whole thread is obsolete then. you should just have done what I suggested you in the first answer.
     
  13. ztk.me

    ztk.me ISPConfig Developer ISPConfig Developer

  14. ztk.me

    ztk.me ISPConfig Developer ISPConfig Developer

Share This Page