Repository navigation
Google Smtp-Relay Error (EHLO)聽#25716
Description
Activity
- added0. Needs triagePending check for reproducibility or if it fits our roadmapPending check for reproducibility or if it fits our roadmap
on Feb 18, 2021 - added1. to developAccepted and waiting to be taken care ofAccepted and waiting to be taken care ofand removed0. Needs triagePending check for reproducibility or if it fits our roadmapPending check for reproducibility or if it fits our roadmap
on Feb 26, 2021 Thanks for reporting 馃憤
EHLO [127.0.01]is the default by Swift Mailer (the library used by Nextcloud to send emails).Set the name of the local domain which Swift will identify itself as.
This should be a fully-qualified domain name and should be truly the domain
you're using.If your server does not have a domain name, use the IP address. This will
automatically be wrapped in square brackets as described in RFC 5321,
section 4.1.3.server/lib/private/Mail/Mailer.php
Lines 277 to 297 in 18b419f
protected function getSmtpInstance(): \Swift_SmtpTransport { $transport = new \Swift_SmtpTransport(); $transport->setTimeout($this->config->getSystemValue('mail_smtptimeout', 10)); $transport->setHost($this->config->getSystemValue('mail_smtphost', '127.0.0.1')); $transport->setPort($this->config->getSystemValue('mail_smtpport', 25)); if ($this->config->getSystemValue('mail_smtpauth', false)) { $transport->setUsername($this->config->getSystemValue('mail_smtpname', '')); $transport->setPassword($this->config->getSystemValue('mail_smtppassword', '')); $transport->setAuthMode($this->config->getSystemValue('mail_smtpauthtype', 'LOGIN')); } $smtpSecurity = $this->config->getSystemValue('mail_smtpsecure', ''); if (!empty($smtpSecurity)) { $transport->setEncryption($smtpSecurity); } $streamingOptions = $this->config->getSystemValue('mail_smtpstreamoptions', []); if (is_array($streamingOptions) && !empty($streamingOptions)) { $transport->setStreamOptions($streamingOptions); } return $transport; } Would be the place to call setLocalDomain and set a reasonable value.
server/config/config.sample.php
Lines 351 to 356 in 18b419f
/** * The return address that you want to appear on emails sent by the Nextcloud * server, for example ``[email protected]``, substituting your own domain, * of course. */ 'mail_domain' => 'example.com', Does it make sense to use the mail domain or https://www.php.net/manual/en/function.gethostname.php for ehlo?
Any updates here? Not being able to send mails through the smtp-relay is kind of a bummer...
Reacted by Talita AmaralSorry for bumping a closed issue, if you want me to open a new issue, please tell me :)
I think the implementation in #27306 is incorrect, when you have Nextcloud installed on a subdomain. For example, I have it installed on
cloud.mydomain.com, and theoverwrite.cli.urlconfig is set tohttps://cloud.mydomain.com, so the domain that will be set in the EHLO header will becloud.mydomain.com.Problem is, the Gmail SMTP relay expects the domain in the EHLO header to be
mydomain.com. Imo, having a config to specify the domain of the mail would be a better solution than relying on the installation domain (which might not even match at all).EDIT: I opened #29011
Reacted by Willi PreukReacted by Christoph Wurst
How to use GitHub
Steps to reproduce
Expected behaviour
Mails are deliverd.
Actual behaviour
Expected response code 250 but got an empty response.Server configuration
Operating system:
k8s, Docker 21.0.0RC1-fpm
Web server:
Nginx Reverse Proxy + nginx as fpm proxy
Database:
docker.io/bitnami/mariadb:10.5.8-debian-10-r21
PHP version:
7.4
Nextcloud version: (see Nextcloud admin page)
21.0.0 RC1
Updated from an older Nextcloud/ownCloud or fresh install:
Updated from v20.0.7 to the 21-rc1 but issue occurred in both versions.
Where did you install Nextcloud from:
Signing status:
Signing status
List of activated apps:
App list
Nextcloud configuration:
Config report
Are you using external storage, if yes which one: local/smb/sftp/...
local
Are you using encryption: yes/no
no
Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/...
OpenID Connect
Client configuration
Browser:
chrome 88.0.4324.150
Operating system:
macOS 11.2.1 (20D74)
Logs
Packet Capture
Packet Capture log
More Info
I have found this issue on the nextcloud forum. It was postet in February 2021, here are some insights from the original poster: