Releases: paramiao/pyMail
Releases · paramiao/pyMail
pyMail v2.0.0 - Python 3 Migration | Python 3 迁移版本
pyMail v2.0.0 - Python 3 Migration 🎉
A complete migration to Python 3 with bug fixes and new features | 完整迁移到 Python 3,修复多个问题并新增功能
⚠️ Breaking Changes | 不兼容变更
- Requires Python 3.6+ | 需要 Python 3.6+
- Python 2.7 is no longer supported | 不再支持 Python 2.7
- Python 2 users: please use the
python2branch (v1.x) | Python 2 用户请使用python2分支
SendMailDealer.__init__()now requiresportparameter | 现在需要port参数
🎉 New Features | 新功能
Search Functions | 搜索功能 (Issues #4, #10)
getAll()- Get all emails, not just unread | 获取所有邮件,不限于未读searchBySubject(keyword)- Search by subject | 按主题搜索searchBySender(email)- Search by sender | 按发件人搜索searchByDateRange(since, before)- Search by date range | 按日期范围搜索
Error Handling | 错误处理
- Custom exception classes | 自定义异常类:
MailError- Base exception | 基础异常MailAuthError- Authentication failures | 认证失败MailConnectionError- Connection failures | 连接失败MailFetchError- Email fetching failures | 邮件获取失败
Developer Experience | 开发体验
- Logging support for debugging | 日志支持,便于调试
- Docstrings for all public methods | 所有公共方法添加文档字符串
- Better error messages with context | 更清晰的错误提示
🐛 Bug Fixes | 问题修复
Critical | 关键修复
- Fixed attachment filename handling (Issue #7) | 修复附件文件名处理
- Sanitize path separators (
\,/) | 清洗路径分隔符 - Remove illegal characters (
<>:"|?*) | 移除非法字符 - Prevent directory traversal attacks | 防止目录遍历攻击
- Properly decode multi-part encoded filenames | 正确解码多段编码的文件名
- Sanitize path separators (
Important | 重要修复
- Fixed
reinitMailInfo()(Issue #9) | 修复reinitMailInfo()方法- Added missing
selfparameter | 添加缺失的self参数
- Added missing
- Fixed example.py (Issue #8) | 修复示例代码
- Corrected
mailUtilstopyMail| 修正模块名从mailUtils到pyMail - Updated to Python 3 syntax | 更新为 Python 3 语法
- Corrected
Improvements | 改进
- Better encoding handling | 改进编码处理
- Proper
bytes/strconversion | 正确的 bytes/str 转换 - Use
get_content_charset()for decoding | 使用get_content_charset()解码 - Graceful fallback with
errors='replace'| 优雅的错误处理
- Proper
- Improved header decoding | 改进 Header 解码
- Use
make_header()for multi-segment headers | 使用make_header()处理多段编码
- Use
📚 Documentation | 文档
New Documentation | 新增文档
- CHANGELOG.md - Complete changelog | 完整变更日志
- MIGRATION_GUIDE.md - Step-by-step migration guide | 逐步迁移指南
- DEVELOPMENT_PLAN.md - Development plan | 开发计划
- Bilingual README - English/Chinese support | 中英双语 README
Updated Documentation | 更新文档
- README.md with Python 3 examples | 包含 Python 3 示例
- Common issues section - Gmail App Passwords, VPN, ports | 常见问题章节
- Code examples updated to best practices | 示例代码更新为最佳实践
🚀 Migration | 迁移
Quick Start | 快速开始
Most users only need to | 大多数用户只需:
- Upgrade to Python 3.6+ | 升级到 Python 3.6+
- Add
portparameter toSendMailDealer(if using SMTP) | 添加port参数(如使用 SMTP)# Old | 旧代码 sml = SendMailDealer(user, passwd, smtp) # New | 新代码 sml = SendMailDealer(user, passwd, smtp, 587, usettls=True)
- Enjoy new features! | 享受新功能!
Detailed Guide | 详细指南
See MIGRATION_GUIDE.md for:
- API changes checklist | API 变更清单
- Code migration examples | 代码迁移示例
- Rollback procedures | 回滚步骤
查看迁移指南了解更多细节。
🙏 Acknowledgments | 致谢
Special thanks to all contributors who reported issues | 特别感谢所有报告问题的贡献者:
- @raymondlu31 for Issue #7 (attachment handling) | 报告附件处理问题
- @fanpei91 for Issue #4 (get all emails) | 提出获取所有邮件需求
- @xuechaoke for Issue #10 (search functions) | 提出搜索功能需求
- @huizhou-jixi-zhangxin for Issues #8 and #9 | 报告代码错误
- @vanpersiexp for Issue #5 (VPN documentation) | 提出 VPN 连接问题
📊 Statistics | 统计
- 10 files changed | 10 个文件修改
- 2,419 insertions(+) | 新增 2,419 行
- 258 deletions(-) | 删除 258 行
- 6 issues resolved | 解决 6 个问题
- 100% test pass rate | 100% 测试通过率
🔗 Links | 链接
- Full Changelog | 完整变更日志: CHANGELOG.md
- Migration Guide | 迁移指南: MIGRATION_GUIDE.md
- Python 2 Branch | Python 2 分支: python2
Note | 注意: This release requires Python 3.6 or higher. For Python 2 support, use the python2 branch | 本版本需要 Python 3.6 或更高版本。如需 Python 2 支持,请使用 python2 分支。