Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

代码问题 #3

Open
francisLee777 opened this issue Jul 23, 2021 · 3 comments
Open

代码问题 #3

francisLee777 opened this issue Jul 23, 2021 · 3 comments

Comments

@francisLee777
Copy link

请问 client 只能读取收件箱吗? 有没有草稿箱、已发送箱、垃圾箱等 mailBox 可选?

@noinlijin
Copy link

同样的需求,有的邮件在垃圾箱,但是又不想去手动加白名单,希望可以拉取其他邮箱

@noinlijin
Copy link

可以自己重新封装一下 下面的函数 select 里传入 Spam或者其他文件夹的参数就能去抓取这些

    def get_mail_list(self, condition: dict = None):
        self.__connection.select()
        # self.__connection.select("Spam")
        # TODO IMAP协议支持搜索,可以把筛选条件放到这里。不过国内大多邮箱服务器不支持搜索操作。
        # NOTE 有些邮箱SEARCH的结果不一定是有序的
        response, mail_list = self.__connection.search(None, '(ALL)')
        return [x.decode() for x in reversed(mail_list[0].split())]

@notcarethename
Copy link

使用的时候发现,需要在downloader里面倒序mai_list,不然就只会遍历最新的那一个文件(也不知道具体是什么原因)
for mail_number in mail_list**[::-1]**:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants