diff --git a/mail.py b/mail.py
index 262db54ac1950338a01329a36d6a12c71a00c2c1..413390ec05ffd907f6df3b104b6c203416143427 100644
--- a/mail.py
+++ b/mail.py
@@ -14,7 +14,7 @@ def send_message(msgtype, recipients, **kwargs):
 	try:
 		msg['Subject'] = render_template('mails/'+msgtype+'.subject', **kwargs)
 		msg.set_content(render_template('mails/'+msgtype+'.body', **kwargs))
-		if 'MAIL_SERVER' not in config:
+		if not config.get('MAIL_SERVER'):
 			return
 		s = smtplib.SMTP(config['MAIL_SERVER'])
 		if config.get('MAIL_ADDRESS_OVERWRITE'):