Code Monkey home page Code Monkey logo

mail-auth-cli's Introduction

Simple IMAP and SMTP Credential Tester

This CLI tool allows you to test IMAP and SMTP connection details using provided credentials. You can specify the connection details either through command-line options or a configuration file, but not both.

Features

  • Test IMAP and SMTP connections.
  • Support for SSL and TLS.
  • Provide credentials through CLI or a JSON configuration file.
  • Verbose mode for detailed connection information.

Installation

  1. Clone the repository:
git clone https://github.com/a-wiseguy/mail-auth-cli.git
  1. Navigate to the project directory:
cd mail-auth-cli
  1. (Optional) Create a virtual environment:
python -m venv venv
source venv/bin/activate  # On Windows use `venv\Scripts\activate`
  1. Install the required packages:
pip install -r requirements.txt

Usage

You can run the script using either CLI options or a JSON configuration file.

Using CLI Options

python mail-auth-cli.py --imap-host <IMAP_HOST> --smtp-host <SMTP_HOST> --username <USERNAME> --password <PASSWORD> [OPTIONS]

Using a Configuration File

Create a JSON file (e.g., config.json) with the following structure:

{
  "imap_host": "mail.example.com",
  "imap_port": 993,
  "smtp_host": "mail.example.com",
  "smtp_port": 465,
  "username": "[email protected]",
  "password": "passwordhere",
  "use_tls": false,
  "test_imap": true,
  "test_smtp": true
}

Run the script with the configuration file:

python mail-auth-cli.py --config-file config.json

Command-Line Options

  • --config-file : Configuration file with connection details in JSON format.
  • --imap-host : IMAP server host.
  • --imap-port : IMAP server port (default: 993).
  • --smtp-host : SMTP server host.
  • --smtp-port : SMTP server port (default: 465 for SSL, 587 for TLS).
  • --username : Username for login.
  • --password : Password for login. If not provided, you will be prompted.
  • --use-tls : Use TLS for SMTP connection (default: False).
  • --verbose : Enable verbose output.
  • --test-imap : Test IMAP connection only.
  • --test-smtp : Test SMTP connection only.

Example

Testing both IMAP and SMTP connections with verbose output:

python mail-auth-cli.py --imap-host mail.example.com --smtp-host mail.example.com --username [email protected] --password passwordhere --verbose

Contributing

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature-branch).
  3. Commit your changes (git commit -am 'Add new feature').
  4. Push to the branch (git push origin feature-branch).
  5. Create a new Pull Request.

Issues

If you encounter any issues, please create a new issue in the GitHub repository.

Contact

For any inquiries, please contact [email protected].

mail-auth-cli's People

Contributors

a-wiseguy avatar

Watchers

 avatar

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.