aio-libs / aio-libs/aiosmtpd

AttributeError: 'NoneType' object has no attribute 'items' when handling multipart messages with attachments

未关闭
#560 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Python
星标
373
派生
105
平均合并
4 分钟
30 天内合并 PR
2

描述

When an SMTP client sends a multipart email with an attachment, i.e. `multipart/mixed` containing a binary attachment (e.g., PDF), `aiosmtpd` crashes.

This was observed through the smtp2mqtt add-on, which uses aiosmtpd, but the stack trace points clearly to aiosmtpd/smtp.py.

PHP version: 3.11.8

```
Traceback (most recent call last):
File ".../aiosmtpd/smtp.py", line 756, in _handle_client
await method(arg)
File ".../aiosmtpd/smtp.py", line 1519, in smtp_DATA
status = await self._call_handler_hook('DATA')
File ".../aiosmtpd/smtp.py", line 473, in _call_handler_hook
status = await hook(self, self.session, self.envelope, *args)
File "/app/smtp2mqtt.py", line 96, in handle_DATA
for header in msgBody.items():
AttributeError: 'NoneType' object has no attribute 'items'
```

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。