email: Pass 'config' and 'section' through from send() to *_send()
authorW. Trevor King <wking@tremily.us>
Sat, 11 May 2013 10:52:12 +0000 (06:52 -0400)
committerW. Trevor King <wking@tremily.us>
Sat, 11 May 2013 10:52:12 +0000 (06:52 -0400)
Otherwise only the default configuration will be used, which is almost
certainly not what the user wants.

Signed-off-by: W. Trevor King <wking@tremily.us>
rss2email/email.py

index bf5ecab555121abe98c5fdb89e646c2104d24e49..1b26a18ff26655634bd3dfb9714c1de3978d9667 100644 (file)
@@ -334,8 +334,12 @@ def sendmail_send(sender, recipient, message, config=None, section='DEFAULT'):
 def send(sender, recipient, message, config=None, section='DEFAULT'):
     protocol = config.get(section, 'email-protocol')
     if protocol == 'smtp':
-        smtp_send(sender, recipient, message)
+        smtp_send(
+            sender=sender, recipient=recipient, message=message,
+            config=config, section=section)
     elif protocol == 'imap':
-        imap_send(message)
+        imap_send(message=message, config=config, section=section)
     else:
-        sendmail_send(sender, recipient, message)
+        sendmail_send(
+            sender=sender, recipient=recipient, message=message,
+            config=config, section=section)