Giter Club home page Giter Club logo

octoprint-emailnotifier's People

Contributors

anoved avatar doughoyt avatar ericlifeac avatar foosel avatar jeffgolden avatar mtowara avatar n0bel avatar oxivanisher avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

octoprint-emailnotifier's Issues

Feature Request: Flip the image of the photo

Feature Request:

It would be great if you could flip the Raspberry pi camera upside down like you can in the main interface. Alot of camera mounts are designed for the camera to be mounted upside down.

Cannot get to work with gmail

I have it configured exactly as I have on another Octopi installation but when I click "Send a test email" I just get this error:

Sending failed. Reason:: send() got an unexpected keyword argument 'validate_email'

I can send emails just fine from yagmail in python like this:
>>> import yagmail
>>> s=yagmail.SMTP('[email protected]')
>>>s.send('[email protected]','subject','body')

It uses the same gmail account as the other printer so there is no problem with credentials, or alerts from google or anything.

I tried all kinds of stuff - credentials with and without the gmail.com, uninstalled and reinstalled, yagmail, keyrings.alt, many reboots. Uninstalled and reinstalled it on the older working Octopi installation and it still works.

Could the latest yagmail validations may not like the mail format (?) I can install an older version, is there one guaranteed to work?

I'm running Octopi on a pi zero w. I had to do a full package and rpi upgrade to get wifi to work on the pi so it is running on the latest and greatest everything.

Halp!

Problem with non-ascii characters in e-mail

Plugin works well but when my e-mail title contains ü, ş, ç etc. it gives this error:

2017-04-07 08:49:20,465 - octoprint.plugins.emailnotifier - ERROR - Email notification error: 'ascii' codec can't encode characters in position 16-18: ordinal not in range(128)
Traceback (most recent call last):
  File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint_emailnotifier/__init__.py", line 73, in on_event
    mailer.send(to=emails, subject=title, contents=content, validate_email=False)
  File "/home/pi/oprint/local/lib/python2.7/site-packages/yagmail/yagmail.py", line 107, in send
    msg = self._prepare_message(addresses, subject, contents, attachments, headers)
  File "/home/pi/oprint/local/lib/python2.7/site-packages/yagmail/yagmail.py", line 230, in _prepare_message
    has_included_images, content_objects = self._prepare_contents(contents)
  File "/home/pi/oprint/local/lib/python2.7/site-packages/yagmail/yagmail.py", line 298, in _prepare_contents
    content_object = self._get_mime_object(content)
  File "/home/pi/oprint/local/lib/python2.7/site-packages/yagmail/yagmail.py", line 368, in _get_mime_object
    content_name = os.path.basename(str(content_string))
UnicodeEncodeError: 'ascii' codec can't encode characters in position 16-18: ordinal not in range(128)

Add a password field to the UI

Don't save it in the octoprint settings, obviously. Basically, just automate the extra step that users need to take to save the SMTP password to a keychain. This field would be empty in the UI. A user can put their password in and save the form, and then the next time the form is rendered, the field is still empty. Users only put their password in to change it.

As an aside, I run OctoPrint via OctoPi, and the normal keyring methods were unavailable in the default distribution (there is no desktop environment or anything installed), so I had to install keyrings.alt. Might be useful to make a note about for users (also in the UI), or even better, add it as a dependency of this plugin. I imagine that the better keyring methods would be used first, and then it would fall back to keyrings.alt if no better methods were available, but I guess that would need some testing.

Error during setup on OctoPrint 1.3

I was not able to install plugin on updated OctoPrint v 1.3

Part of error log is the following

Building wheels for collected packages: cryptography, cffi
Running setup.py bdist_wheel for cryptography ... error
Complete output from command /home/octopi/OctoPrint/venv/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-build-Mc8uVm/cryptography/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" bdist_wheel -d /tmp/tmpeItDg2pip-wheel- --python-tag cp27:
c/_cffi_backend.c:15:17: fatal error: ffi.h: No such file or directory
#include <ffi.h>
^
compilation terminated.
Traceback (most recent call last):
File "", line 1, in
File "/tmp/pip-build-Mc8uVm/cryptography/setup.py", line 334, in
**keywords_with_side_effects(sys.argv)
File "/usr/lib/python2.7/distutils/core.py", line 111, in setup
_setup_distribution = dist = klass(attrs)
File "/home/octopi/OctoPrint/venv/local/lib/python2.7/site-packages/setuptools/dist.py", line 316, in init
self.fetch_build_eggs(attrs['setup_requires'])
File "/home/octopi/OctoPrint/venv/local/lib/python2.7/site-packages/setuptools/dist.py", line 371, in fetch_build_eggs
replace_conflicting=True,
File "/home/octopi/OctoPrint/venv/local/lib/python2.7/site-packages/pkg_resources/init.py", line 846, in resolve
dist = best[req.key] = env.best_match(req, ws, installer)
File "/home/octopi/OctoPrint/venv/local/lib/python2.7/site-packages/pkg_resources/init.py", line 1118, in best_match
return self.obtain(req, installer)
File "/home/octopi/OctoPrint/venv/local/lib/python2.7/site-packages/pkg_resources/init.py", line 1130, in obtain
return installer(requirement)
File "/home/octopi/OctoPrint/venv/local/lib/python2.7/site-packages/setuptools/dist.py", line 439, in fetch_build_egg
return cmd.easy_install(req)
File "/home/octopi/OctoPrint/venv/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 665, in easy_install
return self.install_item(spec, dist.location, tmpdir, deps)
File "/home/octopi/OctoPrint/venv/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 695, in install_item
dists = self.install_eggs(spec, download, tmpdir)
File "/home/octopi/OctoPrint/venv/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 876, in install_eggs
return self.build_and_install(setup_script, setup_base)
File "/home/octopi/OctoPrint/venv/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1115, in build_and_install
self.run_setup(setup_script, setup_base, args)
File "/home/octopi/OctoPrint/venv/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1103, in run_setup
raise DistutilsError("Setup script exited with %s" % (v.args[0],))
distutils.errors.DistutilsError: Setup script exited with error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1


