Coder Social home page Coder Social logo

herrner / imap2imap Goto Github PK

View Code? Open in Web Editor NEW

This project forked from the-kube-way/imap2imap

0.0 0.0 0.0 55 KB

IMAP to IMAP forwarder: forward emails from one IMAP server to another!

License: GNU General Public License v3.0

Python 98.04% Dockerfile 1.96%

imap2imap's Introduction

IMAP to IMAP forwarder

main Project Status: Active โ€“ The project has reached a stable, usable state and is being actively developed.

This tool helps to gather emails from an IMAP server and forward them to another IMAP server.
This is especially useful if your provider prevents you from forwarding your emails automatically.

This tool uses almost only built-in libraries (except PyYAML) and should works on any Python 3.4+

Only bugfix or backward compatible feature are accepted. Feel free to open issue or PR.

Author: FL42

Command-line usage

Install dependencies using:

pip3 install --user -r requirements.txt

Run the program:

python3 imap2smtp.py -c config.yaml

Docker usage

A Docker image is available at ghcr.io/the-kube-way/imap2imap.
Only a latest tag representing the main branch is present.

You may want to use the TZ environment variable to set the timezone.

Configuration file format

See example.yaml.
All sections are required (even if there are empty).

common section

  • debug: (bool) Enable debugging mode (more verbose). Default to false.
  • sleep: In case of error a new attempt will be made 10s after indefinitely (except for one-time run)
    • not present: exit immediately after one run (could be useful to use with cron) Exit code is 1 if forwarding failed, else 0.
    • (int) constant time to sleep between 2 checks for new emails to forward
  • sleep_var_pct: (int in %) Allow sleep time to vary uniformly in [(100-sleep_var_pct)/100 * sleep; (100+sleep_var_pct)/100 * sleep]

src_imap section

  • host: (str) hostname of the IMAP server
  • port: (int) Default to 143 if ssl is false, 993 if ssl is true
  • ssl: (bool) Enable SSL
  • user: (str) IMAP user
  • password: (str) IMAP password
  • mailbox: (str) mailbox name to check for emails to forward. Default to 'INBOX'.
  • on_success: (dict) actions to execute when a message is successfully forwarded
    • delete_msg: (bool) Delete email on the source IMAP server
    • mark_as_seen: (bool) mark forwarded emails as seen. Default to false.
    • move_to_mailbox: (str) move forwarded emails to different mailbox (on the source IMAP server) after forwarding (e.g. 'Fowarded emails'). Set to null to disable. Default to forwarded. This folder must exist. Take care that all emails in mailbox will be forwarded at each loop, thus using move_to_mailbox is strongly advised

dest_imap section

  • host: (str) hostname of the IMAP server
  • port: (int) Default to 143 if ssl is false, 993 if ssl is true
  • ssl: (bool) Enable SSL
  • user: (str) IMAP user
  • password: (str) IMAP password
  • mailbox: (str) destination mailbox to store forwarded emails. Default to 'INBOX'.

imap2imap's People

Contributors

fl42 avatar

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.