AlmaLinux / errata-email-notifications

GNU General Public License v3.0
0 stars 3 forks source link

SMTP error when trying to send a lot of emails #3

Open andrewlukoshko opened 1 year ago

andrewlukoshko commented 1 year ago

During testing I've tried to send all available AlmaLinux 9 advisories. After successful sending some of them I got this error:

2022-08-17 13:46:19,003 DEBUG Sending email with subject: [Security Advisory] ALSA-2022:5736: java-17-openjdk security, bug fix, and enhancement update (Important)
2022-08-17 13:46:19,022 ERROR Could not send errata notification email
2022-08-17 13:46:19,024 DEBUG Sending email with subject: [Security Advisory] ALSA-2022:5948: galera, mariadb, and mysql-selinux security, bug fix, and enhancement update (Moderate)
2022-08-17 13:46:19,025 ERROR Could not send errata notification email
2022-08-17 13:46:19,027 DEBUG Sending email with subject: [Security Advisory] ALSA-2022:6002: kernel-rt security and bug fix update (Moderate)
2022-08-17 13:46:19,028 ERROR Could not send errata notification email
2022-08-17 13:46:19,029 DEBUG Sending email with subject: [Security Advisory] ALSA-2022:5942: vim security update (Moderate)
2022-08-17 13:46:19,030 ERROR Could not send errata notification email
2022-08-17 13:46:19,031 DEBUG Sending email with subject: [Security Advisory] ALSA-2022:5904: php security update (Important)
2022-08-17 13:46:19,031 ERROR Could not send errata notification email
2022-08-17 13:46:19,033 DEBUG Sending email with subject: [Security Advisory] ALSA-2022:6043: .NET 6.0 security, bug fix, and enhancement update (Moderate)
2022-08-17 13:46:19,034 ERROR Could not send errata notification email
2022-08-17 13:46:19,035 DEBUG Sending email with subject: [Security Advisory] ALSA-2022:6003: kernel security, bug fix, and enhancement update (Moderate)
2022-08-17 13:46:19,036 ERROR Could not send errata notification email
Traceback (most recent call last):
  File "./errata-email-notifications", line 246, in <module>
    errata_notifications.run()
  File "./errata-email-notifications", line 181, in run
    self.smtp_session.close()
  File "./errata-email-notifications", line 102, in close
    self.__service.quit()
  File "/usr/lib64/python3.6/smtplib.py", line 984, in quit
    res = self.docmd("quit")
  File "/usr/lib64/python3.6/smtplib.py", line 420, in docmd
    self.putcmd(cmd, args)
  File "/usr/lib64/python3.6/smtplib.py", line 367, in putcmd
    self.send(str)
  File "/usr/lib64/python3.6/smtplib.py", line 359, in send
    raise SMTPServerDisconnected('please run connect() first')
smtplib.SMTPServerDisconnected: please run connect() first
javihernandez commented 1 year ago

Hey Andrew, sorry, I haven't had time to dig into this - had to switch to other stuff.

As we already chatted in private:

Even thought I think this deserves to be investigated and eventually fixed (in addition to add some more fine grained exception handling), we both agree that this is a corner case since:

But still, I do agree with you that there's lot of room for improvement, in particular, to make it less fragile in this kind of situations, and it's great to have people like you paying attention to these details.

I'd say that we should keep this issue opened so anybody (including me) can take it when have time for it. Deal?