Failed building wheel for cryptography
Running setup.py clean for cryptography
Complete output from command /home/octopi/OctoPrint/venv/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-build-Mc8uVm/cryptography/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" clean --all:
c/_cffi_backend.c:15:17: fatal error: ffi.h: No such file or directory
#include <ffi.h>
^
compilation terminated.
Traceback (most recent call last):
File "", line 1, in
File "/tmp/pip-build-Mc8uVm/cryptography/setup.py", line 334, in
**keywords_with_side_effects(sys.argv)
File "/usr/lib/python2.7/distutils/core.py", line 111, in setup
_setup_distribution = dist = klass(attrs)
File "/home/octopi/OctoPrint/venv/local/lib/python2.7/site-packages/setuptools/dist.py", line 316, in init
self.fetch_build_eggs(attrs['setup_requires'])
File "/home/octopi/OctoPrint/venv/local/lib/python2.7/site-packages/setuptools/dist.py", line 371, in fetch_build_eggs
replace_conflicting=True,
File "/home/octopi/OctoPrint/venv/local/lib/python2.7/site-packages/pkg_resources/init.py", line 846, in resolve
dist = best[req.key] = env.best_match(req, ws, installer)
File "/home/octopi/OctoPrint/venv/local/lib/python2.7/site-packages/pkg_resources/init.py", line 1118, in best_match
return self.obtain(req, installer)
File "/home/octopi/OctoPrint/venv/local/lib/python2.7/site-packages/pkg_resources/init.py", line 1130, in obtain
return installer(requirement)
File "/home/octopi/OctoPrint/venv/local/lib/python2.7/site-packages/setuptools/dist.py", line 439, in fetch_build_egg
return cmd.easy_install(req)
File "/home/octopi/OctoPrint/venv/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 665, in easy_install
return self.install_item(spec, dist.location, tmpdir, deps)
File "/home/octopi/OctoPrint/venv/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 695, in install_item
dists = self.install_eggs(spec, download, tmpdir)
File "/home/octopi/OctoPrint/venv/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 876, in install_eggs
return self.build_and_install(setup_script, setup_base)
File "/home/octopi/OctoPrint/venv/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1115, in build_and_install
self.run_setup(setup_script, setup_base, args)
File "/home/octopi/OctoPrint/venv/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1103, in run_setup
raise DistutilsError("Setup script exited with %s" % (v.args[0],))
distutils.errors.DistutilsError: Setup script exited with error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1


Failed cleaning build dir for cryptography
Running setup.py bdist_wheel for cffi ... error
Complete output from command /home/octopi/OctoPrint/venv/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-build-Mc8uVm/cffi/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" bdist_wheel -d /tmp/tmp0G9zh5pip-wheel- --python-tag cp27:
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-armv7l-2.7
creating build/lib.linux-armv7l-2.7/cffi
copying cffi/recompiler.py -> build/lib.linux-armv7l-2.7/cffi
copying cffi/verifier.py -> build/lib.linux-armv7l-2.7/cffi
copying cffi/cffi_opcode.py -> build/lib.linux-armv7l-2.7/cffi
copying cffi/setuptools_ext.py -> build/lib.linux-armv7l-2.7/cffi
copying cffi/init.py -> build/lib.linux-armv7l-2.7/cffi
copying cffi/lock.py -> build/lib.linux-armv7l-2.7/cffi
copying cffi/api.py -> build/lib.linux-armv7l-2.7/cffi
copying cffi/vengine_gen.py -> build/lib.linux-armv7l-2.7/cffi
copying cffi/ffiplatform.py -> build/lib.linux-armv7l-2.7/cffi
copying cffi/cparser.py -> build/lib.linux-armv7l-2.7/cffi
copying cffi/backend_ctypes.py -> build/lib.linux-armv7l-2.7/cffi
copying cffi/commontypes.py -> build/lib.linux-armv7l-2.7/cffi
copying cffi/model.py -> build/lib.linux-armv7l-2.7/cffi
copying cffi/vengine_cpy.py -> build/lib.linux-armv7l-2.7/cffi
copying cffi/_cffi_include.h -> build/lib.linux-armv7l-2.7/cffi
copying cffi/parse_c_type.h -> build/lib.linux-armv7l-2.7/cffi
copying cffi/_embedding.h -> build/lib.linux-armv7l-2.7/cffi
running build_ext
building '_cffi_backend' extension
creating build/temp.linux-armv7l-2.7
creating build/temp.linux-armv7l-2.7/c
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DUSE__THREAD -I/usr/include/ffi -I/usr/include/libffi -I/usr/include/python2.7 -c c/_cffi_backend.c -o build/temp.linux-armv7l-2.7/c/_cffi_backend.o
c/_cffi_backend.c:15:17: fatal error: ffi.h: No such file or directory
#include <ffi.h>
^
compilation terminated.
error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1


Failed building wheel for cffi
Running setup.py clean for cffi
Failed to build cryptography cffi
Installing collected packages: cffi, cryptography, secretstorage, keyring, yagmail, keyrings.alt, OctoPrint-EmailNotifier
Running setup.py install for cffi ... error
Complete output from command /home/octopi/OctoPrint/venv/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-build-Mc8uVm/cffi/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /tmp/pip-N8wWs3-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/octopi/OctoPrint/venv/include/site/python2.7/cffi:
running install
running build
running build_py
creating build
creating build/lib.linux-armv7l-2.7
creating build/lib.linux-armv7l-2.7/cffi
copying cffi/recompiler.py -> build/lib.linux-armv7l-2.7/cffi
copying cffi/verifier.py -> build/lib.linux-armv7l-2.7/cffi
copying cffi/cffi_opcode.py -> build/lib.linux-armv7l-2.7/cffi
copying cffi/setuptools_ext.py -> build/lib.linux-armv7l-2.7/cffi
copying cffi/init.py -> build/lib.linux-armv7l-2.7/cffi
copying cffi/lock.py -> build/lib.linux-armv7l-2.7/cffi
copying cffi/api.py -> build/lib.linux-armv7l-2.7/cffi
copying cffi/vengine_gen.py -> build/lib.linux-armv7l-2.7/cffi
copying cffi/ffiplatform.py -> build/lib.linux-armv7l-2.7/cffi
copying cffi/cparser.py -> build/lib.linux-armv7l-2.7/cffi
copying cffi/backend_ctypes.py -> build/lib.linux-armv7l-2.7/cffi
copying cffi/commontypes.py -> build/lib.linux-armv7l-2.7/cffi
copying cffi/model.py -> build/lib.linux-armv7l-2.7/cffi
copying cffi/vengine_cpy.py -> build/lib.linux-armv7l-2.7/cffi
copying cffi/_cffi_include.h -> build/lib.linux-armv7l-2.7/cffi
copying cffi/parse_c_type.h -> build/lib.linux-armv7l-2.7/cffi
copying cffi/_embedding.h -> build/lib.linux-armv7l-2.7/cffi
running build_ext
building '_cffi_backend' extension
creating build/temp.linux-armv7l-2.7
creating build/temp.linux-armv7l-2.7/c
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DUSE__THREAD -I/usr/include/ffi -I/usr/include/libffi -I/usr/include/python2.7 -c c/_cffi_backend.c -o build/temp.linux-armv7l-2.7/c/_cffi_backend.o
c/_cffi_backend.c:15:17: fatal error: ffi.h: No such file or directory
#include <ffi.h>
^
compilation terminated.
error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1

