rss2email: add debug logging for smtp_send() and sendmail_send().
authorW. Trevor King <wking@tremily.us>
Thu, 18 Oct 2012 16:22:05 +0000 (12:22 -0400)
committerW. Trevor King <wking@tremily.us>
Thu, 18 Oct 2012 16:22:05 +0000 (12:22 -0400)
rss2email.py

index cd9fb7176f85a1466a23a2fb4f402ff6b285b401..20f2dc1a0d031acc1e9c1ab18a4144af4d89330f 100755 (executable)
@@ -468,6 +468,7 @@ def smtp_send(sender, recipient, message, config=None, section='DEFAULT'):
     if config is None:
         config = CONFIG
     server = CONFIG.get(section, 'smtp-server')
+    LOG.debug('sending message to {} via {}'.format(recipient, server))
     ssl = CONFIG.getboolean(section, 'smtp-ssl')
     if ssl:
         smtp = _smtplib.SMTP_SSL()
@@ -497,6 +498,8 @@ def smtp_send(sender, recipient, message, config=None, section='DEFAULT'):
 def sendmail_send(sender, recipient, message, config=None, section='DEFAULT'):
     if config is None:
         config = CONFIG
+    LOG.debug(
+        'sending message to {} via /usr/sbin/sendmail'.format(recipient))
     try:
         p = _subprocess.Popen(
             ['/usr/sbin/sendmail', recipient],