All Projects → dimkouv → protonmail-cli

dimkouv / protonmail-cli

Licence: MIT License
✉️ Command line utility for https://protonmail.com -- unofficial

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to protonmail-cli

karate
Test Automation Made Simple
Stars: ✭ 6,384 (+8891.55%)
Mutual labels:  automated-testing
three-musketeers
A simple module to introspect, debug and test any THREE.js application.
Stars: ✭ 30 (-57.75%)
Mutual labels:  automated-testing
karate-runner
VSCode Extension for Karate
Stars: ✭ 23 (-67.61%)
Mutual labels:  automated-testing
auto-vo
Screen reader automation tools by AccessLint, including VoiceOver.js and Auto-VO
Stars: ✭ 118 (+66.2%)
Mutual labels:  automated-testing
screenpy
Screenplay pattern base for Python automated UI test suites.
Stars: ✭ 38 (-46.48%)
Mutual labels:  automated-testing
yt-videos-list
Create and **automatically** update a list of all videos on a YouTube channel (in txt/csv/md form) via YouTube bot with end-to-end web scraping - no API tokens required. Multi-threaded support for YouTube videos list updates.
Stars: ✭ 64 (-9.86%)
Mutual labels:  geckodriver
heroku-integrated-firefox-geckodriver
Buildpack enables your client code to access Firefox along with Geckodriver in a Heroku slug.
Stars: ✭ 40 (-43.66%)
Mutual labels:  geckodriver
docker-protonmail-bridge
Run ProtonMail Bridge in a docker container
Stars: ✭ 34 (-52.11%)
Mutual labels:  protonmail
api-test
🌿 A simple bash script to test JSON API from terminal in a structured and organized way.
Stars: ✭ 53 (-25.35%)
Mutual labels:  automated-testing
GeckoDriver ARMv6
Compiled binaries of Gecko Driver for ARMv6 architecture (cross-compiled)
Stars: ✭ 22 (-69.01%)
Mutual labels:  geckodriver
nightwatch101
使用 Nightwatch 實現 End-to-End Testing ★
Stars: ✭ 42 (-40.85%)
Mutual labels:  automated-testing
pyderman
Install Selenium-compatible Chrome/Firefox/Opera/PhantomJS/Edge webdrivers automatically.
Stars: ✭ 24 (-66.2%)
Mutual labels:  geckodriver
powerapps-specflow-bindings
A SpecFlow bindings library for model-driven Power Apps.
Stars: ✭ 19 (-73.24%)
Mutual labels:  automated-testing
cucumber-performance
A performance testing framework for cucumber
Stars: ✭ 28 (-60.56%)
Mutual labels:  automated-testing
protonmail-api
✉ Node.js API for ProtonMail
Stars: ✭ 108 (+52.11%)
Mutual labels:  protonmail
robotframework-zoomba
Extended Robot Framework libraries to make testing GUI, REST/SOAP API, Mobile, and Windows Desktop easier.
Stars: ✭ 121 (+70.42%)
Mutual labels:  automated-testing
Awesome-Cucumber
A collection of awesome Cucumber and Gherkin-related resources
Stars: ✭ 33 (-53.52%)
Mutual labels:  automated-testing
API-Testing-Automation-Framework
It is Data-Driven and Keyword-Driven framework to test REST/SOAP webservices automatically
Stars: ✭ 24 (-66.2%)
Mutual labels:  automated-testing
protonmail-webextension
Unofficial webextension for ProtonMail
Stars: ✭ 39 (-45.07%)
Mutual labels:  protonmail
Reconky-Automated Bash Script
Reconky is an great Content Discovery bash script for bug bounty hunters which automate lot of task and organized in the well mannered form which help them to look forward.
Stars: ✭ 167 (+135.21%)
Mutual labels:  automated-testing

ProtonMail CLI

protonmail-cli v0.0.3 Python 3 OS Unofficial

