X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=bin%2Flists.rpc.py;h=67abde06b0b4792e7789cd9c0b43fe14e269a14c;hb=8c45a4c4d03ee568b4d79e1bf7abce67ebac4315;hp=ea7e412ed59fd3cdb6e6e7c29925f5e2fe5efb58;hpb=25112e7afb16a4625be821fa5ff45e8c640dc57b;p=platal.git diff --git a/bin/lists.rpc.py b/bin/lists.rpc.py index ea7e412..67abde0 100755 --- a/bin/lists.rpc.py +++ b/bin/lists.rpc.py @@ -528,17 +528,24 @@ def get_pending_ops(userdesc, perms, vhost, listname): helds = [] for id in mlist.GetHeldMessageIds(): ptime, sender, subject, reason, filename, msgdata = mlist.GetRecord(id) + fpath = os.path.join(mm_cfg.DATA_DIR, filename) try: - size = os.path.getsize(os.path.join(mm_cfg.DATA_DIR, filename)) + size = os.path.getsize(fpath) except OSError, e: if e.errno <> errno.ENOENT: raise continue + try: + msg = readMessage(fpath) + fromX = msg.has_key("X-Org-Mail") + except: + pass helds.append({ 'id' : id, 'sender': quote(sender, True), 'size' : size, 'subj' : quote(subject, True), - 'stamp' : ptime + 'stamp' : ptime, + 'fromx' : fromX }) if dosave: mlist.Save() mlist.Unlock() @@ -687,10 +694,10 @@ def get_bogo_level(userdesc, perms, vhost, listname): if mlist.header_filter_rules == []: return 0 try: - action = mlist.header_filter_rules[1][1] + action = mlist.header_filter_rules[2][1] return 2 except: - action = mlist.header_filter_rules[0][1] + action = mlist.header_filter_rules[1][1] if action == mm_cfg.HOLD: return 1 if action == mm_cfg.DISCARD: @@ -708,11 +715,14 @@ def set_bogo_level(userdesc, perms, vhost, listname, level): return 0 hfr = [] if int(level) is 1: + hfr.append(('X-Spam-Flag: Unsure, tests=bogofilter', mm_cfg.HOLD, False)) hfr.append(('X-Spam-Flag: Yes, tests=bogofilter', mm_cfg.HOLD, False)) elif int(level) is 2: + hfr.append(('X-Spam-Flag: Unsure, tests=bogofilter', mm_cfg.HOLD, False)) hfr.append(('X-Spam-Flag: Yes, tests=bogofilter, spamicity=(0\.999999|1\.000000)', mm_cfg.DISCARD, False)) hfr.append(('X-Spam-Flag: Yes, tests=bogofilter', mm_cfg.HOLD, False)) elif int(level) is 3: + hfr.append(('X-Spam-Flag: Unsure, tests=bogofilter', mm_cfg.HOLD, False)) hfr.append(('X-Spam-Flag: Yes, tests=bogofilter', mm_cfg.DISCARD, False)) if mlist.header_filter_rules != hfr: mlist.Lock()