Now that you’ve started the ball rolling i would be really glad if you can point me to fix eventually critical issue regarding the send-email function i provided, for the sake of the community (and to lighten the load on Joe’s shoulders).
There was a long debacle in another thread, we tried to use the “built in” sendemail alternative with no success do to some limitations (the hard-to-make encoding, but most for the lenght of the payload). So, grabbing a tips, i tried to provide a functional wrapper for not let Joe to struggle more on this “stupid” problem (yes, IMHO, in 2025 send an email shouldn’t be so tricky).
I didn’t create anything new, i just get info from here and there and combine them for our scope, just most relevant
- Securing Your Email Sending With Python: Authentication and Encryption
- python - How to send email attachments? - Stack Overflow
- Invio email | Gmail | Google for Developers
- middleware/src/middlewared/middlewared/plugins/mail.py at c2eafe7dc003c83f2589414a7d9de107b1e7af93 · truenas/middleware · GitHub
- middleware/src/middlewared/middlewared/plugins/mail_/gmail.py at c2eafe7dc003c83f2589414a7d9de107b1e7af93 · truenas/middleware · GitHub
Also to mention: the script itself rely totally on mail.config
provided in truenas, no sensible data is stored or saved or send; and offcourse, my github account is protected by 2FA.
oxyde1989/standalone-tn-send-email: stand alone truenas send email
Thanks in advance for the support!