----------------------------------------

Command "/home/octopi/OctoPrint/venv/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-build-Mc8uVm/cffi/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /tmp/pip-N8wWs3-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/octopi/OctoPrint/venv/include/site/python2.7/cffi" failed with error code 1 in /tmp/pip-build-Mc8uVm/cffi/

Send snapshot for every x % complete

Enhancement request: It would be nice, if a "progress" snapshot could be sent for every x % completed - until 100% complete. That way it would be possible to monitor the job progress via email.
The interval should be user configurable - e.g. for every 2 (2,4,6,8,10...100), 5 (5,10,15,20...100) or 10% (10,20,30,40... 100) complete

Add "Send Test Email" button

It would be nice to have a "Send Test Email" on the plugin's configuration page. This would let a user confirm the settings are working before waiting for a long print job to finish.

Help me with my working postfix fork....

Hi

I forked this wonderful thing and made it work with postfix so no yagmail and keyring nightmare anymore. Set up postfix so you can send email with mail and you are set :-)

However:

Basic function is working and it does the sending and snapshot etc.

Todo:

Renameing the Plugin internally so my and anoved's version can coexist peacefully.
-> This breakes everything.
->> Unfortunately i dont know much about Octoprint Plugin makeup structure to make it work if i change the name

-> Some mail parameter seems wrong, user definded FROM line is not used.
-> Testing Testing Testing (only tested "test" function for now.)

Pull requests welcome.

See: https://github.com/ManuGithubSteam/OctoPrint-EmailNotifier

Thanks :-)
Manuel

Is this project dead?

