How to enable by default "Move Spam Emails to Junk directory"

Discussion in 'ISPConfig 3 Priority Support' started by KoS, Nov 20, 2019.

  1. KoS

    KoS Member HowtoForge Supporter

    Is there a global setting to enable the "Move Spam Emails to Junk directory" setting by default for newly created users?

    I have deployed rspamd and am using the Junk folder together with a SPAM/HAM training script, but this only makes sense if the abovementioned option is being enabled -> and if I need to explain every domain owner that he needs to take care when creating new users etc.... this will get complicated and people will forget to enable it etc... I do not want to set this globally to "on", but to provide the users still the option to disable it, so the checkbox is exactly what I am looking for, but it needs to be enabled by default.

    Would there be a way to do that by changing the template if there is not global config option?

    Thanks
    KoS
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Login to phpmyadmin, go to the dbispconfig database and there to the mail_user table. There you edit the properties of the move to junk column (don't remember the exact column name, but there should be just one similar name) and change the default value. If the value is currently 'n', change it to 'y'. If its 0, change it to 1.
     
    KoS likes this.
  3. KoS

    KoS Member HowtoForge Supporter

    Thanks @till
    I know how I can mass-enable it for the users (despite having to re-sync the multi-server setup and get the sieve filter files updates),
    but this was not my question.
    My question is: how can I change the default behavior so that for NEW mailboxes the "move_junk" flag is enabled?
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    That's what I told you above. I did not dold you how to mass-enable something, I told you how to change the default for newly created mailboxes.
     
  5. KoS

    KoS Member HowtoForge Supporter

    Sorry, but it seems that either I am looking at the wrong place or we have a misunderstanding. The table that you mentioned, mail_user, contains all the mailboxes, and there is the column move_junk. So I do not understand how this should change the default setting for newly created mailboxes as this table is clearly about the specific user mailboxes and not a general setting?
     
  6. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    What till wrote was
    , meaning the default value of the database for that column. That is, the default value the database assigns to that column when a new row is created.
     
    KoS and till like this.
  7. KoS

    KoS Member HowtoForge Supporter

    @till @Taleman
    Thank you very much for the clarification and sorry, it was my fault, I missed that you meant the db table default config.
    I can confirm, it works as desired.
    I didn't thought about that ISPconfig takes over the default values from the db tables.

    As we are speaking, I thought "great, I could do the same to disable pop3 for new accounts" -> I have set the disablepop3 to "y", but it didn't had an effect on new mailboxes. So I assume not all "default values" are being taken from the DB?
     
  8. ktownmods

    ktownmods Member HowtoForge Supporter

    Hey, @KoS where can i find the right table?
     
  9. Taleman

    Taleman Well-Known Member HowtoForge Supporter

     
  10. ktownmods

    ktownmods Member HowtoForge Supporter

    Yeah, but there i can change it only for the existing users.

    I thought it works default (for all new users)
     
  11. till

    till Super Moderator Staff Member ISPConfig Developer

    You can change defaults of settings only that are not on the first tab of a form. Settings which are on the first tab need to be changed in the form file of the web form.
     
  12. KoS

    KoS Member HowtoForge Supporter

    it seems you are looking at the same wrong place as I did. You are looking at the mail_user itself and its data, but you need to change the default value of the columns itself -> e.g. in phpmyadmin on the 'Structure' tab of that table.
     
    ktownmods likes this.
  13. KoS

    KoS Member HowtoForge Supporter

    Thanks for that detail @till, that is good to know.
    Is it a technical limitation that the values on the first tab cannot be set via the default table values or is it something that you may change in the future? (is there a feature-request in gitlab related to that that I could subscribe?) Thanks.
     
  14. till

    till Super Moderator Staff Member ISPConfig Developer

    I don't think that this will get changed in future.
     

Share This Page