# $Id$
import portage.mail, socket, os, time
+from portage.exception import PortageException
from email.MIMEText import MIMEText as TextMessage
_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
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 != "":