File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 1818import asyncio
1919import logging
2020import re
21- import uuid
2221import rethinkdb .query
2322from enum import Enum
2423from typing import Dict
3130import quopri
3231import json
3332import os
33+ import hashlib
3434
3535from datetime import datetime , timedelta , timezone
3636from quart import jsonify
@@ -204,10 +204,13 @@ async def import_log(logfile: str) -> Dict[str, PostfixMessage]:
204204 else :
205205 #dtime, qid, msg = m.groups()
206206 qid , msg = m .groups ()
207- # process postfix NOQUEUE, generate new random qid
207+ # process postfix NOQUEUE, generate new qid based on msg and timestamp
208208 if settings .mta == 'postfix' :
209209 if qid == 'NOQUEUE' :
210- qid = str (uuid .uuid4 ().hex .upper ()[0 :11 ])
210+ newqid = str (dtime )+ msg
211+ qid = hashlib .md5 (newqid .encode ('utf-8' )).hexdigest ().upper ()[0 :11 ]
212+ #print(qid)
213+ #qid = str(uuid.uuid4().hex.upper()[0:11])
211214 #log.info(qid)
212215 #dtime, msg, qid = m.groups()
213216
You can’t perform that action at this time.
0 commit comments