Skip to content

Commit

Permalink
Outlook is no longer supported.
Browse files Browse the repository at this point in the history
  • Loading branch information
guo-yong-zhi committed Sep 20, 2024
1 parent 161e6be commit 70d4df9
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 19 deletions.
30 changes: 14 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# MailPush
For English users, there is a [fork](https://github.com/Darthagnon/MailPush) and a nice [post](https://www.reddit.com/r/kindle/comments/uvp41l/howto_email_kfx_books_from_calibre_to_a/).
For English users, there is a [fork](https://github.com/Darthagnon/MailPush).
для русскоязычных пользователей здесь есть [fork](https://github.com/DarkAssassinUA/MailPushRU).

这是个Kindle的`KUAL`插件,实现了邮箱推送功能,类似于亚马逊的`Send-to-Kindle`,但是并不依赖于在亚马逊官方注册的`@kindle.com`邮箱,而可以使用任意第三方邮箱。在使用本插件前请确保你已经把设备越狱而且安装了[`KUAL``Python3`](https://www.mobileread.com/forums/showthread.php?t=225030)。实际上,本插件的主体功能仅使用`Python3`的标准库完成,`src`文件夹里的程序可以运行于任何安装了`Python3`的操作系统或平台。
这是个Kindle的`KUAL`插件,实现了邮箱推送功能,类似于亚马逊的`Send-to-Kindle`,但是并不依赖于在亚马逊官方注册的`@kindle.com`邮箱,而可以使用任意支持`IMAP`服务第三方邮箱。在使用本插件前请确保你已经把设备越狱而且安装了[`KUAL``Python3`](https://www.mobileread.com/forums/showthread.php?t=225030)。实际上,本插件的主体功能仅使用`Python3`的标准库完成,`src`文件夹里的程序可以运行于任何安装了`Python3`的操作系统或平台。
## 特点
* 支持通过邮件附件推送文件
* 支持通过在邮件里填写文件下载链接推送文件。这有时更方便而且可以突破邮箱的文件大小的限制
Expand All @@ -13,21 +13,20 @@ For English users, there is a [fork](https://github.com/Darthagnon/MailPush) and

这里可能会有一些安全隐患(例如可以通过这种方法推送固件升级的文件),所以你最好申请一个名称相对复杂的邮箱并且不要公开。另外,你可以在`config.json`文件中为`root`设置一个更严格的路径,邮件推送的文件将不允许下载到`root`目录及其子目录之外的地方。
## 安装和配置
1. 注册一个新邮箱账户,很多邮箱限制颇多而配置繁琐,或者垃圾邮件判定严格。建议使用outlook邮箱,可以简化后续设置。请不要和其他重要账户使用同一个密码,因为MailPush采用了不安全的明文存储!
2. 在邮箱管理页面开启`IMAP`服务。不同邮箱的方法不同,如outlook邮箱默认开启,无需进一步设置;而新注册的QQ邮箱则需要14天后才能开启;某些邮箱(例如Yahoo、Google、QQ)还需要你创建专门的应用程序密码(授权码),使用常规密码将登录失败,插件将无法正常工作。
3. `git clone`本项目或前往[发布页面](https://github.com/guo-yong-zhi/MailPush/releases)下载压缩包并解压到你电脑的任意目录下。最外层的文件夹可以重命名。
4.`MailPush/src`文件夹里找到并编辑`config.json`文件:
* 将`user`改为刚刚申请的新邮箱
* 将`password`改为登录密码(也可能是IMAP授权码)。注意不要泄露`config.json`文件给他人!
* 将`host`、`port`改为你邮箱服务商的IMAP host和port。outlook邮箱无需修改,其他邮箱则可以参考文末的对照表
1. 注册一个邮箱账户并在其设置页面开启`IMAP`服务。请不要和其他重要账户使用同一个密码,因为MailPush采用了不安全的明文存储!不同品牌的邮箱启用IMAP服务的要求和限制不同,需要仔细选择。大部分邮箱(例如Gmail、Yahoo、QQ)都需要你创建专门的应用程序密码(授权码),而不能使用常规登录密码。新注册的QQ邮箱需要14天后才能开启IMAP;163邮箱的授权码只有180天有效期,到期需要重新设置;outlook邮箱则要求特殊的验证方式,本插件暂不支持。欢迎在issue里分享你的邮箱服务商的设置方法。
2. `git clone`本项目或前往[发布页面](https://github.com/guo-yong-zhi/MailPush/releases)下载压缩包并解压到你电脑的任意目录下。最外层的文件夹可以重命名。
3.`MailPush/src`文件夹里找到并编辑`config.json`文件:
* 将`user`改为刚才申请的新邮箱
* 将`password`改为刚才创建的IMAP授权码(也可能就是常规登录密码)。注意不要泄露`config.json`文件给他人!
* 将`host`、`port`改为你邮箱服务商的IMAP host和port。可以参考文末的对照表
* 其它参数按需修改(可选):
- `downloaddir`为默认下载路径,`root`为允许写入的目录。`root`默认为Kindle USB磁盘根目录(/mnt/us/),请谨慎修改。
- `maxage`为下载几天内的邮件,`maxnum`为一次最多下载几封邮件,`mailbox`和`criteria`是邮件类型,这些选项配置了菜单中`Fetch emails via config.json (custom)`的功能
5. 通过USB把`MailPush`文件夹复制到你Kindle设备根目录下的`extensions`目录中。
6. 安全弹出你的设备,现在可以在KUAL菜单里找到`MailPush`
4. 通过USB把`MailPush`文件夹复制到你Kindle设备根目录下的`extensions`目录中。
5. 安全弹出你的设备,现在可以在KUAL菜单里找到`MailPush`
## 使用方法
1. 用其它邮箱向你填在`config.json`中的邮箱发邮件
* 可以添加任意附件
* 可以添加任意附件(如电子书、图片、压缩包等)
* 主题或正文都可以为空
* 主题或正文都可以包括多行
* 主题或正文的一行可以是一个或多个文件下载链接,多个链接可用空格或`|`隔开,或者分别用`<`和`>`框住,注意不可以用逗号或分号分隔。
Expand All @@ -36,11 +35,12 @@ For English users, there is a [fork](https://github.com/Darthagnon/MailPush) and
> * `saveto books/` # 意为第一个文件保存到 /mnt/us/documents/downloads/books/ 中,文件名不变
> * `saveto /mnt/us/123.epub` # 意为第一个文件保存到 /mnt/us/123.epub
> * `saveto abc.pdf | ../def.pdf` # 意为前两个文件分别保存到 /mnt/us/documents/downloads/abc.pdf 和 /mnt/us/documents/def.pdf
2. 在Kindle上打开KUAL,在菜单中找到`MailPush`。点击`Fetch unread emails`可以获取未读,或点击`Fetch newest emails`可以获取最新邮件中的文件。
* 主题或正文中的其它内容则会被忽略
2. 在Kindle上打开KUAL,在菜单中找到`MailPush`。点击`Fetch unread emails`可以获取未读邮件中的文件,或点击`Fetch newest emails`可以获取最新邮件中的文件。
## 故障排除
1. 点击KUAL菜单按钮`View log``View results`可以查看运行日志和结果。也可以USB连接Kindle到电脑,查看`extensions/MailPush/`目录中的`log.txt``result.txt`
2. 如果在屏幕顶端看不到任何提示,或者它们显示的位置不合适,可以在电脑上修改文件`COL.txt`中的数字,例如从10改到20可以让显示更靠右。
3. 如果提示`Operation failed`,请先检查`log.txt`中的内容。检查`Python3`的安装状态及`config.json`中的配置(如`password`)。
3. 如果提示`Operation failed`,请先检查`log.txt`中的内容。检查`Python3`的安装状态及`config.json`中的配置(如`password``host`)。
4. 手动登录你填在`config.json`的邮箱,检查是否收到了邮件,必要时把发送者加入白名单。注意登录查看会使得未读邮件变已读,`Fetch unread emails`会忽略这些邮件,可以点击`Fetch newest emails`来测试。
5. 设备的时钟错误可能会导致连接失败,请在Kindle设置里为其设置正确的时间。
6. 如果屏幕上方长时间跳动`Fetching...`或提示`Time out`,则可能是网络问题。可以点击`Fetch newest emails`重试。
Expand All @@ -52,8 +52,6 @@ For English users, there is a [fork](https://github.com/Darthagnon/MailPush) and
|----|----|----|
|gmail|imap.gmail.com|993|
|yahoo|imap.mail.yahoo.com|993|
|outlook|outlook.office365.com|993|
|hotmail|outlook.office365.com|993|
|qq|imap.qq.com|993|
|126|imap.126.com|993|
|163|imap.163.com|993|
Expand Down
2 changes: 1 addition & 1 deletion config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<extension>
<information>
<name>MailPush</name>
<version>1.6</version>
<version>1.7</version>
<author>guoyongzhi</author>
<id>MailPush</id>
</information>
Expand Down
1 change: 1 addition & 0 deletions how_to_use.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
> - `saveto books/` # means the first file is saved to /mnt/us/documents/downloads/books/, the file name remains unchanged
> - `saveto /mnt/us/123.epub` # means the first file is saved to /mnt/us/123.epub
> - `saveto abc.pdf | ../def.pdf` # means the first two files are saved to /mnt/us/documents/downloads/abc.pdf and /mnt/us/documents/def.pdf respectively
- Other content in the subject or body will be ignored.
3. Click the `Fetch unread emails` button to download all unread emails, or click the `Fetch newest emails` button to get the files in the latest mail. Other email download modes are also provided.
4. After selecting a download mode, wait a little. The books will download.
4 changes: 2 additions & 2 deletions src/config.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"user": "mykindlemail@outlook.com",
"user": "mykindlemail@qq.com",
"password": "abc123",
"host": "outlook.office365.com",
"host": "imap.qq.com",
"port": 993,
"mailbox": "INBOX",
"criteria": ["UNSEEN"],
Expand Down

0 comments on commit 70d4df9

Please sign in to comment.