No updates in a long time. Also it does not show up in the Octoprint plugin repository :-(

ERROR: Package 'keyring' requires a different Python: 2.7.13 not in '>=3.5'

Hello there. I am trying to get this working on a second Pi instance that i just created.
Keyring is missing and if I try and install it I get the message
ERROR: Package 'keyring' requires a different Python: 2.7.13 not in '>=3.5'
From what i have read they mention to update Octopi instance altogether but I am running a build that I just downloaded last week.
Is there any way around this? I am not great with Linux but can get around if need be.
thanks

Deprecated Command Warning

Following warning is issued when OctoPrint-EmailNotifier is invoked:

py.warnings - WARNING - /home/pi/oprint/local/lib/python2.7/site-packages/octoprint_emailnotifier/init.py:60: DeprecationWarning: globalGet has been renamed to global_get

Line 60, please change 'globalGet' to 'global_get'.

Specify MIME Type of webcam snapshots int the email

What were you doing?

Receiving webcam pictures emails from the OctoPrint-EmailNotifier

What did you expect to happen?

To be able to open the image in K-9 (Android mail client)

What happened instead?

I have to download it first, and can only open it then. This is probably happening also in other email clients.

Branch & Commit or Version of OctoPrint

all AFAIK

Printer model & used firmware incl. version

Not important, but Kossel XL 800

Browser and Version of Browser, Operating System running Browser

Android 6, K-9 Mail (will happen in other situations also)

Screenshot(s) showing the problem:

octoptint_bug

Can not send email to smtp.gmail.com from your own domain

Hello,

I'm trying Email Notifier on Raspbery Pi Zero W and I have encountered a problem with its settings. I use Gmail where I have my own xinoha.cz registered domain

When I try to send a test email directly from Raspberry from Python
>>> yagmail.SMTP('[email protected]').send('[email protected]', 'subject', 'This is the body')
So the email is successfully delivered, but it is not possible to send the test email from the web interface.

In web interface set:
server: smtp.gmail.com
username: [email protected]

Sending ends with "Sending failed. Reason::
##ocotoprint-email-sending-failed
"

error while installing email notifier

I get this error when i try and install email notifier -

Command "/home/pi/OctoPrint/venv/bin/python2 -u -c "import setuptools, tokenize;file='/tmp/pip-build-tnHXkv/cffi/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /tmp/pip-9eqCPh-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/pi/OctoPrint/venv/include/site/python2.7/cffi" failed with error code 1 in /tmp/pip-build-tnHXkv/cffi/

SMTP Authentication Error

When I try to test yagmail it throws an SMTPAuthenticationError. This is because Gmail doesn't consider it secure enough.

yagmail.SMTP('[email protected]').send('[email protected]', 'Test', 'This is a test')

Of course one has to do yagmail.register('[email protected]', 'password') first.

To overcome that, one has to log in to [email protected] and go to My Account (upper left corner), Sign-in & security. At the very bottom, under Connected apps & sites, there's an option Allow less secure apps, this must be turned on for yagmail to work properly.

Global name "keyring" is not defined

When running the yagmail.register command, I get the following message:

(username and password removed for privacy)

yagmail.register("","")
Traceback (most recent call last):
File "", line 1, in
File "/home/pi/oprint/local/lib/python2.7/site-packages/yagmail/password.py", line 37, in register
keyring.set_password("yagmail", username, password)
NameError: global name 'keyring' is not defined

I followed the steps in the readme, first importing yagmail, and then running the register command

Emails not being sent

Hello,

I am running OctoPrint 1.4.0 on OctoPi 0.17.0
I initially had trouble installing the plugin, but per bibitte's instructions on issue #53, I was able to get it installed an working.
I believe that I have the plugin configured correctly as the "Send a test email" works properly and I get the test email in my inbox.
However, whenever a print completes, I do NOT get an email, so I was digging through the logs and I see the following:

octoprint.plugin - ERROR - Error while calling plugin emailnotifier
Traceback (most recent call last):
File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/plugin/init.py", line 224, in call_plugin
result = getattr(plugin, method)(*args, **kwargs)
File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint_emailnotifier/init.py", line 81, in on_event
filename = os.path.basename(payload["file"])
KeyError: 'file'

Seems like some sort of python error. Any help would be much appreciated.

Turn on LED when taking a snapshot

This is an enhancement request whereby it would be nice to have a feature where a user configurable GPIO can be toggled prior to taking a snapshot so that a LED to illuminate the part.

This stinks.. multiple issues

My god, these plugins should have reviews on them. I spent 2 hours trying to get this thing working... it looks great, screens shots look great, but if I have to get into putty and install yagmail and keyring and other stuff after digging around to find out why none of it can be found, figure out what virtual profiles are... all this to get a simple email notification? Why use Yagmail, why don't you just use smtplib? Is all this so that passwords are stored securely? Who cares about that, if they have access to your script files from the internet you have bigger problems, having the password accessible by the script wouldn't matter.
Why not have a test button, so you can test the setup?
Why not have a port number option, for non-standard SMTP ports
Why not have TLS option and other standard SMTP settings
I need to just make another completely different plugin that works and installs in one step... this one is pretty much useless. I finally got it all setup, and I don't even know if it works; testing from the yagmail shows it is still not working. WOW.

How to configure TLS with port 587

Hello,

how is it possible to configure TLS with Port 587?

Should the Port be entered after the SMTP-Server?
server:587

Best regards,
Christian

Nothing on settings

Hi, I installed the plugin. I did registering yagmail. However, there is nothing on Email Notifier settings page. It is basically a blank page. No error messages in logs.
What did I possibly miss?

Emails not being sent

I can't get EmailNotifier to send emails upon completion of prints. Nothing happens. Checking the mail server logs, it does not even appear to be trying. Is authentication required? I have a postfix server running on the same lan as my printers, and it is not protected (no login required). Telnet'ing to port 25 on the mail server and entering the commands works. Is there a way to test the emails from the plugin?

delay sending email?

Hi all, I am looking for a solution to the next problem:
I have a setup for my Prusa MK2s and Octopi sending an e-mail to IFTTT to trigger an off-outlet switch via Telldus live. Now I want the OctoPrint-EmailNotifier plugin to send its mail after 300 seconds. to let the extruder cool down. If I choose to work with the G4 S300 in the end code, the mail will be sent immediately.
Is there another solution?

Can't store password

Latest OctoPi installed and fully updated.

Traceback (most recent call last):
File "", line 1, in
File "/home/pi/oprint/local/lib/python2.7/site-packages/yagmail/yagmail.py", line 430, in register
keyring.set_password('yagmail', username, password)
NameError: global name 'keyring' is not defined

(oprint)pi@octopi:~/oprint/bin $ pip install keyrings.alt
Requirement already satisfied (use --upgrade to upgrade): keyrings.alt in /home/pi/oprint/lib/python2.7/site-packages

keyrings.alt is installed, but I still can't store the password. Any ideas? Thanks!

Issue with yagmail.register... keyrings.alt on Jessie

I have the following installed:
yagmail 0.4.132
keyrings.alt 1.1.1
pip 1.5.6
python 2.7.9

And when I try to run yagmail.register for the plugin I get the following (any help would be appreciated!):

File "", line 1, in
File "/home/pi/oprint/local/lib/python2.7/site-packages/yagmail/yagmail.py", line 417, in register
keyring.set_password('yagmail', username, password)
File "/home/pi/oprint/local/lib/python2.7/site-packages/keyring/core.py", line 48, in set_password
_keyring_backend.set_password(service_name, username, password)
File "/home/pi/oprint/local/lib/python2.7/site-packages/keyring/backends/fail.py", line 18, in get_password
raise RuntimeError("No recommended backend was available. Install the "
RuntimeError: No recommended backend was available. Install the keyrings.alt package if you want to use the non-recommended backends. See README.rst for details.

Attachement mirror horizontal/vertical

My pi camera is mounted upside down.
In octoprint there's options Flip webcam horizontally and Flip webcam vertically.
But when I receive the email the image is upside down.
Can you add the option to flip it ?

Thanks

No way to access Keyring if you only use Web UI

Maybe I'm in the minority here, but I only use the Web UI on my Octopi. I've read the other issues here about SMTP passwords but because I only use the web UI none of the solutions will work for me. I can't access the keyring and I can't use yagmail. I admit I'm not a programmer so there are things in the other issue discussions I do not understand.

Is there no other way for me to use the EmailNotifier if I only use the web to access my Octopi?

I fixed some issue, so...

before author update this plugin, you can install my fixed one on my github.
just install with command

/home/pi/oprint/bin/python -m pip install https://github.com/ericli1018/OctoPrint-EmailNotifier/archive/master.zip

I add using tls, ssl, port number option in config page.
have fun~

if you want to use google smtp send mail

please follow step below:

  1. pip install --upgrade setuptools

  2. use pip command install fork project on my github

  3. if you have double account auth. Get app password by link https://security.google.com/settings/security/apppasswords

  4. install keyring #thanks jeffgolden remind
    /home/pi/oprint/bin/python -m pip install keyring

open python command

import yagmail
yagmail.register('[email protected]','your app password')
quit()

  1. restart service

  2. enter config page, checked use tls, port =587, server=smtp.gmail.com, user=your gmail full address, then save config.

  3. open config again, and enter config page to touch send test mail

  4. wait to received email

Email on another event.

My endCode is:

G4 P900000 ;doing nothing for 15 min
G90 ;absolute positioning
G1 Y200 ; move Y forward to Auto RF power switch OFF

By --G4 P900000-- I have a connection timeout and octoprint disconnect the printer. So i do not get the "printdone" event. Is possible to replace the event "print done" by "Waiting"?

Problem with plugin installation

Hello
I have problem with installation of this plugin. During installation I received next error.
There is no matter if installation starting from Octoprint or over SSH.
I think that problem is some rights adjustment, but I can´t find what is wrong.

Instalace pluginu "Email Notifier" z https://github.com/anoved/OctoPrint-EmailNotifier/archive/master.zip... /home/pi/OctoPrint/venv/bin/pip install https://github.com/anoved/OctoPrint-EmailNotifier/archive/master.zip Collecting https://github.com/anoved/OctoPrint-EmailNotifier/archive/master.zip Downloading https://github.com/anoved/OctoPrint-EmailNotifier/archive/master.zip Requirement already satisfied (use --upgrade to upgrade): OctoPrint in /home/pi/OctoPrint/venv/lib/python2.7/site-packages/OctoPrint-1.2.16-py2.7.egg (from OctoPrint-EmailNotifier==0.1.1) Collecting yagmail (from OctoPrint-EmailNotifier==0.1.1) Downloading yagmail-0.5.148-py2.py3-none-any.whl Requirement already satisfied (use --upgrade to upgrade): flask<0.11,>=0.9 in /home/pi/OctoPrint/venv/lib/python2.7/site-packages/Flask-0.10.1-py2.7.egg (from OctoPrint->OctoPrint-EmailNotifier==0.1.1) Requirement already satisfied (use --upgrade to upgrade): werkzeug<0.9,>=0.8.3 in /home/pi/OctoPrint/venv/lib/python2.7/site-packages/Werkzeug-0.8.3-py2.7.egg (from OctoPrint->OctoPrint-EmailNotifier==0.1.1) Requirement already satisfied (use --upgrade to upgrade): tornado<4.1,>=4.0.1 in /home/pi/OctoPrint/venv/lib/python2.7/site-packages (from OctoPrint->OctoPrint-EmailNotifier==0.1.1) Requirement already satisfied (use --upgrade to upgrade): sockjs-tornado<1.1,>=1.0.1 in /home/pi/OctoPrint/venv/lib/python2.7/site-packages/sockjs_tornado-1.0.3-py2.7.egg (from OctoPrint->OctoPrint-EmailNotifier==0.1.1) Requirement already satisfied (use --upgrade to upgrade): PyYAML<3.11,>=3.10 in /home/pi/OctoPrint/venv/lib/python2.7/site-packages/PyYAML-3.10-py2.7-linux-armv7l.egg (from OctoPrint->OctoPrint-EmailNotifier==0.1.1) Requirement already satisfied (use --upgrade to upgrade): Flask-Login<0.3,>=0.2.2 in /home/pi/OctoPrint/venv/lib/python2.7/site-packages/Flask_Login-0.2.11-py2.7.egg (from OctoPrint->OctoPrint-EmailNotifier==0.1.1) Requirement already satisfied (use --upgrade to upgrade): Flask-Principal<0.4,>=0.3.5 in /home/pi/OctoPrint/venv/lib/python2.7/site-packages/Flask_Principal-0.3.5-py2.7.egg (from OctoPrint->OctoPrint-EmailNotifier==0.1.1) Requirement already satisfied (use --upgrade to upgrade): Flask-Babel<0.10,>=0.9 in /home/pi/OctoPrint/venv/lib/python2.7/site-packages/Flask_Babel-0.9-py2.7.egg (from OctoPrint->OctoPrint-EmailNotifier==0.1.1) Requirement already satisfied (use --upgrade to upgrade): Flask-Assets<0.11,>=0.10 in /home/pi/OctoPrint/venv/lib/python2.7/site-packages/Flask_Assets-0.10-py2.7.egg (from OctoPrint->OctoPrint-EmailNotifier==0.1.1) Requirement already satisfied (use --upgrade to upgrade): markdown<2.7,>=2.6.4 in /home/pi/OctoPrint/venv/lib/python2.7/site-packages/Markdown-2.6.7-py2.7.egg (from OctoPrint->OctoPrint-EmailNotifier==0.1.1) Requirement already satisfied (use --upgrade to upgrade): pyserial<2.8,>=2.7 in /home/pi/OctoPrint/venv/lib/python2.7/site-packages/pyserial-2.7-py2.7.egg (from OctoPrint->OctoPrint-EmailNotifier==0.1.1) Requirement already satisfied (use --upgrade to upgrade): netaddr<0.8,>=0.7.17 in /home/pi/OctoPrint/venv/lib/python2.7/site-packages/netaddr-0.7.18-py2.7.egg (from OctoPrint->OctoPrint-EmailNotifier==0.1.1) Requirement already satisfied (use --upgrade to upgrade): watchdog<0.9,>=0.8.3 in /home/pi/OctoPrint/venv/lib/python2.7/site-packages/watchdog-0.8.3-py2.7.egg (from OctoPrint->OctoPrint-EmailNotifier==0.1.1) Requirement already satisfied (use --upgrade to upgrade): sarge<0.2,>=0.1.4 in /home/pi/OctoPrint/venv/lib/python2.7/site-packages/sarge-0.1.4-py2.7.egg (from OctoPrint->OctoPrint-EmailNotifier==0.1.1) Requirement already satisfied (use --upgrade to upgrade): netifaces<0.11,>=0.10 in /home/pi/OctoPrint/venv/lib/python2.7/site-packages/netifaces-0.10.5-py2.7-linux-armv7l.egg (from OctoPrint->OctoPrint-EmailNotifier==0.1.1) Requirement already satisfied (use --upgrade to upgrade): pylru<1.1,>=1.0.9 in /home/pi/OctoPrint/venv/lib/python2.7/site-packages/pylru-1.0.9-py2.7.egg (from OctoPrint->OctoPrint-EmailNotifier==0.1.1) Requirement already satisfied (use --upgrade to upgrade): rsa<3.3,>=3.2 in /home/pi/OctoPrint/venv/lib/python2.7/site-packages/rsa-3.2.3-py2.7.egg (from OctoPrint->OctoPrint-EmailNotifier==0.1.1) Requirement already satisfied (use --upgrade to upgrade): pkginfo<1.3,>=1.2.1 in /home/pi/OctoPrint/venv/lib/python2.7/site-packages/pkginfo-1.2.1-py2.7.egg (from OctoPrint->OctoPrint-EmailNotifier==0.1.1) Requirement already satisfied (use --upgrade to upgrade): requests<2.8,>=2.7.0 in /home/pi/OctoPrint/venv/lib/python2.7/site-packages/requests-2.7.0-py2.7.egg (from OctoPrint->OctoPrint-EmailNotifier==0.1.1) Requirement already satisfied (use --upgrade to upgrade): semantic_version<2.5,>=2.4.2 in /home/pi/OctoPrint/venv/lib/python2.7/site-packages/semantic_version-2.4.2-py2.7.egg (from OctoPrint->OctoPrint-EmailNotifier==0.1.1) Requirement already satisfied (use --upgrade to upgrade): psutil<3.3,>=3.2.1 in /home/pi/OctoPrint/venv/lib/python2.7/site-packages/psutil-3.2.2-py2.7-linux-armv7l.egg (from OctoPrint->OctoPrint-EmailNotifier==0.1.1) Requirement already satisfied (use --upgrade to upgrade): awesome-slugify<1.7,>=1.6.5 in /home/pi/OctoPrint/venv/lib/python2.7/site-packages/awesome_slugify-1.6.5-py2.7.egg (from OctoPrint->OctoPrint-EmailNotifier==0.1.1) Requirement already satisfied (use --upgrade to upgrade): feedparser<5.3,>=5.2.1 in /home/pi/OctoPrint/venv/lib/python2.7/site-packages/feedparser-5.2.1-py2.7.egg (from OctoPrint->OctoPrint-EmailNotifier==0.1.1) Collecting keyring (from yagmail->OctoPrint-EmailNotifier==0.1.1) Using cached keyring-10.0.2-py2.py3-none-any.whl Requirement already satisfied (use --upgrade to upgrade): Jinja2>=2.4 in /home/pi/OctoPrint/venv/lib/python2.7/site-packages/Jinja2-2.8-py2.7.egg (from flask<0.11,>=0.9->OctoPrint->OctoPrint-EmailNotifier==0.1.1) Requirement already satisfied (use --upgrade to upgrade): itsdangerous>=0.21 in /home/pi/OctoPrint/venv/lib/python2.7/site-packages/itsdangerous-0.24-py2.7.egg (from flask<0.11,>=0.9->OctoPrint->OctoPrint-EmailNotifier==0.1.1) Requirement already satisfied (use --upgrade to upgrade): certifi in /home/pi/OctoPrint/venv/lib/python2.7/site-packages/certifi-2016.09.26-py2.7.egg (from tornado<4.1,>=4.0.1->OctoPrint->OctoPrint-EmailNotifier==0.1.1) Requirement already satisfied (use --upgrade to upgrade): backports.ssl_match_hostname in /home/pi/OctoPrint/venv/lib/python2.7/site-packages/backports.ssl_match_hostname-3.5.0.1-py2.7.egg (from tornado<4.1,>=4.0.1->OctoPrint->OctoPrint-EmailNotifier==0.1.1) Requirement already satisfied (use --upgrade to upgrade): blinker in /home/pi/OctoPrint/venv/lib/python2.7/site-packages/blinker-1.4-py2.7.egg (from Flask-Principal<0.4,>=0.3.5->OctoPrint->OctoPrint-EmailNotifier==0.1.1) Requirement already satisfied (use --upgrade to upgrade): Babel>=1.0 in /home/pi/OctoPrint/venv/lib/python2.7/site-packages/Babel-2.3.4-py2.7.egg (from Flask-Babel<0.10,>=0.9->OctoPrint->OctoPrint-EmailNotifier==0.1.1) Requirement already satisfied (use --upgrade to upgrade): speaklater>=1.2 in /home/pi/OctoPrint/venv/lib/python2.7/site-packages/speaklater-1.3-py2.7.egg (from Flask-Babel<0.10,>=0.9->OctoPrint->OctoPrint-EmailNotifier==0.1.1) Requirement already satisfied (use --upgrade to upgrade): webassets>=0.10 in /home/pi/OctoPrint/venv/lib/python2.7/site-packages/webassets-0.12.0-py2.7.egg (from Flask-Assets<0.11,>=0.10->OctoPrint->OctoPrint-EmailNotifier==0.1.1) Requirement already satisfied (use --upgrade to upgrade): argh>=0.24.1 in /home/pi/OctoPrint/venv/lib/python2.7/site-packages/argh-0.26.2-py2.7.egg (from watchdog<0.9,>=0.8.3->OctoPrint->OctoPrint-EmailNotifier==0.1.1) Requirement already satisfied (use --upgrade to upgrade): pathtools>=0.1.1 in /home/pi/OctoPrint/venv/lib/python2.7/site-packages/pathtools-0.1.2-py2.7.egg (from watchdog<0.9,>=0.8.3->OctoPrint->OctoPrint-EmailNotifier==0.1.1) Requirement already satisfied (use --upgrade to upgrade): pyasn1>=0.1.3 in /home/pi/OctoPrint/venv/lib/python2.7/site-packages/pyasn1-0.1.9-py2.7.egg (from rsa<3.3,>=3.2->OctoPrint->OctoPrint-EmailNotifier==0.1.1) Requirement already satisfied (use --upgrade to upgrade): regex in /home/pi/OctoPrint/venv/lib/python2.7/site-packages/regex-2016.09.22-py2.7-linux-armv7l.egg (from awesome-slugify<1.7,>=1.6.5->OctoPrint->OctoPrint-EmailNotifier==0.1.1) Requirement already satisfied (use --upgrade to upgrade): Unidecode<0.05,>=0.04.14 in /home/pi/OctoPrint/venv/lib/python2.7/site-packages/Unidecode-0.04.19-py2.7.egg (from awesome-slugify<1.7,>=1.6.5->OctoPrint->OctoPrint-EmailNotifier==0.1.1) Collecting secretstorage; sys_platform == "linux2" or sys_platform == "linux" (from keyring->yagmail->OctoPrint-EmailNotifier==0.1.1) Using cached SecretStorage-2.3.1.tar.gz Requirement already satisfied (use --upgrade to upgrade): MarkupSafe in /home/pi/OctoPrint/venv/lib/python2.7/site-packages/MarkupSafe-0.23-py2.7-linux-armv7l.egg (from Jinja2>=2.4->flask<0.11,>=0.9->OctoPrint->OctoPrint-EmailNotifier==0.1.1) Requirement already satisfied (use --upgrade to upgrade): pytz>=0a in /home/pi/OctoPrint/venv/lib/python2.7/site-packages/pytz-2016.7-py2.7.egg (from Babel>=1.0->Flask-Babel<0.10,>=0.9->OctoPrint->OctoPrint-EmailNotifier==0.1.1) Collecting cryptography (from secretstorage; sys_platform == "linux2" or sys_platform == "linux"->keyring->yagmail->OctoPrint-EmailNotifier==0.1.1) Using cached cryptography-1.5.2.tar.gz Requirement already satisfied (use --upgrade to upgrade): idna>=2.0 in /home/pi/OctoPrint/venv/lib/python2.7/site-packages (from cryptography->secretstorage; sys_platform == "linux2" or sys_platform == "linux"->keyring->yagmail->OctoPrint-EmailNotifier==0.1.1) Requirement already satisfied (use --upgrade to upgrade): six>=1.4.1 in /home/pi/OctoPrint/venv/lib/python2.7/site-packages (from cryptography->secretstorage; sys_platform == "linux2" or sys_platform == "linux"->keyring->yagmail->OctoPrint-EmailNotifier==0.1.1) Requirement already satisfied (use --upgrade to upgrade): setuptools>=11.3 in /home/pi/OctoPrint/venv/lib/python2.7/site-packages (from cryptography->secretstorage; sys_platform == "linux2" or sys_platform == "linux"->keyring->yagmail->OctoPrint-EmailNotifier==0.1.1) Requirement already satisfied (use --upgrade to upgrade): enum34 in /home/pi/OctoPrint/venv/lib/python2.7/site-packages (from cryptography->secretstorage; sys_platform == "linux2" or sys_platform == "linux"->keyring->yagmail->OctoPrint-EmailNotifier==0.1.1) Requirement already satisfied (use --upgrade to upgrade): ipaddress in /home/pi/OctoPrint/venv/lib/python2.7/site-packages (from cryptography->secretstorage; sys_platform == "linux2" or sys_platform == "linux"->keyring->yagmail->OctoPrint-EmailNotifier==0.1.1) Collecting cffi>=1.4.1 (from cryptography->secretstorage; sys_platform == "linux2" or sys_platform == "linux"->keyring->yagmail->OctoPrint-EmailNotifier==0.1.1) Using cached cffi-1.8.3.tar.gz Requirement already satisfied (use --upgrade to upgrade): pycparser in /home/pi/OctoPrint/venv/lib/python2.7/site-packages (from cffi>=1.4.1->cryptography->secretstorage; sys_platform == "linux2" or sys_platform == "linux"->keyring->yagmail->OctoPrint-EmailNotifier==0.1.1) Installing collected packages: cffi, cryptography, secretstorage, keyring, yagmail, OctoPrint-EmailNotifier Running setup.py install for cffi: started Running setup.py install for cffi: finished with status 'error' Complete output from command /home/pi/OctoPrint/venv/bin/python2 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-ZYL9tN/cffi/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-MNn4jJ-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/pi/OctoPrint/venv/include/site/python2.7/cffi: Package libffi was not found in the pkg-config search path. Perhaps you should add the directory containing libffi.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libffi' found
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing libffi.pc' to the PKG_CONFIG_PATH environment variable No package 'libffi' found Package libffi was not found in the pkg-config search path. Perhaps you should add the directory containing libffi.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libffi' found
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing libffi.pc' to the PKG_CONFIG_PATH environment variable No package 'libffi' found Package libffi was not found in the pkg-config search path. Perhaps you should add the directory containing libffi.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libffi' found
running install
running build
running build_py
creating build
creating build/lib.linux-armv7l-2.7
creating build/lib.linux-armv7l-2.7/cffi
copying cffi/lock.py -> build/lib.linux-armv7l-2.7/cffi
copying cffi/backend_ctypes.py -> build/lib.linux-armv7l-2.7/cffi
copying cffi/init.py -> build/lib.linux-armv7l-2.7/cffi
copying cffi/verifier.py -> build/lib.linux-armv7l-2.7/cffi
copying cffi/recompiler.py -> build/lib.linux-armv7l-2.7/cffi
copying cffi/api.py -> build/lib.linux-armv7l-2.7/cffi
copying cffi/vengine_cpy.py -> build/lib.linux-armv7l-2.7/cffi
copying cffi/ffiplatform.py -> build/lib.linux-armv7l-2.7/cffi
copying cffi/setuptools_ext.py -> build/lib.linux-armv7l-2.7/cffi
copying cffi/vengine_gen.py -> build/lib.linux-armv7l-2.7/cffi
copying cffi/commontypes.py -> build/lib.linux-armv7l-2.7/cffi
copying cffi/model.py -> build/lib.linux-armv7l-2.7/cffi
copying cffi/cffi_opcode.py -> build/lib.linux-armv7l-2.7/cffi
copying cffi/cparser.py -> build/lib.linux-armv7l-2.7/cffi
copying cffi/_cffi_include.h -> build/lib.linux-armv7l-2.7/cffi
copying cffi/parse_c_type.h -> build/lib.linux-armv7l-2.7/cffi
copying cffi/_embedding.h -> build/lib.linux-armv7l-2.7/cffi
running build_ext
building '_cffi_backend' extension
creating build/temp.linux-armv7l-2.7
creating build/temp.linux-armv7l-2.7/c
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DUSE__THREAD -I/usr/include/ffi -I/usr/include/libffi -I/usr/include/python2.7 -c c/_cffi_backend.c -o build/temp.linux-armv7l-2.7/c/_cffi_backend.o
c/_cffi_backend.c:15:17: fatal error: ffi.h: No such file or directory
#include <ffi.h>
^
compilation terminated.
error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1


Command "/home/pi/OctoPrint/venv/bin/python2 -u -c "import setuptools, tokenize;file='/tmp/pip-build-ZYL9tN/cffi/setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record /tmp/pip-MNn4jJ-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/pi/OctoPrint/venv/include/site/python2.7/cffi" failed with error code 1 in /tmp/pip-build-ZYL9tN/cffi/
Hotovo!`

My installation is on RPi3 + Raspbian + Octoprint installed by this link:
https://github.com/foosel/OctoPrint/wiki/Setup-on-a-Raspberry-Pi-running-Raspbian

Other plugins was installed correctly.
Do you have somebody any ideas how to repair, please?

Thanks
Jan

Toggle notification via sidebar control

I may only want email notifications for unattended or particularly long-running print jobs. Therefore I want to enable email notifications on a job-by-job basis. (All other settings will remain the same.) Currently this is achieved by the Enabled checkbox in Email Notifier settings, which works fine (and requires user to visit Settings if they want to try it out, ensuring an opportunity to fill in other required settings). However it may be more streamlined to present that control in the main interface sidebar.

Not an Issue per se...

Hi,
Great plugin and very easy set up (When I followed the clear directions properly (I didn't 1st pass)...).

This is more of a request: I have the Raspberry Pi Camera V2, can we get a checkbox to mirror the image from left to right? Unlike my old USB camera, the Raspberry Pi Camera defaults to a mirrored image like a front facing phone camera.

Thanks,
Stefan Dembowski

STARTTLS Issues

I am receiving a STARTTLS WRONG_VERSION_NUMBER error. My email server is used by a number of people, and many different application clients, without issue. I believe the problem here is related to Python 3.5, and this StackOverflow issue.

I don't know, however, as I have dug through the YagMail repo and found no mention of this issue (and I feel like it would show up). Any help would be fantastic.

Configured with my email domain, port 587 Use TLS/Use SSL, the correct username and password, and Thunderbird connects to the account just fine...

password for encrypted keyring

Hi all,
I get this error in the log:

`2016-02-15 19:58:01,490 - py.warnings - WARNING - /usr/lib/python2.7/getpass.py:83: GetPassWarning: Can not control echo on the terminal.
passwd = fallback_getpass(prompt, stream)

2016-02-15 19:58:01,491 - octoprint.plugins.emailnotifier - ERROR - Email notification error:
Traceback (most recent call last):
File "/home/pi/OctoPrint/venv/local/lib/python2.7/site-packages/octoprint_emailnotifier/init.py", line 72, in on_event
mailer = yagmail.SMTP(user={self._settings.get(['mail_username']):self._settings.get(['mail_useralias'])}, host=self._settings.get(['mail_server']))
File "/home/pi/OctoPrint/venv/local/lib/python2.7/site-packages/yagmail/yagmail.py", line 68, in init
self.login(password)
File "/home/pi/OctoPrint/venv/local/lib/python2.7/site-packages/yagmail/yagmail.py", line 178, in login
password = self.handle_password(password)
File "/home/pi/OctoPrint/venv/local/lib/python2.7/site-packages/yagmail/yagmail.py", line 140, in handle_password
password = keyring.get_password('yagmail', self.user)
File "/home/pi/OctoPrint/venv/local/lib/python2.7/site-packages/keyring/core.py", line 42, in get_password
return _keyring_backend.get_password(service_name, username)
File "/usr/local/lib/python2.7/dist-packages/keyrings/alt/file.py", line 79, in get_password
password = self.decrypt(password_encrypted).decode('utf-8')
File "/usr/local/lib/python2.7/dist-packages/keyrings/alt/file.py", line 290, in decrypt
cipher = self._create_cipher(self.keyring_key, data['salt'],
File "/home/pi/OctoPrint/venv/local/lib/python2.7/site-packages/keyring/util/properties.py", line 52, in get
return self.fget(obj)
File "/usr/local/lib/python2.7/dist-packages/keyrings/alt/file.py", line 217, in keyring_key
self._unlock()
File "/usr/local/lib/python2.7/dist-packages/keyrings/alt/file.py", line 256, in _unlock
'Please enter password for encrypted keyring: ')
File "/usr/lib/python2.7/getpass.py", line 83, in unix_getpass
passwd = fallback_getpass(prompt, stream)
File "/usr/lib/python2.7/getpass.py", line 118, in fallback_getpass
return _raw_input(prompt, stream)
File "/usr/lib/python2.7/getpass.py", line 135, in _raw_input
raise EOFError
EOFError`

If I use this in the console, everything works fine and I received a mail;
~/OctoPrint/venv/bin/python
import yagmail
yagmail.SMTP('[email protected]').send('[email protected]', 'Test2', 'Mail von OctoPrint')

What can I do to make it work?
Where can I take in the plugin the password for the encrypted keyring?

Thanks for the help
Georg

SMTP _ssl Issue

HI set up everything and yagmail runs fine from teh cmd but in Octoprint I get following error:

init() got an unexpected keyword argument 'smtp_ssl'

emailnotify

Mail rejected due to invalid header

Mail sent from plugin gets rejected by certain mail systems, that checks for valid/required header contents.

E.g.:

Missing required header field: "Date"

Usernames without "@" in them

There is a quirk in yagmail which automatically appends "@gmail.com" to the username if no domain is given. However there is a way to explicitly specify the username and an alias (which is used for the FROM header).

I created a fix, which also add a new textfield for the alias, would you be interested in a pull request?

validate_email ERROR - On Test Email Send

I have attempted to get this plug in setup, but even once I installed keyring and yagmail I get:
"sending failed. Reason :: send() got an unexpected keyword argument "validate_email".

This makes it seem like by default octoprint doesn't come with the pip package validate_email installed, but I went ahead and installed it as well and still get that error.

EDIT: btw if I do a test send just from the python console using yagmail.SMTP().send() it works fine.

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.