2 Star 5 Fork 2

K8sCat / ForMaiR

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

ForMaiR - auto Forward eMails with custom Rules

CodeFactor

GitHub | 码云

自定义规则的邮件自动转发工具。

使用 Docker 快速开始

参考配置:template/config.yaml

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

安装

使用 pip

python3 -m pip install --user formair

使用 git

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

使用

参考配置:template/config.yaml

formair # 从 ./config.yaml 中加载配置

formair /path/to/config.yaml # 从 /path/to/config.yaml 中加载配置

自定义规则

满足下列任一规则的邮件会被转发到指定的邮箱列表(to_addrs

  • 邮件的发件人(from_addr[1])在指定的发件人列表中(from_addrs
  • 邮件的主题(subject)匹配指定的主题正则表达式(subject_pattern
  • 邮件的内容(plain_contenthtml_content)匹配指定的内容正则表达式(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: ''

只转发新邮件

支持转发指定范围内的新邮件。

  • index_file 文件中获取上次读取的邮件位置(last_email_index) (如果文件不存在,则默认是 0)
  • pop3_server.stat 获取当前邮件的总数(email_count
for index in range(last_email_index+1, email_count+1):
    pass

文档

https://formair.io

MIT License Copyright (c) 2021 K8sCat <k8scat@gmail.com> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

auto Forward eMails with custom Rules 自定义规则的邮件自动转发工具 展开 收起
Python
MIT
取消

发行版 (6)

全部

贡献者

全部

近期动态

加载更多
不能加载更多了
Python
1
https://gitee.com/k8scat/ForMaiR.git
git@gitee.com:k8scat/ForMaiR.git
k8scat
ForMaiR
ForMaiR
master

搜索帮助