almost simple imap2smtp script in python, but has the option to convert html parts of the email to text if needed.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

A simple script to download email from the inbox of a remote IMAP server. It then sends it to a specified smtp server and destination email, preserving the sender. There is an option to convert the first HTML part of a multipart email to text, or if a single part email replace the whole HTML body with the converted text. This was made to work around the quirks of both an outsourced email provider and some older helpdesk software.

In a Debian/Ubuntu type operating system the following modules may need to be installed:

apt-get install python-argparse
apt-get install python-html2text
apt-get install python-argparse

tested on Python 2.6.5 and Python 2.7.3

All config options can be specified on the command line, or in a config file.

The config file uses the python .ini syntax of:

imap_server =
from_account = fred
from_password = xxxpasswordxxx
to_smtp_server =
to_address =
syslog = Yes
verbose = No
fixemailforwd = Yes
lockfile = /tmp/this_is_a.lock
# optional TCP timeout in seconds
timeout = 15

but there should only be one section and the name of the section doesnt matter.