" />

最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

python ForMaiR實(shí)現(xiàn)自定義規(guī)則的郵件自動轉(zhuǎn)發(fā)工具

 更新時(shí)間:2023年12月14日 10:56:25   作者:K8sCat  
這篇文章主要為大家介紹了python ForMaiR實(shí)現(xiàn)自定義規(guī)則的郵件自動轉(zhuǎn)發(fā)工具示例詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪

郵件自動轉(zhuǎn)發(fā)工具 ForMaiR

由于郵箱自帶的轉(zhuǎn)發(fā)功能只能轉(zhuǎn)發(fā)到指定的郵箱,并不能對郵件內(nèi)容進(jìn)行過濾,所以就趁著 leader 過年肥家不在寫了這個(gè)郵件自動轉(zhuǎn)發(fā)工具 ForMaiR。

ForMaiR: auto Forward eMails with custom Rules

自定義規(guī)則的郵件自動轉(zhuǎn)發(fā)工具。

使用

# 克隆代碼倉
git clone git@gitee.com:hsowan/ForMaiR.git
cd ForMaiR
# 從 template/config.yaml 復(fù)制一份配置文件
cp template/config.yaml config.yaml
# 初始化 python3 的環(huán)境
virtualenv -p python3 .venv
source .venv/bin/activate
# 安裝依賴
pip install -r requirements.txt
# 開始根據(jù)自定義的規(guī)則進(jìn)行轉(zhuǎn)發(fā)郵件
python main.py config.yaml

自定義規(guī)則

滿足下列任一規(guī)則的郵件會被轉(zhuǎn)發(fā)到指定的郵箱列表(to_addrs

  • [x] 郵件的發(fā)件人(from_addr[1])在指定的發(fā)件人列表中(from_addrs
  • [x] 郵件的主題(subject)匹配指定的主題正則表達(dá)式(subject_pattern
  • [x] 郵件的內(nèi)容(plain_content 或 html_content)匹配指定的內(nèi)容正則表達(dá)式(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: ''

只轉(zhuǎn)發(fā)新郵件

支持轉(zhuǎn)發(fā)指定范圍內(nèi)的新郵件。

  • 從 index_file 文件中獲取上次讀取的郵件位置(last_email_index) (如果文件不存在,則默認(rèn)是 0)
  • 從 pop3_server.stat 獲取當(dāng)前郵件的總數(shù)(email_count
for index in range(last_email_index+1, email_count+1):
    pass

開源代碼

GitHub

文檔地址

https://formair.io

以上就是python ForMaiR實(shí)現(xiàn)自定義規(guī)則的郵件自動轉(zhuǎn)發(fā)工具的詳細(xì)內(nèi)容,更多關(guān)于python ForMaiR郵件轉(zhuǎn)發(fā)工具的資料請關(guān)注腳本之家其它相關(guān)文章!

相關(guān)文章

最新評論

嘉善县| 电白县| 太谷县| 伊吾县| 钟祥市| 荥阳市| 大埔县| 奉节县| 裕民县| 弥渡县| 孟村| 临漳县| 青铜峡市| 乌兰察布市| 延川县| 巍山| 河西区| 黎川县| 峨眉山市| 天峨县| 镇原县| 乌什县| 甘肃省| 六枝特区| 红安县| 班戈县| 合水县| 鹿邑县| 寻甸| 陆良县| 延寿县| 通州区| 大新县| 安龙县| 安宁市| 额济纳旗| 通海县| 明星| 琼结县| 灵石县| 金华市|