opentrashmail
opentrashmail copied to clipboard
Can't send emails from Gmail address
I'm Running Opentrashmail 1.4.6. Unfortunately trying to send an email to Opentrashmail results in the following log output:
2024-04-27 11:53:51,904 - __main__ - DEBUG - Message addressed from: [email protected] 2024-04-27 11:53:51,904 - __main__ - DEBUG - Message addressed to: ['[email protected]'] ('209.85.214.176', 47330) SMTP session exception Traceback (most recent call last): File "/usr/lib/python3.11/site-packages/aiosmtpd/smtp.py", line 753, in _handle_client await method(arg) File "/usr/lib/python3.11/site-packages/aiosmtpd/smtp.py", line 1516, in smtp_DATA status = await self._call_handler_hook('DATA') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/site-packages/aiosmtpd/smtp.py", line 473, in _call_handler_hook status = await hook(self, self.session, self.envelope, *args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/var/www/opentrashmail/python/mailserver3.py", line 76, in handle_DATA html += part.get_payload().get_payload(decode=True).decode('utf-8') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'str' object has no attribute 'get_payload'
I can manually Telnet the SMTP server and successfully send an email. I just have port 25 exposed and no valid TLS certificate installed yet. Any ideas?
Ok, this is not a Gmail problem. I can reproduce the issue by using the testmail.txt from the repo. I think the problem can be boiled down to the parsing of Content Type text/html. The testmail is accepted unless I add the html part from the txt. Even the SVG is working.
I have the same problem with Apple iCloud emails. Here is the response from Opentrashmail SMTP server:
This is a system-generated message to inform you that your email could not
be delivered to one or more recipients. Details of the email and the error are as follows:
<[[email protected]](mailto:[email protected])>: host [mail.xxx.cc](http://mail.xxx.cc/) said: 500 Error:
(AttributeError) 'str' object has no attribute 'get_payload' (in reply to
end of DATA command)This is a system-generated message to inform you that your email could not
be delivered to one or more recipients. Details of the email and the error are as follows:
confirmed and producable, working on a fix