Skip to content

smtplib.SMTPSenderRefused #1873

@programatix

Description

@programatix

Expected behaviour:

Email is sent. Since I've set logging to warning, usually no log is logged if successful.

Actual behaviour:

Randomly, this process would fail on executing the notifier plugin. Please note that the error doesn't always occur. Error message seems to indicate GMAIL server timeout, but I only started having this issue after flexget implements the new notifier plugin. Previously it was the email plugin directly.

However, one weird thing I noticed is that it always occurred on the task "Movies" since I never receive any email notification for movies.

Steps to reproduce:

  • Step 1: Execute the script

Config:

templates:
  anchors:
    _emailInfo: &emailInfo
      from: [email]
      to:
        - [email]
      smtp_host: smtp.gmail.com
      smtp_port: 587
      smtp_username: '{? gmail.usr ?}'
      smtp_password: '{? gmail.pwd ?}'
      smtp_tls: true    
      
  notifyViaEmail:
    notify:
      task:
        template: html
        via:
          - email:
              <<: *emailInfo
              html: yes

tasks:
  Anime:
    template:
      - cartoons
      - notifyViaEmail
    discover:
      what:
        - next_series_episodes:
            backfill: yes
            from_start: yes
      from:
        - horriblesubs: yes
      release_estimations: ignore
      interval: 1 hour

  TV Series:
    template:
      - tvseries
      - notifyViaEmail
    discover:
      what:
        - next_series_episodes:
            backfill: false
            from_start: yes
      from:
        - rarbg:
            category: [41]
            sorted_by: seeders
            ranked: false
            use_tvdb: true
      interval: 2 hour

  Movies:
    priority: 10 # run after the movie list fill task
    template:
      - movie
      - notifyViaEmail
    discover:
      what:
        - movie_list: movies
      from:
        - rarbg:
            category:
              - x264 720p
              - x264 1080p
            ranked: false
      interval: 1 hour
      release_estimations:
        optimistic: 30 days

Log:

2017-06-10 15:47 ERROR    notify_entry  Anime           (451, b'4.4.2 Timeout - closing connection. f72sm7408867pff.78 - gsmtp', 'myemail@gmail.com')
Traceback (most recent call last):
  File "/opt/lib/python3.6/site-packages/flexget/plugins/notifiers/notify.py", line 103, in send_notification
    send_notification(*args, **kwargs)
  File "/opt/lib/python3.6/site-packages/flexget/plugins/notifiers/notification_framework.py", line 117, in send_notification
    notifier.notify(title, message, rendered_config)  # TODO: Update notifiers for new api
  File "/opt/lib/python3.6/site-packages/flexget/plugins/notifiers/email.py", line 182, in notify
    self.mail_server.sendmail(email['From'], config['to'], email.as_string())
  File "/smtplib.py", line 866, in sendmail
smtplib.SMTPSenderRefused: (451, b'4.4.2 Timeout - closing connection. f72sm7408867pff.78 - gsmtp', 'programatix.email@gmail.com')

2017-06-11 01:28 ERROR    notify_entry  Movies          (451, b'4.4.2 Timeout - closing connection. 15sm9792000pfj.59 - gsmtp', 'programatix.email@gmail.com')
Traceback (most recent call last):
  File "/opt/lib/python3.6/site-packages/flexget/plugins/notifiers/notify.py", line 103, in send_notification
    send_notification(*args, **kwargs)
  File "/opt/lib/python3.6/site-packages/flexget/plugins/notifiers/notification_framework.py", line 117, in send_notification
    notifier.notify(title, message, rendered_config)  # TODO: Update notifiers for new api
  File "/opt/lib/python3.6/site-packages/flexget/plugins/notifiers/email.py", line 182, in notify
    self.mail_server.sendmail(email['From'], config['to'], email.as_string())
  File "/smtplib.py", line 866, in sendmail
smtplib.SMTPSenderRefused: (451, b'4.4.2 Timeout - closing connection. 15sm9792000pfj.59 - gsmtp', 'programatix.email@gmail.com')

Traceback (most recent call last):
  File "/opt/lib/python3.6/site-packages/flexget/plugins/notifiers/notify.py", line 103, in send_notification
    send_notification(*args, **kwargs)
  File "/opt/lib/python3.6/site-packages/flexget/plugins/notifiers/notification_framework.py", line 117, in send_notification
    notifier.notify(title, message, rendered_config)  # TODO: Update notifiers for new api
  File "/opt/lib/python3.6/site-packages/flexget/plugins/notifiers/email.py", line 182, in notify
    self.mail_server.sendmail(email['From'], config['to'], email.as_string())
  File "/smtplib.py", line 866, in sendmail
smtplib.SMTPSenderRefused: (451, b'4.4.2 Timeout - closing connection. k193sm18245489pge.43 - gsmtp', 'programatix.email@gmail.com')

Additional information:

  • FlexGet version: 2.10.56
  • Python version: 3.6.1
  • Installation method: pip
  • Using daemon (yes/no): yes
  • OS and version: Asuswrt-Merlin

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions