Code Monkey home page Code Monkey logo

formair's Introduction

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 [email protected]: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:
      - '[email protected]'
      - '[email protected]'
    from_addrs:
      - '[email protected]'
      - '[email protected]'
    subject_pattern: ''
    content_pattern: ''
  -
    to_addrs:
      - '[email protected]'
      - '[email protected]'
    from_addrs:
      - '[email protected]'
      - '[email protected]'
    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

formair's People

Contributors

k8scat avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

formair's Issues

转发新邮件问题

forward_emails方法返回index -1 ,如果最后一封邮件触发转发条件,下次调转发的时候会把最后一封再发一遍。只是转发新邮件是不是应该返回index

hello

hi bro, i can't use the script

`pip install formair` not work correctly

$ pip3 install formair
ERROR: Could not find a version that satisfies the requirement formair (from versions: none)
ERROR: No matching distribution found for formair

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.