Skip to content

Commit 158c25a

Browse files
authored
Add files via upload
1 parent f413273 commit 158c25a

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

mlp/main.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import asyncio
1919
import logging
2020
import re
21-
import uuid
2221
import rethinkdb.query
2322
from enum import Enum
2423
from typing import Dict
@@ -31,6 +30,7 @@
3130
import quopri
3231
import json
3332
import os
33+
import hashlib
3434

3535
from datetime import datetime, timedelta, timezone
3636
from 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

0 commit comments

Comments
 (0)