1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice

Spamassassin user prefs template

Discussion in 'Plesk for Linux - 8.x and Older' started by liquorvicar, Sep 9, 2005.

  1. liquorvicar

    liquorvicar Guest

    does anyone know where Plesk reads the default user_prefs from when you create a new mail name?

    i'd like to amend them so the default is not to include the original message as an attachment.

  2. jamesyeeoc

    jamesyeeoc Guest

    I believe Plesk keeps it in mySQL.

    Database: psa
    Table: sa_conf

    each field has a default value.

    Field: spam_action
    Default: save
    Type: enum('delete', 'save')

    So I guess you would change it to delete.
  3. liquorvicar

    liquorvicar Guest

    not quite what i was after. that table controls the SA settings as visible from the CP. what i'm after is the user_prefs file saved as
    my default looks like this:
    required_hits 7
    rewrite_subject 1
    subject_tag *****SPAM*****

    i want to add:
    report_safe 0
    use_terse_report 1
    report_header 1

    to each one so that SA just changes the subject line and headers of the original message.
  4. ProfiTiger

    ProfiTiger Guest

  5. jamesyeeoc

    jamesyeeoc Guest

    Hmmm, I am not sure what table you are looking at, but on mine, the sa_conf table shows the following fields (default value):

    flt_enabled (both)
    rw_subject_tag (*****SPAM*****)
    hits_required (7)

    Looks like the table to me....
  6. ProfiTiger

    ProfiTiger Guest

    Hi jamesyeeoc,
    I think we are talking about SA-configuration per-user, not server-wide-settings. SA can be configured server-wide with the file /etc/mail/spamassassin/local.cf. Here is the behavoir of SA (like scoring, use of razor, pyzor, dcc and so on) defined. This can be done also on a per-user-configuration with the file user_prefs in /var/qmail/mailnames/domain.tld/mailname.
    With this file (equal to local.cf), you can specify user-specific settings for SA, so each user can use his own bayes-database. Some lines of this file are equal to data in sa_conf (required_hits 7, rewrite_subject 1, subject_tag *****SPAM*****). So I think plesk stores these settings in sa_conf and generates with this data the user_prefs-file for SA.
    The problem of liquorvicar and me is, that we want to modify the "default" user_prefs, which is generated (by script?) or copied on mailbox-creation so that we don't have to edit or copy this file manualy for each new mailbox. I asked the same question in http://forum.plesk.com/showthread.php?s=&threadid=27091 (Thought, "Installation and 'How Do I' Questions" is the right place for this question).
    Here is a sample of my user_prefs:
    required_hits 4
    rewrite_subject 1
    subject_tag ***SPAM***:
    check_mx_attempts 2
    check_mx_delay 5
    dns_available yes
    report_safe 1
    use_terse_report 1
    use_bayes 1
    score RCVD_IN_BL_SPAMCOP_NET 0 2.25 0 1.50
    score RCVD_IN_MAPS_RBL 1
    score FAKED_UNDISC_RECIPS 2.899 2.694 2.800 2.700
    score GAPPY_SUBJECT 2.326 1.316 2.696 2.270
    score FROM_OFFERS 4.300 3.932 4.095 4.100
    score ADVERT_CODE 2.899 1.578 2.633 1.817
    score BAYES_60 0 0 1.250 1.250
    score BAYES_70 0 0 2.000 2.000
    score BAYES_80 0 0 4.250 4.250
    score BAYES_90 0 0 5.500 5.500
    score BAYES_99 0 0 7.750 7.750
    bayes_auto_learn 1
    bayes_auto_learn_threshold_nonspam 0.3
    bayes_auto_learn_threshold_spam 4.0
    auto_learn 1
    auto_learn_threshold_spam 5
    auto_learn_threshold_nonspam 0
    bayes_expiry_max_db_size 10240000
    skip_rbl_checks 0
    use_razor2 1
    razor_timeout 10
    use_dcc 1
    use_pyzor 1
    ok_languages all
    ok_locales all
    As you can see, only the 3 first lines are similar to SA-settings in CP. And it is very bad to check the server from time to time for new mailboxes and than copy /edit the user_prefs-file.
    I'm searching a way to make this automaticly on mailbox-creation.

    Greets from Germany
  7. jamesyeeoc

    jamesyeeoc Guest

    Hi, yes I know you were talking about per user. As far as I know/knew, it took the basic per user settings from that table. I have been unable to find any other file where it matched on those 3 items exactly, so unless they have it hard coded into their encrypted source scripts, the database table is the only place I know of that those entries exist exactly as Plesk uses on new user creation.

    Your sample user_prefs looks more like mine on the systems were I have replaced the Plesk version with the full SA. On servers which are running the standard Plesk SA, I never see it create nearly that many options by default.
  8. ProfiTiger

    ProfiTiger Guest

    Hi, this is "my sample", not the one by plesk ;-) I took loong time to build this file and to configure Plesk-SA to work fine with rules_du_jour, pyzor and so on... But now, nearly 99% of spam are detected. Everything is fine now, only this file has to be copied to each new mailbox. I wish, my plesk could create nearly that many options by default ;-)
  9. Griffith

    Griffith Guest

    Could you please explain how you have configured spamassassin to work with pyzor ++?
  10. ProfiTiger

    ProfiTiger Guest

    Not a big thing. I'm not a shell-freak, but I found a webpage with instruction bout it (sorry, forgott the url, can't find it quick), followed them did an install of pyzor and razor (http://razor.sourceforge.net/docs/install.php). After that, I modified local.cf and user_prefs. That's it...
  11. Griffith

    Griffith Guest


    I installed DCC and pyzor from ART.. worked ;)
  12. Jllynch

    Jllynch Regular Pleskian

    Nov 11, 2003
    Likes Received:
    Hi profitiger,
    I implemented your per user settings exactly as above but the mesages come up with the following for example;

    X-Spam-Status: Yes, hits=5.2 required=4.0 tests=BAYES_40,DCC_CHECK, HTML_MESSAGE,RAZOR2_CF_RANGE_51_100,RAZOR2_CHECK autolearn=no version=2.63

    Is that right for autolearn? I read your config to mean that when above 4 hits it would auto learn it. Or has it auto learned it with bayes_auto_learn? If so why isn't bayes_auto_learn mentioned in the header?

    Australian Hosting
  13. ProfiTiger

    ProfiTiger Guest

    Hi Jllynch,
    I'm not really sure, which of the two settings (bayes_auto_learn_threshold_spam 4.0, auto_learn_threshold_spam 5) is the right one for SA 2.63, because SA changed some settings on version 3.
    You can try to set "auto_learn_threshold_spam" to 4, perhaps this would help. But there are some special cases for SA to stop autolearn. From the SA-Homepage (Mail_SpamAssassin_Conf. ):
    bayes_auto_learn ( 0 | 1 ) (default: 1)
    Whether SpamAssassin should automatically feed high-scoring mails (or low-scoring mails, for non-spam) into its learning systems. The only learning system supported currently is a naive-Bayesian-style classifier.
    Note that certain tests are ignored when determining whether a message should be trained upon:
    - rules with tflags set to 'learn' (the Bayesian rules) - rules with tflags set to 'userconf' (user white/black-listing rules, etc) - rules with tflags set to 'noautolearn'Also note that auto-training occurs using scores from either scoreset 0 or 1, depending on what scoreset is used during message check. It is likely that the message check and auto-train scores will be different.
    bayes_auto_learn_threshold_spam n.nn (default: 12.0)
    The score threshold above which a mail has to score, to be fed into SpamAssassin's learning systems automatically as a spam message.
    Since I turned on automatic deletion of email with score >=4, I recieve no spammails for looking into the header for autolearn. I turned of deletion for testing purposes.
    *ding* there is one. Here is the information from header:
    X-Spam-Status: Yes, score=4.4 required=4.0 tests=DEAR_SOMETHING,
    RCVD_IN_DSBL,RCVD_IN_SORBS_DUL autolearn=spam version=3.0.4
    So I think, SA < 3.0 uses other settings than SA >=3. In my actual user-prefs, there is only "bayes_auto_learn_threshold_spam 4.0".
    I hope this helps (but I think not...)