bstascavage / plexReport

Scripts to generate a weekly email of new additions to Plex
66 stars 17 forks source link

Error sending gmail #58

Closed elRadix closed 9 years ago

elRadix commented 9 years ago

I cant send a gmail anymore. How can this be fixed ?

root@DD-WRT:/opt/plexReport# /usr/local/sbin/plexreport -t 
/var/lib/gems/2.1.0/gems/mail-2.6.3/lib/mail/core_extensions/string.rb:26:in `=~': invalid byte sequence in US-ASCII (ArgumentError)
    from /var/lib/gems/2.1.0/gems/mail-2.6.3/lib/mail/core_extensions/string.rb:26:in `!~'
    from /var/lib/gems/2.1.0/gems/mail-2.6.3/lib/mail/core_extensions/string.rb:26:in `blank?'
    from /var/lib/gems/2.1.0/gems/mail-2.6.3/lib/mail/body.rb:36:in `initialize'
    from /var/lib/gems/2.1.0/gems/mail-2.6.3/lib/mail/message.rb:2012:in `new'
    from /var/lib/gems/2.1.0/gems/mail-2.6.3/lib/mail/message.rb:2012:in `process_body_raw'
    from /var/lib/gems/2.1.0/gems/mail-2.6.3/lib/mail/message.rb:1244:in `body'
    from /var/lib/gems/2.1.0/gems/mail-2.6.3/lib/mail/message.rb:2038:in `identify_and_set_transfer_encoding'
    from /var/lib/gems/2.1.0/gems/mail-2.6.3/lib/mail/message.rb:1792:in `ready_to_send!'
    from /var/lib/gems/2.1.0/gems/mail-2.6.3/lib/mail/message.rb:1810:in `encoded'
    from /var/lib/gems/2.1.0/gems/mail-2.6.3/lib/mail/check_delivery_params.rb:12:in `check_delivery_params'
    from /var/lib/gems/2.1.0/gems/mail-2.6.3/lib/mail/network/delivery_methods/smtp.rb:98:in `deliver!'
    from /var/lib/gems/2.1.0/gems/mail-2.6.3/lib/mail/message.rb:252:in `deliver!'
    from /var/lib/plexReport/mailReport.rb:93:in `block in sendMail'
    from /var/lib/plexReport/mailReport.rb:84:in `each'
    from /var/lib/plexReport/mailReport.rb:84:in `sendMail'
    from /usr/local/sbin/plexreport:381:in `main'
    from /usr/local/sbin/plexreport:385:in `<main>'
bstascavage commented 9 years ago

What does your config look like?

bstascavage commented 9 years ago

Following up on this.

elRadix commented 9 years ago

this is the content of the config


email: title: TV and Movies plex: server: xxx.xxx.xx api_key: xxxxxx mail: address: smtp.gmail.com port: '587' username: xxxx@gmail.com password: xxxxx from: Plex Updates subject: Weekly Updates of Series and Movies


sending mail works only with the test command /usr/local/sbin/plexreport -t -d

elRadix commented 9 years ago

just tried again without -t command


root@xxxx:/etc/plexReport# /usr/local/sbin/plexreport -d /var/lib/gems/2.1.0/gems/mail-2.6.3/lib/mail/check_delivery_params.rb:9:in check_delivery_params': An SMTP To address is required to send a message. Set the message smtp_envelope_to, to, cc, or bcc address. (ArgumentError) from /var/lib/gems/2.1.0/gems/mail-2.6.3/lib/mail/network/delivery_methods/smtp.rb:98:indeliver!' from /var/lib/gems/2.1.0/gems/mail-2.6.3/lib/mail/message.rb:252:in deliver!' from /var/lib/plexReport/mailReport.rb:93:inblock in sendMail' from /var/lib/plexReport/mailReport.rb:84:in each' from /var/lib/plexReport/mailReport.rb:84:insendMail' from /usr/local/sbin/plexreport:381:in main' from /usr/local/sbin/plexreport:385:in

'

bstascavage commented 9 years ago

Ok, so when you run it with -t it works, but doesn't when you don't?

Can you give me the output of:

https://plex.tv/pms/friends/all

?

elRadix commented 9 years ago

here is the output

cleaned log
bstascavage commented 9 years ago

Ah, thats it! There are blank emails there.

Let me update the code to check for that (I didn't even know that was a possibility)

bstascavage commented 9 years ago

Ok, I updated the code. Update your end and give it a shot.

elRadix commented 9 years ago

perfect, just updated and now it works, thank you for the fix!!