文件操作 - local.cf
返回文件管理
返回主菜单
删除本文件
文件: /root/sh/mail/spamassassin/local.cf
编辑文件内容
# Ross 02-12-2023 # Mi tocca scriver che il vecchio server di posta con MailEnable era mille volte meglio # Tutti questi servizi sono un gran casino per connetterli tra di loro # Comunque la conf. di Spamassassin con Amavisd è da rifare # Questo perchè è Amvisd che controlla spamassassin e non Postfix # # Quindi devo prendere tempo magari a Natale per configurare bene # Un riferimento è qui ma sono sempre tutti da controllare perchè # il copia incolla è lo sport preferito di questi tempi # https://wiki.gentoo.org/wiki/Complete_Virtual_Mail_Server/amavisd_spamassassin_clamav # ********************************************************************** # # 22-10-2025 # Mi tocca mettere la whitelist pure qui! # # https://cwiki.apache.org/confluence/display/spamassassin/ManualWhitelist # # ********************************************************************** whitelist_from *@pegasoscarl.it whitelist_from *@foritec.it whitelist_from *@flamedilizia.it whitelist_from pegasoscarl.it whitelist_from foritec.it whitelist_from flamedilizia.it whitelist_from studio@ram-aa.it whitelist_from ram-aa.it whitelist_from fise.it whitelist_from nordikfer.it # These values can be overridden by editing ~/.spamassassin/user_prefs.cf # (see spamassassin(1) for details) # These should be safe assumptions and allow for simple visual sifting # without risking lost emails. # ORIGINALE ERA : # required_hits 5 # report_safe 0 # rewrite_header Subject [SPAM] # report_safe { 0 | 1 | 2 } (default: 1) # if this option is set to 1, if an incoming message is tagged as spam, instead of modifying the original message, # SpamAssassin will create a new report message # and attach the original message as a message/rfc822 MIME part # (ensuring the original message is completely preserved, not easily opened, and easier to recover). # If this option is set to 2, then original messages will be attached with a content type of text/plain instead of message/rfc822. # This setting may be required # for safety reasons on certain broken mail clients that automatically load attachments without any action by the user. # This setting may also make it somewhat # more difficult to extract or view the original message. report_safe 0 # If this option is set to 0, incoming spam is only modified by adding some X-Spam- headers and no changes will be made to the body. # In addition, a header named X-Spam-Report will be added to spam. You can use the remove_header option to remove that header after setting report_safe to 0. # required_hits n.nn (default: 5) # Set the number of hits required before a mail is considered spam. n.nn can be an integer or a real number. 5.0 is the default setting, # and is quite aggressive; # it would be suitable for a single-user setup, but if you're an ISP installing SpamAssassin, you should probably set the default to be more conservative, # like 8.0 or 10.0. It is not recommended to automatically delete or discard messages marked as spam, as your users will complain, # but if you choose to do so, only delete messages with an exceptionally high score such as 15.0 or higher. # variato da 5 a 4 il gg 13-10 perchè arrivano alcune mail farlocche che chiedono pagamenti vari # variato da 5 a 3.5 arrivano mail farlocche e ho seguito i consigli di qui: https://linuxgazette.net/105/youngman.html # required_hits 4 # https://wiki.centos-webpanel.com/how-to-configure-spamassassin #rewrite_header Subject ***SPAM*** # report_safe 1 # trusted_networks 212.17.35. # required_score 6.0 # use_bayes 1 # bayes_auto_learn 1 # bayes_ignore_header X-Bogosity # bayes_ignore_header X-Spam-Flag # bayes_ignore_header X-Spam-Status # include /usr/share/spamassassin/ # Delle volte non riporta nell'header lo score # vedere qui: https://hmailserver.com/forum/viewtopic.php?t=36954 # Oppure qui https://askubuntu.com/questions/512564/missing-x-spam-status-header # nel secondo esempio è Amavids che non riporta l'header per SPAM <2.00 # Allora modificare riga #97 di /etc/amavisd/amavisd.conf ( var $sa_tag_level_deflt = 2.0; # add spam info headers if at, or above that level ) # Forse non c'è bisogno di aggiungere queste righe perchè è Amvisd che controlla l'header # add_header all Score _SCORE_ # add_header spam Flag _YESNOCAPS_ # add_header all Status _YESNO_, score=_SCORE_ required=_REQD_ tests=_TESTS_ autolearn=_AUTOLEARN_ version=_VERSION_ # add_header all Level _STARS(*)_ # add_header all Checker-Version SpamAssassin _VERSION_ (_SUBVERSION_) on _HOSTNAME_ # https://janikarhunen.fi/tackle-spam-with-spamassassin-on-centos-7-and-postfix # required_hits 4.0 This option was previously known as required_hits and that name is still accepted, but is deprecated report_safe 0 required_score 5.0 rewrite_header Subject [SPAM] # Questo non serve, fa solo confusione !! # include /usr/share/spamassassin/ # Da finire conf Bayes ( ritorna errore path non valida con questa conf ) # bayes_path /etc/mail/spamassassin/bayes use_bayes 0 bayes_auto_learn 0 bayes_file_mode 0660 bayes_learn_to_journal 1 bayes_ignore_header X-Bogosity bayes_ignore_header X-Spam-Flag bayes_ignore_header X-Spam-Status # Ross 22-02-2022 da aggiungere e provare --> https://forums.zimbra.org/viewtopic.php?t=65628 loadplugin Mail::SpamAssassin::Plugin::SPF score SPF_FAIL 5.000 score SPF_HELO_FAIL 1.000 score SPF_PASS -0.010 score SPF_SOFTFAIL 3.000 # 11-11-2025 Usando questo blocca le email tramite le richieste ai server # con la lista delgi spam. Ma c'è un problema. Le richieste sono limitate # e causano un errore una volta superati i limiti. # Qui c'è una soluzione ma devo provarla: # https://talk.plesk.com/threads/spamassasin-with-dnsbl-avoiding-uribl_blocked.351514/ # bisogna cambiare l'IP del file 65_dns.cf containing nella riga dns_server # dns_server 127.0.0.1 # I managed to make spamassassin use bind to resolve DNSBL requests, bypassing my ISPs DNS cache and making DNSBL work properly. # score URIBL_BLOCKED 5.000 loadplugin Mail::SpamAssassin::Plugin::SpamCop # 02-12-2023 sto cercando di fare il looup su UCEPROTECTL2 # in modo da fare uno score, perchè da postfix fa solo il reject # ho trovato questi link # https://www.aligrant.com/web/blog/2018-04-07_adding_custom_rbl_dns_lookups_to_spamassassin # # header CUSTOM_LOOKUP_1 eval:check_rbl_txt('dnsrbl','dnsrbl.org.') # describe CUSTOM_LOOKUP_1 Entries listed in dnsrbl.org RBL # score CUSTOM_LOOKUP_1 2.0 # ifplugin Mail::SpamAssassin::Plugin::DNSEval # dnsbl-1.uceprotect.net header RCVD_IN_UCEPROTECT1 eval:check_rbl('uceprotect1-lastexternal','dnsbl-1.uceprotect.net.') describe RCVD_IN_UCEPROTECT1 Received via a relay in dnsbl-1.uceprotect.net tflags RCVD_IN_UCEPROTECT1 net # dnsbl-2.uceprotect.net # header RCVD_IN_UCEPROTECT2 eval:check_rbl('uceprotect2-lastexternal','dnsbl-2.uceprotect.net.') # describe RCVD_IN_UCEPROTECT2 Received via a relay in dnsbl-2.uceprotect.net # tflags RCVD_IN_UCEPROTECT2 net # dnsbl-3.uceprotect.net # header RCVD_IN_UCEPROTECT3 eval:check_rbl('uceprotect3-lastexternal','dnsbl-3.uceprotect.net.') # describe RCVD_IN_UCEPROTECT3 Received via a relay in dnsbl-3.uceprotect.net # tflags RCVD_IN_UCEPROTECT3 net # endif score RCVD_IN_UCEPROTECT1 1.0 # score RCVD_IN_UCEPROTECT2 1.0 # score RCVD_IN_UCEPROTECT3 1.0 # ok_locales xx [ yy zz ... ] (default: all) # This option is used to specify which locales are considered OK for incoming mail. Mail using the character sets that are allowed by this option will not be marked as possibly being spam in a foreign # # language. # If you receive lots of spam in foreign languages, and never get any non-spam in these languages, this may help. Note that all ISO-8859-* character sets, and Windows code page character sets, are always # permitted by default. # Set this to all to allow all character sets. This is the default. # The rules CHARSET_FARAWAY, CHARSET_FARAWAY_BODY, and CHARSET_FARAWAY_HEADERS are triggered based on how this is set. # Examples: # ok_locales all (allow all locales) # ok_locales en (only allow English) # ok_locales en ja zh (allow English, Japanese, and Chinese) # Note: if there are multiple ok_locales lines, only the last one is used. # Select the locales to allow from the list below: # ok_locales en it # Controllo che la impo della configurazione è esatta # /usr/bin/spamassassin --lint # Ross 26-08-2022 arrivano mail con body base64 ma postfix nel body check non # le intercetta # per cui bisogna usare Spamassassin: questo è l'articolo # https://rotadev.com/how-can-i-reject-base64-encoded-spam-email-server-fault/ # ----------- PER ORA NON ABILITATO ASPETTO S ENE ARRIVANO ALTRE MAIL FAKE # body LOCAL_BLOCCAARUBA /ti informiamo che il dominio a cui/ # score LOCAL_BLOCCAARUBA 7.0 # describe LOCAL_BLOCCAARUBA Block word ti informiamo che il dominio a cui # ***** Questi 3 qui sotto sono da configurare # DCC # use_dcc 1 # dcc_home /etc/dcc # dcc_home /var/dcc # dcc_path /usr/bin/dccproc #dcc_path /usr/local/bin/dccproc # dcc_timeout 10 # add_header all DCC _DCCB_: _DCCR_ # score DCC_CHECK 4.000 # Pyzor # use_pyzor 1 # pyzor_options --homedir /etc/mail/spamassassin/.pyzor # pyzor_path /usr/bin/pyzor # add_header all Pyzor _PYZOR_ # score PYZOR_CHECK 3.000 # Razor # use_razor2 1 # razor_config /etc/mail/spamassassin/.razor/razor-agent.conf # score RAZOR2_CHECK 3.000
修改文件时间
将文件时间修改为当前时间的前一年
删除文件