Skip to main content

IMAP-to-SMTP relay: imaprelay relays messages from an IMAP INBOX to an SMTP server

Project description

imaprelay is a simple tool designed to scratch a very specific itch. Presented with an institutional email account that he had an obligation to check, but lacking desire to use the Outlook Web Access interface, the author was dismayed to find that he was unable to forward his email.

The solution is imaprelay, a python program that logs into an IMAP account and relays emails from the Inbox to a specified email address, via an SMTP server. Once relayed, emails are “archived” – moved out of the inbox into a different folder.

Although usable programmatically [1], it is expected that most people will want to use the imaprelay command-line tool that this package provides.

By default, this program will look for a configuration file in ~/.secret/imaprelay.cfg – its location should indicate that it needs to contain plain-text passwords for IMAP and SMTP servers, and thus the program will exit immediately if the file is group- or world-readable.

The available configuration options are listed below:

# IMAP server connection details

# SMTP server connection details

# Relay configuration
# Who should we relay the emails to?
# Where should we look for emails to be relayed?
# Where should we move the emails once successfully relayed?

Once you’ve written a config file, all you need to do is run:


For verbose logging, use:

imaprelay -v

Bug reporting

Please report bugs on Github.

[1]See the imaprelay.Relay class.

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 imaprelay, version 0.0.5
Filename, size File type Python version Upload date Hashes
Filename, size imaprelay-0.0.5.tar.gz (5.6 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page