#------------------------------------------------
config = ConfigParser.ConfigParser()
+config.read(os.path.dirname(__file__)+'/../configs/platal.ini')
config.read(os.path.dirname(__file__)+'/../configs/platal.conf')
def get_config(sec, val, default=None):
else:
return default
-BASEURL = get_config('Core', 'baseurl')
MYSQL_USER = get_config('Core', 'dbuser')
MYSQL_PASS = get_config('Core', 'dbpwd')
h = Utils.oneline(s, 'iso-8859-1')
else:
h = s
- h = str('').join(re.split('[\x00-\x1f]+', s))
- return Utils.uquote(h.replace('&', '&').replace('>', '>').replace('<', '<'))
+ h = str('').join(re.split('[\x00-\x09\x0B-\x1f]+', h))
+ return Utils.uquote(h.replace('&', '&').replace('>', '>').replace('<', '<'))
def to_forlife(email):
try:
if raw:
return str(msg)
- results = []
+ results_plain = []
+ results_html = []
for part in typed_subpart_iterator(msg, 'text', 'plain'):
c = part.get_payload()
- if c is not None: results.append (c)
- results = map(lambda x: quote(x), results)
+ if c is not None: results_plain.append (c)
+ results_plain = map(lambda x: quote(x), results_plain)
+ for part in typed_subpart_iterator(msg, 'text', 'html'):
+ c = part.get_payload()
+ if c is not None: results_html.append (c)
+ results_html = map(lambda x: quote(x), results_html)
return {'id' : id,
'sender': quote(sender, True),
'size' : size,
'subj' : quote(subject, True),
'stamp' : ptime,
- 'parts' : results }
+ 'parts_plain' : results_plain,
+ 'parts_html': results_html }
except:
mlist.Unlock()
return 0
mlist.subject_prefix = '['+listname+'] '
mlist.max_message_size = 0
+ inverted_listname = '_'.join(listname.split('_', 1)[-1::-1])
mlist.msg_footer = "_______________________________________________\n" \
- + "Liste de diffusion %(real_name)s\n"
+ + "Liste de diffusion %(real_name)s\n" \
+ + "http://listes.polytechnique.org/members/" + inverted_listname
mlist.header_filter_rules = []
mlist.header_filter_rules.append(('X-Spam-Flag: Yes, tests=bogofilter', mm_cfg.HOLD, False))
mlist.Unlock()
+ if ON_CREATE_CMD != '':
+ try: os.system(ON_CREATE_CMD + ' ' + name)
+ except: pass
+
check_options(userdesc, perms, vhost, listname.lower(), True)
mass_subscribe(userdesc, perms, vhost, listname.lower(), members)
mlist._UpdateRecords()
mlist.Save()
mlist.Unlock()
- if ON_CREATE_CMD != '':
- try: os.system(ON_CREATE_CMD + ' ' + name)
- except: pass
except:
try:
mlist.Unlock()