我使用 POP3 从 Gmail 帐户下载邮件并将它们保存在 SQLite 数据库中以供进一步处理:
mailbox = poplib.POP3_SSL('pop.gmail.com', '995')
mailbox.user(user)
mailbox.pass_(password)
msgnum = mailbox.stat()[0]
for i in range(msgnum):
msg = '\n'.join(mailbox.retr(i+1)[1])
save_message(msg, dbmgr)
mailbox.quit()
但是,在数据库中查看,除了消息正文(有效负载)的最后一行之外的所有行都有尾随等号。你知道为什么会这样吗?