Giter Club home page Giter Club logo

Comments (1)

automatedelectrics avatar automatedelectrics commented on June 21, 2024

It maybe a bit late to help with this particular problem, but it might help someone else in the future ...

I was stuck with the same issue recently where I tried to set up Email Notifier without authentication because we run our own email server locally and sending an email from a client will fail if we try to use any type of authentication.

In the end the solution which worked for us was;

  1. SSH into OctoPi and open the file __init__.py which was located under
    /home/pi/oprint/lib/python2.7/site-packages/octoprint_emailnotifier
  2. At the end of the file, comment out the line;
    mailer = yagmail.SMTP(user={self._settings.get(['mail_username']):self._settings.get(['mail_useralias'])}, host=self._settings.get(['mail_server']),port=self._settings.get(['mail_server_port']), smtp_starttls=self._settings.get(['mail_server_tls']), smtp_ssl=self._settings.get(['mail_server_ssl']))
  3. Add a new line directly under with the following;
    mailer = yagmail.SMTP(user=self._settings.get(['mail_username']), password=None, host=self._settings.get(['mail_server']), port=self._settings.get(['mail_server_port']), smtp_skip_login=True, smtp_starttls=self._settings.get(['mail_server_tls']), smtp_ssl=self._settings.get(['mail_server_ssl']))
  4. Save and reboot the Pi.

The key changes to the original line were;
Removed self._settings.get(['mail_useralias']) (we didn't need the alias parameter)
Added password=None (you still need a username for the "From" section of the email, but no P/W)
Added smtp_skip_login=True (this was the big one!)

You can directly edit the existing line if you like, but I always like to keep the original code as a reference (particularly when testing) or just in case something goes wrong and you need to revert back.

Additionally, we also needed to add our desired username to a new file in the home directory which caused another error (because the yagmail was looking for this file, which was missing). The username is just used for the "From" section of the email sent, and in our case it didn't even need to be a valid user on our email system (update the "{ }" sections in the following to suit).
echo {Username}@{Email Address} > ~/.yagmail

I hope this helps!

OctoPrint Email Notifier Settings Example for No SMTP Authentication
email notifier example settings

from octoprint-emailnotifier.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.