Don't check for mail if username or password is missing

This commit is contained in:
Kim Silkebækken 2013-01-28 14:06:19 +01:00
parent 3f2ce0a570
commit f8d6f53a24
1 changed files with 2 additions and 0 deletions

View File

@ -236,6 +236,8 @@ def email_imap_alert(username, password, server='imap.gmail.com', port=993, fold
import imaplib
import re
if not username or not password:
return None
try:
mail = imaplib.IMAP4_SSL(server, port)
mail.login(username, password)