Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
drlight17 authored Jun 3, 2024
1 parent f413273 commit 158c25a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions mlp/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import asyncio
import logging
import re
import uuid
import rethinkdb.query
from enum import Enum
from typing import Dict
Expand All @@ -31,6 +30,7 @@
import quopri
import json
import os
import hashlib

from datetime import datetime, timedelta, timezone
from quart import jsonify
Expand Down Expand Up @@ -204,10 +204,13 @@ async def import_log(logfile: str) -> Dict[str, PostfixMessage]:
else:
#dtime, qid, msg = m.groups()
qid, msg = m.groups()
# process postfix NOQUEUE, generate new random qid
# process postfix NOQUEUE, generate new qid based on msg and timestamp
if settings.mta == 'postfix':
if qid == 'NOQUEUE':
qid = str(uuid.uuid4().hex.upper()[0:11])
newqid = str(dtime)+msg
qid = hashlib.md5(newqid.encode('utf-8')).hexdigest().upper()[0:11]
#print(qid)
#qid = str(uuid.uuid4().hex.upper()[0:11])
#log.info(qid)
#dtime, msg, qid = m.groups()

Expand Down

0 comments on commit 158c25a

Please sign in to comment.