Command line utility for https://protonmail.com

Installation

System dependencies (Probably everything's already installed)

sudo apt install -y xvfb python3-pip firefox                 # on debian
sudo dnf install xorg-x11-server-Xvfb python3-pip firefox    # on fedora
sudo pacman -S xorg-server-xvfb python-pip firefox wget      # on arch

Geckodriver

# Find your release: https://github.com/mozilla/geckodriver/releases

# for linux x64
wget https://github.com/mozilla/geckodriver/releases/download/v0.26.0/geckodriver-v0.26.0-linux64.tar.gz

sudo tar -xvf geckodriver-*.tar.gz -C /usr/local/bin/ ; rm geckodriver-*.tar.gz

Protonmail CLI

git clone https://github.com/dimkouv/protonmail-cli /opt/protonmail-cli

ln -s /opt/protonmail-cli/protonmail-cli.py /bin/protonmail-cli
pip3 install -r /opt/protonmail-cli/requirements.pip

Usage

Use as a command line

# show full usage
protonmail-cli --help
# each sub-command has its own `--help` section.

# list inbox - print latest mails
protonmail-cli list -t inbox
protonmail-cli list -t spam

# check inbox for new mails
protonmail-cli check

# send mail
protonmail-cli send \
    -t "[email protected]" \
    -t "[email protected]" \
    -s "my subject" \
    -b "my mail message" \
    --html # (optional if you want to render body as html) \
    -a "/path/to/file.jpg" \ # (optional for adding attachments)
    -a "/path/to/other/file.pdf"

Global settings, including user credentials, can be specified on /opt/protonmail-cli/protonmail/settings.py

User credentials can also be set in their own file, overriding those found inside settings.py. The global argument --credential allow you to set the file path of this config file. This would allow better security by allowing each user of a multi-users machine to keep their credentials inside their home folder.

If user credentials are not specified in settings.py or credentials file then cli prompts you to type them.

Example usage of separate credentials file

# /home/user/protonmailcli.ini

[credential]
username = [email protected]
password = mysafepass
protonmail-cli --credential /home/user/protonmailcli.ini list 

For even better security, chmod 600 this file, so only the user launching the application can read it.

Run in an interactive session

Simply run protonmail-cli without any parameters to open an interactive session.

[Anonymous] Choose an option from the menu
m           : Shows this menu
x           : Exit
l           : Login
> l
ProtonMail email or username: dimkouv
ProtonMail password:
Loading...
Welcome dimkouv

[dimkouv] Choose an option from the menu
m           : Shows this menu
x           : Exit
e           : Logout
inbox       : Show inbox mails
drafts      : Show drafts
sent        : Show sent mails
starred     : Show starred mails
archive     : Show archived mails
spam        : Show spam mails
trash       : Show trash mails
allmail     : Show all mails
>

Use as a package

Core functions can be called directly from your code instead of using protonmail-cli

pip3 install git+https://github.com/dimkouv/protonmail-cli

Usage example

import protonmail

client = protonmail.core.ProtonmailClient()
client.login("[email protected]", "mypassword")

# send mails
client.send_mail(
    ["[email protected]", "[email protected]"],
    "subject",
    "my mail message"
)

# send mails as html
client.send_mail(
    ["[email protected]", "[email protected]"],
    "subject",
    """
    <h1>hello friend</h1>
    <p>This message was sent from <strong>protonmail-cli</strong></p>
    """,
    as_html=True
)

# upload attachments
client.send_mail(
    ...,
    attachments=[
        '/path/to/file.jpg',
        '/path/to/other/file.pdf'
    ]
)

# read mails
mails = client.get_mails("inbox")
spam = client.get_mails("spam")

# check for new mail
has_new_mail = client.has_new_mail()

client.destroy()

Testing

cd protonmail-cli
virtualenv -p python3 venv
source venv/bin/activate
pip install .
python3 tests/core_test.py
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].