New option to review mail to be send
This commit is contained in:
parent
f3ea2af897
commit
4d9ac08a89
15
check.py
15
check.py
@ -12,6 +12,7 @@ SOFT_MAX_SUBMISSION = None
|
||||
HARD_MAX_SUBMISSION = None
|
||||
FROM = "Automatic VIRLI Mail Checker <virli@nemunai.re>"
|
||||
SEND_TO_REALUSER = False
|
||||
REVIEW_BEFORE_SEND = False
|
||||
BETA = False
|
||||
ALTERNATE_RESOLUTIONS = False
|
||||
|
||||
@ -107,11 +108,17 @@ running for nemunaire@nemunai.re""")
|
||||
import smtplib
|
||||
with smtplib.SMTP("localhost") as smtp:
|
||||
smtp.starttls()
|
||||
if not SEND_TO_REALUSER or REVIEW_BEFORE_SEND:
|
||||
print(msg.as_string())
|
||||
if REVIEW_BEFORE_SEND:
|
||||
import time
|
||||
for i in range(15):
|
||||
sys.stdout.write(".")
|
||||
sys.stdout.flush()
|
||||
time.sleep(1)
|
||||
if SEND_TO_REALUSER:
|
||||
smtp.send_message(msg)
|
||||
smtp.send_message(msg, to_addrs=["virli-report@nemunai.re"])
|
||||
else:
|
||||
print(msg.as_string())
|
||||
|
||||
|
||||
def readmail(fp):
|
||||
@ -214,6 +221,9 @@ if __name__ == '__main__':
|
||||
parser.add_argument('--expected-submission-hash',
|
||||
help="imposed tarball hash")
|
||||
|
||||
parser.add_argument('--review-before-send', action="store_true",
|
||||
help="Review the e-mail to be sent before sending it")
|
||||
|
||||
parser.add_argument('--beta', action="store_true",
|
||||
help="enable beta features")
|
||||
|
||||
@ -231,6 +241,7 @@ if __name__ == '__main__':
|
||||
|
||||
ALTERNATE_RESOLUTIONS = args.alternate_resolutions
|
||||
SEND_TO_REALUSER = args.real_send
|
||||
REVIEW_BEFORE_SEND = args.review_before_send
|
||||
BETA = args.beta
|
||||
|
||||
cnt, frm, subject, ref = readmail(sys.stdin.buffer)
|
||||
|
Reference in New Issue
Block a user