V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
hsowan
V2EX  ›  Python

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

  •  1
     
  •   hsowan ·
    k8scat · 2021-02-07 17:39:58 +08:00 · 1375 次点击
    这是一个创建于 1165 天前的主题,其中的信息可能已经有所发展或是发生改变。

    由于邮箱自带的转发功能只能转发到指定的邮箱,并不能对邮件内容进行过滤,所以就趁着 leader 过年肥家不在写了这个邮件自动转发工具 ForMaiR

    ForMaiR: auto Forward eMails with custom Rules

    自定义规则

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

    • <input checked="" disabled="" type="checkbox"> 邮件的发件人(from_addr[1])在指定的发件人列表中(from_addrs
    • <input checked="" disabled="" type="checkbox"> 邮件的主题(subject)匹配指定的主题正则表达式(subject_pattern
    • <input checked="" disabled="" type="checkbox"> 邮件的内容(plain_contenthtml_content)匹配指定的内容正则表达式(content_pattern
    email = {
        'from_addr': ('realname', '[email protected]'),
        'subject': '',
        'plain_content': '',
        'html_content': ''
    }
    
    transfer_rules = [
        {
            'to_addrs': [''],
            'from_addrs': [''],
            'subject_pattern': r'',
            'content_pattern': r''
        }
    ]
    

    关于 last_email_count

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

    [last_email_count+1, email_count+1]
    
    • last_email_countindex_file 文件中读取 (如果文件不存在,则默认是 0)
    • email_countpop3_server.stat 获取

    开源代码

    原文链接:https://k8scat.com/posts/formair/

    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5210 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 597ms · UTC 09:27 · PVG 17:27 · LAX 02:27 · JFK 05:27
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.