Jump to content

Email notifications


Ninko

Recommended Posts

Ninko

@@Luke There is definitely something wrong with the plugin, could you look into it please?

 

Thanks

Link to comment
Share on other sites

Ninko

Because ever since changing the settings from Google, no matter which other SMTP I use it just gives me an error!

 

Thanks

Link to comment
Share on other sites

Because ever since changing the settings from Google, no matter which other SMTP I use it just gives me an error!

 

Thanks

What error?

Link to comment
Share on other sites

Anthony Musgrove

post-287751-0-38401800-1590906017_thumb.jpg

 

 

System.Net.Mail.SmtpException: Response format is wrong.(Z)

 

Interesting, looks like an encrypted format like tls or ssl. Maybe using the wrong protocol?

Edited by Anthony.Musgrove
Link to comment
Share on other sites

Anthony Musgrove

And the error states Response Format from the smtp server is wrong, so the encryption method or lack-there-of is probably set incorrectly to what the server encryption method is for that particular port. Are you 100% certain you have the correct encryption type and correct port number for that encryption method on your particular smtp server host? Ie tested that port and that encryption method explicitly in a mail client?

Link to comment
Share on other sites

Anthony Musgrove

By the way, I made a thing.  You can use it to debug your email server against the C# SMTP Client (the exact same one Emby Email Notifications uses), actually, the code in my diag tool pretty much mimics the Emby Email notifications code;

 

https://github.com/AnthonyMusgrove/mbSMTPDiag

 

5ed36d2785c69_my_Settings.png

 

5ed36d35be56c_Email_screenshot.png

  • Like 1
Link to comment
Share on other sites

Ninko

I am definitely sure the details are correct as I use exactly the same for my Synology notifications.

Link to comment
Share on other sites

Anthony Musgrove

I wonder if it is possible that your Synology software has some type of autoselection on encryption method where if it doesn't receive a valid format response it tries another encryption method?  Its an interesting one.  If you'd like (and are able) add an SMTP user for me for the server and inbox the details to me, and I'll do my own testing for you.

Link to comment
Share on other sites

Ninko

How do you mean? Give you full access to the emby server?

Link to comment
Share on other sites

CBers

20200531_161628.jpg

 

 

System.Net.Mail.SmtpException: Response format is wrong.(Z)

 

Interesting, looks like an encrypted format like tls or ssl. Maybe using the wrong protocol?

FWIW, I also tried using my Virginmedia email address in the Emby Notifications Plugin but it doesn't work.

 

Works fine with my Gmail address, which is weird, as I believe Virginmedia use the same Gmail backbone.

 

Perhaps there is a "Less secure apps access" option somewhere in the VM settings.

  • Like 1
Link to comment
Share on other sites

Anthony Musgrove

Leave this with me I'm going to have a play around with extending the c# SmtpClient. Ill make some improvements and see if Luke wants to pull the changes in. Just at work will look at it tonight

  • Like 2
Link to comment
Share on other sites

Anthony Musgrove

Important

 

We don't recommend that you use the SmtpClient class for new development because SmtpClient doesn't support many modern protocols. Use MailKit or other libraries instead. For more information, see SmtpClient shouldn't be used on GitHub.

 

Theres the issue. So you're more than 100% correct in saying that there is a problem with this plugin, however it is a very simple fix.

 

Im more then happy to rewrite the plugin using mailkit @@Luke if you wish. Ill do it when I get home from work

Edited by Anthony.Musgrove
  • Like 2
Link to comment
Share on other sites

Anthony Musgrove

I've knocked most of it out on my lunch break, but back into the vehicle now for a job.

 

I'll have it finished tonight.  smooth sailing.

 

5ed49c2feb0d5_withmailkit.png

  • Like 2
Link to comment
Share on other sites

Ninko

"I've knocked most of it out on my lunch break"

 

You guys are so clever! I've done some coding myself in the past but no where near to that ability.

 

Thanks again

  • Like 1
Link to comment
Share on other sites

Anthony Musgrove

Haha thanks mate. Just working on a couple of dependency issues and it will be done. @@Luke Does the core reference anywhere else to System.Net.Mail before plugins are loaded? Just having issues with the obsolete SmtpClient overriding Mailkit

 

(Re: System.MissingMethodException: Method not found: 'Void MailKit.IMailTransport.Send(MimeKit.MimeMessage, System.Threading.CancellationToken, MailKit.ITransferProgress).)

 

(Ill attach the emby executable to my debugger this afternoon to see if i can get a better view of the situation

Edited by Anthony.Musgrove
Link to comment
Share on other sites

Anthony Musgrove

Just ran in debugger on my phone, looks like this my issue. Hopefully this afternoon Ill have it resolved :)

Link to comment
Share on other sites

Important

We don't recommend that you use the SmtpClient class for new development because SmtpClient doesn't support many modern protocols. Use MailKit or other libraries instead. For more information, see SmtpClient shouldn't be used on GitHub.

Theres the issue. So you're more than 100% correct in saying that there is a problem with this plugin, however it is a very simple fix.

Im more then happy to rewrite the plugin using mailkit @@Luke if you wish. Ill do it when I get home from work

Sounds great, thanks !

  • Like 1
Link to comment
Share on other sites

Anthony Musgrove

Not a problem at all! I've resolved the dependency issues!  I'm leaving work now, when I get home I'll be putting it all together and it will be ready <3 <3 so stoked!

Link to comment
Share on other sites

Anthony Musgrove

Okay, all completed and pull request has been created: https://github.com/MediaBrowser/email-notifications/pull/4

 

Download the DLL here https://github.com/AnthonyMusgrove/email-notifications/blob/master/MediaBrowser.Plugins.SmtpNotifications.dll

and copy it to your emby plugins directory.

 

Restart emby, and vwalah.  Magic should happen.

 

If anyone has any feedback, bug reports or suggestions please feel free to let me know!  warmest regards, Anthony

 

(ps:

I've added an 'Ignore SSL Certificate Errors' checkbox on the configuration page (per user), which will allow you to use self-signed email server certificates etc.

 

And if something isn't working, please check your emby server log;

 

a typical 'successful' test/notification log entry set - more then happy to suppress this a little after initial test phases are complete:

 

2020-06-02 20:47:18.758 Info App: Connecting to smtpserver at mail.newymods.com.au:465

2020-06-02 20:47:18.883 Info App: Authenticating to smtpserver using anthony.musgrove@newymods.com.au/<hidden>

2020-06-02 20:47:21.127 Info App: Sending email anthony.musgrove@newymods.com.au with subject Emby: Emby: Test Notification

2020-06-02 20:47:21.286 Info App: Completed sending email anthony.musgrove@newymods.com.au with subject Emby: Emby: Test Notification 

 

Your plugin (if successfully installed manually until it's uploaded to the catalog as an update), you should see the plugin version as 4.0.0.0

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...