GithubHelp home page GithubHelp logo

bosodo / exchange-mailbox-cleaner Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 26 KB

Cleanup tool for Microsoft Exchange mailbox. Easy delete e-mails from MS Exchange Server (with backup/export messages to .eml files).

License: BSD 2-Clause "Simplified" License

Python 100.00%
exchange outlook exchange-web-services microsoft microsoft-exchange

exchange-mailbox-cleaner's Introduction

Exchange mailbox cleaner

Cleanup tool for Microsoft Exchange mailbox (https://github.com/bosodo/exchange-mailbox-cleaner/).

You can use it to delete emails from exchange mailboxes, that are not managed by Outlook, OWA or etc. (e.g. technical e-mail accounts). Deleted emails can be exported to .eml files. (default option is hard-delete e-mails).

  • exch-mbox-cleaner.py based on exchangelib, which use Microsoft Exchange Web Services (EWS) to communicate with MS Exchange server.

Options

-h --help                     Show this screen.
--version                     Show version.
--days=<number_days>          Emails more than x days old will be deleted [default: 30]
--inbox-subdir=<directory>    Subdirectory in INBOX (or select --inbox as root)
--bckp=DIR                    Location to backup deleted emails (directory must exist!).
--soft                        Soft-delete (keep a copy in the recoverable items folder).
--trash                       Move message to the trash folder.
--dry-run                     Only "dry-run". Run script without deleting emails.

Dependency

Python 3.6+. Before run, install the required dependencies with:

pip install -r requirements.txt

Usage

$ exch-mbox-cleaner.py <exch-server> <user-name> <user-pass> (--inbox | --inbox-subdir=<directory>) [--days=<number_days>] [--bckp=DIR] [--dry-run] [(--soft | --trash)]
$ exch-mbox-cleaner.py (-h | --help)
$ exch-mbox-cleaner.py --version
  • <user-name> - jan_kowalski or with domain [email protected] depend on your exchange configuration

Examples

$ exch-mbox-cleaner.py exchange.example.org [email protected] Password! --inbox --days=180 --bckp='./deleted-emails'
$ exch-mbox-cleaner.py exchange.example.org [email protected] Password! --inbox-subdir='Sample subdirectory' --days=180 
--bckp='./deleted-emails'

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.