%PDF- %PDF-
Direktori : /lib/mailman/Mailman/Handlers/ |
Current File : //lib/mailman/Mailman/Handlers/SpamDetect.pyc |
� ��ac @ s d Z d d l Z d d l m Z d d l m Z d d l m Z d d l m Z d d l m Z d d l m Z d d l m Z y e e f Wn e k r� d Z d Z n Xd � Z d e j f d � � YZ d e j f d � � YZ e j Z d d � Z d � Z d S( s9 Do more detailed spam detection. This module hard codes site wide spam detection. By hacking the KNOWN_SPAMMERS variable, you can set up more regular expression matches against message headers. If spam is detected the message is discarded immediately. TBD: This needs to be made more configurable and robust. i����N( t HeaderParseError( t decode_header( t mm_cfg( t Errors( t i18n( t GetCharSet( t hold_for_approvali i c C s | S( N( ( t s( ( si /builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Handlers/SpamDetect.pyt _/ s t SpamDetectedc B s e Z d Z RS( s The message contains known spam( t __name__t __module__t __doc__( ( ( si /builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Handlers/SpamDetect.pyR 4 s t HeaderMatchHoldc B s e Z e d � Z RS( s) The message headers matched a filter rule( R R R t reason( ( ( si /builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Handlers/SpamDetect.pyR 7 s s utf-8c C s� d } x� | j � D]� \ } } d } y t t j d d | � � } Wn t k rf | d f g } n Xx9 | D]1 \ } } | s� d } n | t | | d � 7} qn W| d | | j | d � f 7} q W| S( so Returns a string containing all the headers of msg, unfolded and RFC 2047 decoded and encoded in cset. t u s \st s us-asciit replaces %s: %s ( t itemsR t ret subR t unicodet encode( t msgt csett headerst ht vt uvaluet fragt cs( ( si /builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Handlers/SpamDetect.pyt getDecodedHeaders@ s $c C s� | j d � r d Sxg t j D]\ \ } } t j | t j � } x8 | j | g � D]$ } | j | � } | rQ t � qQ qQ Wq Wd } t | j � } x'