Skip to main content

Python library and command line tool for removing/restoring emails in office365/Exchange using EWS API

Project description

PhishFry Remediation Library and Command Line Tool

PhishFry is a python library and command line tool for removing and restoring emails in exchange and office365. PhishFry supports shared mailboxes, group mailboxes and distribution lists. PhishFry removes/restores the entire conversation including any replies and forwards of the message.


Install with pip directly from github.

sudo pip install git+

Add credentials for one or more exchange accounts with impersonation rights to the config.ini file.

Example config.ini file:


Command Line Tool

# display usage information
./ -h

# Remove message with message_id=<message_id> from the mailbox
./ remove "<message_id>"

# Restores message with message_id="<message_id>" to the mailbox
./ restore "<message_id>"


import phishfry

# Instantiate a phishfry account using admin email and password
account = phishfry.Account("", "123456")

# remove a message
results = account.Remove("", "<message_id>")

# restore a message
results = account.Restore("", "<message_id>")

# using the results
for address in results:
	# print the email address for these results

	# get the remediation result for this address
	result = results[address]

	# print failure message if remediation action failed
	if not result.success:

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for phishfry, version 1.0.1
Filename, size File type Python version Upload date Hashes
Filename, size phishfry-1.0.1-py3-none-any.whl (10.1 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size phishfry-1.0.1.tar.gz (7.7 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page