监视maildir接收邮件并显示通知
maildirwatch的Python项目详细描述
maildir watch-查看maildir以查看新邮件并显示通知
程序递归地扫描单个目录,查找Maildirs。什么时候? 如果找到maildir,程序将开始监视它以查找新的电子邮件。 当电子邮件到达new目录时,通知是 与GTK一起显示。可以在配置文件中设置要扫描的目录, 默认为~/Maildir。
对于每个 到达。相反,对于一组新的 信息。
显示的通知是交互式的-当用户 点击通知。默认情况下,不定义任何操作。行动可以 在配置文件中定义。
安装
从PyPI安装:
pip3 install --user maildirwatch
python3是必需的。
note:PyGObject是此程序的依赖项。要成功安装它, 您可能需要在系统上安装gobject开发库。打开 debian,可能需要安装包libgirepository1.0-dev。
使用量
使用maildirwatch命令启动程序,或:
python3 -m maildirwatch
要列出可用选项,请运行:
maildirwatch --help
配置
程序在中查找配置文件 $XDG_CONFIG_HOME/maildirwatch.conf或~/.config/maildirwatch.conf如果 XDG_CONFIG_HOME未定义。
配置文件采用python的标准配置格式(由 configparser模块)。
全局选项
这些选项应该放在[global]部分。
maildir
要扫描邮件目录的目录。默认值:~/Maildir。
ignore
要忽略的maildir模式的逗号分隔列表。每个图案必须 fnmatch样式。默认情况下,不忽略邮件目录。
操作
每个操作都是程序的路径(以及可选的参数列表)。每 操作还有一个显示给用户的唯一名称。当一个动作 在单击通知后,将启动操作程序。
操作定义必须放在[actions]节中。动作已定义 像这样:
action name = /path/to/program arg1 arg2 arg3...
动作名称可以包含空格。
一个操作名是特殊的-default操作。默认操作的 值应该是另一个操作的名称,而不是程序的路径。这个 当用户单击通知本身时调用默认操作,而不是 任何其他行动。
示例配置
下面是一个修改maildir路径的配置文件示例, 忽略垃圾邮件文件夹并定义两个操作:
[global] maildir = ~/mail ignore = *Spam,*foo/bar* [actions] default = Show mu4e Show mu4e = emacs -f mu4e Start thunderbird = thunderbird
许可证
Copyright (C) 2019 Michał Krzywkowski This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
Local Variables: coding: utf-8 fill-column: 79 End: