? Editing: Post:21.body Save Delete Cancel
Content changed Sign & Publish new content

BinChan's ZeroNotes

Messy Notes about using ZeroNet and other things
All code published here are under CC-BY-SA licence, if not compatible, then MIT license X)

Follow in NewsfeedFollowing

TOC by date
TOC by tag
View in light theme

Latest comments:

Add new post

Title

21 hours ago · 2 min read ·
3 comments

tag:
Body
Read more

Not found

Local ZeroMail Bot

on Jan 10, 2018 · 2 min read
tag: bot zeronet

This is a Python2 script that decrypts your ZeroMail and sends them to a local bot. After you schedule the bot and follow it, you can receive new ZeroMail notification from ZeroHello newsfeed.

Table of Contents

How to install:

  1. Open ZeroMail bot zite, then from ZeroHello [FAQ 1], choose 3-dot menu after the zite "Local ZeroMail Bot" and clone it. Again from ZeroHello choose the menu after your new "myLocal ZeroMail Bot" and check "Pause" (Because it's for local use ;) (If you can't open the zite, you can download it here and unzip it to /path/to/zeronet/data/, you may need to restart ZeroNet server to open it).
  2. On your new bot zite select an id you like and send a message, so your id folder is generated in your zite. Also hit the "Follow" button.
  3. Download ZeroMailBot.zip from my blog, then unzip it to the root folder of your ZeroNet instance. Or clone and copy it from my messy repo.
  4. Finally start the bot with $ python2 zeromail_bot.py, follow the instruction and done! You can schedule the bot with cron, systemd, or with a simple command like $ while sleep TIME_INTERVAL_IN_SECOND; do python2 zeromail_bot.py; done.

Screenshot:


mailbot2.png (0x0)

FAQ:

  1. Is it possible that my zeromails leak to the public?

    It should be impossible, because I also tweaked cert_signers in data/users/content.json to "zeroid.nobit": ["2iD5ZQJMNXu43w1qLB8sfdHVKppVMduGz"], so your content will never be published.

    But it's possible that my private key to the ZeroMail bot zite got leaked and the hacker changed the settings of my bot zite, so for security you may prefer check the code and download the zite from my messy repo [clearnet alternative on git.gnu.io].

    If you want more security, like not saving your ZeroMail in plaintext, you can change these lines in zeromail_bot.py, and ZeroMailBot won't store (and display) your ZeroMail content:

            output_data['message'] += [{
    -                    'body': message['body'],
    +                    'body': '',
    -                    'send_from': message['from'],
    +                    'send_from': '',
                        'send_to': message['to'],
    -                    'subject': message['subject'],
    +                    'subject': '',
                        'date_sent': message['date_sent'],
                        'date_added': int(time.time()*1000)
                        }]
    

    ZeroMailBot also stores your contact list and last update info of received mails in plaintext for performance reason. You can also remove them by:

    secrets = []
    
    if not os.path.isfile('ZeroMailBot/last_update_info.json'):
        last_update_info = {}
    - else:
    -     last_update_info = json.load(open('ZeroMailBot/last_update_info.json'))
    ...
    - json.dump(last_update_info, open('ZeroMailBot/last_update_info.json', "w"), indent=2)
    return decrypted_data
    
  2. Can I send zeromail from the bot? If not, why did you bother creating a UI for it?

    No. Well.. because of personal interest. Also in some machine (like my Raspberry Pi 2), it can be very slow to open ZeroMail. So.. before your ZeroMail is initiated, you can read the mail on the bot zite.

Credits:

  • Thank gitcenter for extracting the essential functions to cryptlib.py and many other things!
  • Thank bornfree for the idea and some related code!
  • ZeroMailProxy - SMTP/POP3 protocol for ZeroMail by gitcenter.
  • ZeroMail to Email Client Transport maintained by bornfree
    Localhost POP3 + SMTP server which will eventually allow your favorite e-mail client to send/recieve messages over ZeroMail. (Python, CC0)

8 Comments:

user_name1 day ago
Reply
Body
binchan2on Feb 23, 2018
Reply

ssdifnskdjfnsdjk: Hello, the installation step "4." looks like to be for Linux. Is possible to mention in tutorial on how to do that step on Windows?

Sorry, I don't use Windows, and the bot script probably only works for GNU/Linux. Iirc Windows now supports Linux very well, you can search for it and may need some extra apps.

ssdifnskdjfnsdjkon Feb 23, 2018
Reply

Hello, the installation step "4." looks like to be for Linux. Is possible to mention in tutorial on how to do that step on Windows?

binchan2on Jan 11, 2018
Reply

gitcenter: Just noticed a bug in my ZeroMailProxy repo :) That IMAP/POP3 is in fact SMTP/POP3.

Fixed.

gitcenter: Could not download your 16WKzsiU8QrYo2AghXEpMT6LaMQVofLmqC site.

I've published it to my clearnet proxy. There are currently only 2 peers though. Ok.. I also zip it to my blog, you can download it here and unpack it to data folder. You may need to restart ZeroNet server to open it.

gitcenteron Jan 10, 2018
Reply

Could not download your 16WKzsiU8QrYo2AghXEpMT6LaMQVofLmqC site.

gitcenteron Jan 10, 2018
Reply

Just noticed a bug in my ZeroMailProxy repo :) That IMAP/POP3 is in fact SMTP/POP3.

binchan2on Jan 10, 2018
Reply

zerolstn: Very cool! While some may say it might've been easier to just add notification functionality as a PR to ZeroMail in the first place, this allows for the ability to do loads of cool things with ZeroMail, now that we can read and decrypt messages.
Props for slogging through everything to get it working!

Thanks :D Also it's not just my work. If you check the related topic on ZeroTalk, you may find out how we three (gitcenter, bornfree and me) collaborated and made it work. It's really an interesting experience.

erneraudeon Jan 10, 2018
Reply

zerolstn: Very cool! While some may say it might've been easier to just add notification functionality as a PR to ZeroMail in the first place, this allows for the ability to do loads of cool things with ZeroMail, now that we can read and decrypt messages.
Props for slogging through everything to get it working!

It's not that easy, because the plugin NewsFeed does not manage decryption of data stored in database. ;)

zerolstnon Jan 10, 2018
Reply

Very cool! While some may say it might've been easier to just add notification functionality as a PR to ZeroMail in the first place, this allows for the ability to do loads of cool things with ZeroMail, now that we can read and decrypt messages.

Props for slogging through everything to get it working!

Select user
  • Welcome to ZeroMessage!
This page is a snapshot of ZeroNet. Start your own ZeroNet for complete experience. Learn More