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
MailNotifier fails to send email #5943
Comments
Sample session with
|
Briefly reading through the
whereas the SMTP server on port 587 returns the following messages after
It appears the first few lines that include |
Have exactly the same error here, but it works again if I downgrade Twisted to 20.3.0. |
Ditto |
Hi, this problem is always present. |
This is because new Twisted 21.2.0+ required index 54e9c88..79d2886 100644
--- a/reporters/mail.py
+++ b/reporters/mail.py
@@ -351,7 +351,7 @@ class MailNotifier(ReporterBase):
unicode2bytes(self.smtpUser), unicode2bytes(self.smtpPassword),
parseaddr(self.fromaddr)[1], recipients, BytesIO(s),
result, requireTransportSecurity=self.useTls,
- requireAuthentication=useAuth)
+ requireAuthentication=useAuth, hostname=self.relayhost)
if self.useSmtps:
reactor.connectSSL(self.relayhost, self.smtpPort, |
@p12tic Please can you take a look at the patch in the previous comment, and merge it if it appears correct? Edit: The patch above did not appear to make any difference in my case. The issue still remained. |
I have tried this workaround but was not successful. |
This workaround by adding the hostname to the ESMTPSenderFactory solved my problem sending mails through gmail. Can this be integrated or shall I ask for a pull request? |
Created PR #6579 |
Please don't resolve this ticket after merging PR #6579 as it does not fix the problem for the reporter of this ticket, and others on this ticket. What PR #6579 fixes may in fact be a different bug that has similar symptoms. The third comment on this ticket describes what occurs for this bug, that PR #6579 is unlikely to solve (from its diff). |
Perhaps an https://marlam.de/msmtp/msmtp.html#Minimal-SMTP-server-_0028msmtpd_0029 |
I use buildbot master on Linux (ubuntu 22.04) and use Ansible now to patch the ESMTPSenderFactory. It would be nice I don't have to patch that mail.py file when installing builldbot. Any advise would be welcome if alternative is possible. |
@tardyp Still not able to send email via gmail from buildbot master 3.6.0 running in docker container! Python version: 3.9.2
c['services'] = []
from emailLookup import EmailLookup
generator = reporters.BuildStatusGenerator(
mode=('change'),
)
mn = reporters.MailNotifier(
fromaddr=private.auth_username,
sendToInterestedUsers=True,
extraRecipients=[],
useTls=True,
relayhost='smtp.gmail.com',
smtpPort=587,
smtpUser=private.auth_username,
smtpPassword=private.auth_password,
lookup=EmailLookup(),
generators=[generator],
)
c['services'].append(mn) |
I have a
MailNotifier
configured like this:Notification mails are not sent. The following messages are logged in
twistd.log
:This used to work before, so it appears something has changed in the software versions.
pyOpenSSL
is available in the venv.The server does support STARTTLS on port 587. We all use it with various email clients for email submission. As an example, Gerrit is able to send emails via this same email submission service.
Edit: The email server is Postfix:
The text was updated successfully, but these errors were encountered: