Skip to main content

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
[imap]
hostname=imap.exchange.megacorp.com
username=j.bloggs
password=123password

# SMTP server connection details
[smtp]
hostname=mail.recipient.com
username=joe_bloggs
password=passw0rd

# Relay configuration
[relay]
# Who should we relay the emails to?
to=onward@recipient.com
# Where should we look for emails to be relayed?
inbox=INBOX
# Where should we move the emails once successfully relayed?
archive=Archive

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

imaprelay

For verbose logging, use:

imaprelay -v

Bug reporting

Please report bugs on Github.

Metadata

Release files for imaprelay 0.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for imaprelay 0.0.5
File Size Uploaded
imaprelay-0.0.5.tar.gz 5.6 kB Details

Release files / imaprelay-0.0.5.tar.gz

Download URL imaprelay-0.0.5.tar.gz
Size 5.6 kB
Tags Source
SHA-256 checksum
How to use checksums
136168ddc8fce374ee95e3274e9eb8609dd5dcc5eb075713488c339b4101abec
BLAKE2b-256 checksum
How to use checksums
ea182b8e814d40db7e2bfed8c48c31ea66d30f155eec43ed58a62565e70d65c4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.0.5 This release

1 release file

0.0.4

1 release file

0.0.3

1 release file

0.0.2

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page