itsnotgoodname / email-to-telegram Goto Github PK
View Code? Open in Web Editor NEWTelegram bot that reads a mail file and forwards to Telegram chat.
License: MIT License
Telegram bot that reads a mail file and forwards to Telegram chat.
License: MIT License
I am trying to setup this nice service. I followed all instructions - and created an (empty) folder /var/spool/mail/telegram. After firing up systemd service and look at status of email-to-telegram I see the message above (but the service is running). I copied a message to the folder but nothing happens API token and chat_id are set correctly.
Here the complete systemd-status messages:
`Mai 22 10:53:59 myserver email-to-telegram[914750]: event_handler.consume_emails()
Mai 22 10:53:59 myserver email-to-telegram[914750]: File "/usr/lib/python3.9/site-packages/email_to_telegram/email.py", line 18, in consume_emails
Mai 22 10:53:59 myserver email-to-telegram[914750]: emails, delete_count = get_emails(self.mail_path)
Mai 22 10:53:59 myserver email-to-telegram[914750]: File "/usr/lib/python3.9/site-packages/email_to_telegram/utils.py", line 9, in get_emails
Mai 22 10:53:59 myserver email-to-telegram[914750]: mbox = mailbox.mbox(mail_path)
Mai 22 10:53:59 myserver email-to-telegram[914750]: File "/usr/lib/python3.9/mailbox.py", line 850, in init
Mai 22 10:53:59 myserver email-to-telegram[914750]: _mboxMMDF.init(self, path, factory, create)
Mai 22 10:53:59 myserver email-to-telegram[914750]: File "/usr/lib/python3.9/mailbox.py", line 584, in init
Mai 22 10:53:59 myserver email-to-telegram[914750]: f = open(self._path, 'rb+')
Mai 22 10:53:59 myserver email-to-telegram[914750]: IsADirectoryError: [Errno 21] Is a directory: '/var/spool/mail/telegram'`
gpg signed mails cannot be processed. It seems that the signature is interpreted as an image:
Mai 23 08:15:42 myserver email-to-telegram[1299168]: ERROR:root:Image_process_failed
It would be better to remove the signature and forward the email without that. This is the part that should not be parsed for looking if it is an image:
Content-Type: application/pgp-signature; name="signature.asc"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.