Skip to main content

auto Forward eMails with custom Rules

Project description

ForMaiR - auto Forward eMails with custom Rules

CodeFactor

GitHub | 码云

Quick start using Docker

Refer config: template/config.yaml

docker run -d --rm \
-v /path/to/config.yaml:/formair/conf/config.yaml \
k8scat/formair:latest

Installation

Install using pip

python3 -m pip install --user formair

Install using git

git clone git@github.com:k8scat/ForMaiR.git
cd ForMaiR
python3 setup.py install

Usage

Refer config: template/config.yaml

formair # load config from ./config.yaml

formair /path/to/config.yaml # load config from /path/to/config.yaml

Custom rules

Emails which meet follow rules will be auto forwarded to to_addrs.

  • Email from_addr[1] in from_addrs
  • Email subject meet subject_pattern
  • Email plain_content or html_content meet content_pattern
rules:
  -
    to_addrs:
      - 't1@example.com'
      - 't2@example.com'
    from_addrs:
      - 'f1@example.com'
      - 'f2@example.com'
    subject_pattern: ''
    content_pattern: ''
  -
    to_addrs:
      - 't1@example.com'
      - 't2@example.com'
    from_addrs:
      - 'f1@example.com'
      - 'f2@example.com'
    subject_pattern: ''
    content_pattern: ''

Only forwarding the new emails

Support forwarding new emails in the specified range.

  • Get last_email_index from the index_file (default 0 if not exists)
  • Get email_count from pop3_server.stat
for index in range(last_email_index+1, email_count+1):
    pass

Docs

https://formair.io

Project details


Download files

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

Source Distribution

formair-1.3.1.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

formair-1.3.1-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file formair-1.3.1.tar.gz.

File metadata

  • Download URL: formair-1.3.1.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.6.12

File hashes

Hashes for formair-1.3.1.tar.gz
Algorithm Hash digest
SHA256 f413ffb63501cbad98d4effd43bfca3acc80b1e2994e766b88a7bcdeb356caa6
MD5 cf66de5cca82e22d7798916621e072aa
BLAKE2b-256 e73606883250d3cca02c19b93e0ed1743a8df3c4d14962ca5fa8d2373d72a64a

See more details on using hashes here.

File details

Details for the file formair-1.3.1-py3-none-any.whl.

File metadata

  • Download URL: formair-1.3.1-py3-none-any.whl
  • Upload date:
  • Size: 8.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.6.12

File hashes

Hashes for formair-1.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 251bafd1bbd1a8e14bdda0e5ff4cb57d481b8be40263a41d4937b2ca8c3d4c24
MD5 0c9265632a91c7db73424bbabd14bc50
BLAKE2b-256 90d2dd1457be0c92085ccb40e581d9c629edf09eb4cde70a492a37a338f717d9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page