rss2email and Python mastery (not)
As previously discussed, I've been using a slightly modified version of rss2email to spool feeds into my mailbox. Unfortunately, a couple of days ago it all started to go wrong. The same news items were delivered every time the collector ran.
Turned out that the server was killing the connection part way through the run, probably because postfixgot bored with waiting while a remote site was slow to respond.
Armed with my new mastery of Python (hah) I was able to replace the submission code from rss2email with:
try: serv.sendmail(fromadd, recipient, message) except: print 'sendmail failed:', sys.exc_info()[0] try: serv.quit() except: print 'sendmail quit failed:', sys.exc_info()[0] serv = smtplib.SMTP(smtpserver) serv.sendmail(fromadd, recipient, message)
Which means that, should the attempt to submit the message fail the connection is killed and re-created. Seems to work well.
listening to: Lloyd Cole And The Commotions: Forest Fire (Lloyd Cole And The Commotions-1984-89)