summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pym/portage/elog/mod_mail_summary.py6
-rw-r--r--pym/portage/mail.py4
2 files changed, 9 insertions, 1 deletions
diff --git a/pym/portage/elog/mod_mail_summary.py b/pym/portage/elog/mod_mail_summary.py
index 7410f05af..d0b2577ae 100644
--- a/pym/portage/elog/mod_mail_summary.py
+++ b/pym/portage/elog/mod_mail_summary.py
@@ -4,6 +4,7 @@
# $Id$
import portage.mail, socket, os, time
+from portage.exception import PortageException
from email.MIMEText import MIMEText as TextMessage
_items = {}
@@ -48,6 +49,9 @@ def _finalize(mysettings, items):
mymessage = portage.mail.create_message(myfrom, myrecipient, mysubject,
mybody, attachments=items.values())
- portage.mail.send_mail(mysettings, mymessage)
+ try:
+ portage.mail.send_mail(mysettings, mymessage)
+ except PortageException, e:
+ print str(e)
return
diff --git a/pym/portage/mail.py b/pym/portage/mail.py
index 0c39b4cc9..cf6ebd134 100644
--- a/pym/portage/mail.py
+++ b/pym/portage/mail.py
@@ -74,7 +74,11 @@ def send_mail(mysettings, message):
try:
if int(mymailport) > 100000:
myconn = smtplib.SMTP(mymailhost, int(mymailport) - 100000)
+ myconn.ehlo()
+ if not myconn.has_extn("STARTTLS"):
+ raise portage.exception.PortageException("!!! TLS support requested for logmail but not suported by server")
myconn.starttls()
+ myconn.ehlo()
else:
myconn = smtplib.SMTP(mymailhost, mymailport)
if mymailuser != "" and mymailpasswd != "":