0
@@ -99,6 +99,8 @@ CONFIG_DEFAULTS = {
0
@@ -1100,9 +1102,11 @@ def LeerConfig():
0
parser.add_option("-r", "--proxy", dest="proxy", help="addess and port of the proxy server to use")
0
parser.add_option("-a", "--threading", action="store_const", const="1", dest="threading", help="include threading headers in the emails")
0
parser.add_option("", "--subject", dest="subject", help="add a fixed text to the subject of every message")
0
- parser.add_option("", "--smtp_authentication", action="store_const", const="
0", dest="smtp_auth", help="authenticate with SMTP server")
0
+ parser.add_option("", "--smtp_authentication", action="store_const", const="
1", dest="smtp_auth", help="authenticate with SMTP server")
0
parser.add_option("", "--smtp_auth_user", dest="smtp_user", help="SMTP username used for authentication")
0
parser.add_option("", "--smtp_auth_pass", dest="smtp_pass", help="SMTP password used for authentication")
0
+ parser.add_option("", "--smtp_port", dest="smtp_port", help="TCP port on which the SMTP server listen")
0
+ parser.add_option("", "--smtp_tls", action="store_const", const="1", dest="smtp_tls", help="SMTP server uses TLS")
0
parser.add_option("", "--send_method", dest="send_method", help="Method used to send the resulting emails. Possible values: SMTP, PROCMAIL, BOTH")
0
parser.add_option("", "--procmail", dest="procmail", help="Path of the procmail script, used when SEND_METHOD=PROCMAIL or BOTH")
0
parser.add_option("", "--reverse", action="store_const", const="1", dest="reverse", help="reverse the order of emails as they are sent")
0
@@ -1154,14 +1158,17 @@ def LeerConfig():
0
-def EnviarEmails(msgs, method, server, auth, auth_user, auth_pass, procmail, reverse):
0
+def EnviarEmails(msgs, method, server, auth, auth_user, auth_pass, procmail, reverse, port, tls, sender):
0
if method.lower() in ('smtp', 'both'):
0
- smtp = smtplib.SMTP(server)
0
+ smtp = smtplib.SMTP(server, port)
0
# authenticate with SMTP server when there's need to
0
smtp.login(auth_user,auth_pass);
0
@@ -1173,7 +1180,7 @@ def EnviarEmails(msgs, method, server, auth, auth_user, auth_pass, procmail, rev
0
- fromaddr =
msg['From']
0
r = re.compile('<(.+?)>')
0
toaddr = r.findall(msg['To'])
0
@@ -1193,15 +1200,21 @@ def EnviarEmails(msgs, method, server, auth, auth_user, auth_pass, procmail, rev
0
# close the connection and reconnect every 10 messages
0
- smtp = smtplib.SMTP(server)
0
+ smtp = smtplib.SMTP(server, port)
0
# authenticate with SMTP server when there's need to
0
smtp.login(auth_user,auth_pass);
0
note = " (" + str(len(msgs)-count) +" failed)"
0
@@ -1806,7 +1819,7 @@ def MainLoop():
0
- EnviarEmails (emails, config['send_method'], config['smtp_server'], config['smtp_auth'] == '1',config['smtp_user'],config['smtp_pass'], config['procmail'], config['reverse'] == '1'
)
0
+ EnviarEmails (emails, config['send_method'], config['smtp_server'], config['smtp_auth'] == '1',config['smtp_user'],config['smtp_pass'], config['procmail'], config['reverse'] == '1'
, config['smtp_port'], config['smtp_tls'], config['sender'])
0
except KeyboardInterrupt: