Don't check for mail if username or password is missing
This commit is contained in:
parent
3f2ce0a570
commit
f8d6f53a24
|
@ -236,6 +236,8 @@ def email_imap_alert(username, password, server='imap.gmail.com', port=993, fold
|
||||||
import imaplib
|
import imaplib
|
||||||
import re
|
import re
|
||||||
|
|
||||||
|
if not username or not password:
|
||||||
|
return None
|
||||||
try:
|
try:
|
||||||
mail = imaplib.IMAP4_SSL(server, port)
|
mail = imaplib.IMAP4_SSL(server, port)
|
||||||
mail.login(username, password)
|
mail.login(username, password)
|
||||||
|
|
Loading…
Reference in New Issue