Skip to content
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

email mode "sendmail" not working #11281

Closed
cwiedmann opened this issue Sep 19, 2018 · 6 comments
Closed

email mode "sendmail" not working #11281

cwiedmann opened this issue Sep 19, 2018 · 6 comments
Labels
2. developing Work in progress bug
Milestone

Comments

@cwiedmann
Copy link
Contributor

Steps to reproduce

With Nextcloud 13 and "php" as send mode there are no problems with sending emails.
PHP itself is using sendmail.

Now with Nextcloud 14 "php" isn't available as send mode. So I have to switch to "sendmail" as send mode

Configure "sendmail" as send mode.
Send the test email.

I have located the problem in the file "lib/private/Mail/Mailer.php".

If I change the line (~281):
| return new \Swift_SendmailTransport($binaryPath . ' -bs');
to
| return new \Swift_SendmailTransport($binaryPath . ' -t');

email is working again. Which make sense, because my sendmail binary doesn't support the "-bs" switch. And "-t" is also used by PHP and its mail function.

There should be a configure option for this switch. Right now it's hardcoded. And "-bs" is not working for every sendmail binary.

Expected behaviour

No error:
Email sent

Actual behaviour

Error occurs:
A problem occurred while sending the email. Please revise your settings. (Error: Expected response code 220 but got code "", with message "")

Server configuration detail

Operating system: FreeBSD 11.1-STABLE amd64

Webserver: Apache (apache2handler)

Database: mysql 5.6.41

PHP version:

7.1.22
Modules loaded: Core, date, libxml, pcre, Reflection, SPL, hash, session, apache2handler, standard, apcu, bz2, ctype, curl, dom, mbstring, fileinfo, filter, ftp, gd, mysqlnd, iconv, imagick, intl, json, ldap, exif, mysqli, openssl, PDO, posix, SimpleXML, smbclient, xml, xmlwriter, zip, zlib, pdo_mysql, wddx, xmlreader, xsl, libsmbclient, Zend OPcache

Nextcloud version: 14.0.0 - 14.0.0.19

Updated from an older Nextcloud/ownCloud or fresh install: update from 13.0.6

Where did you install Nextcloud from: FreeBSD package

Signing status

Array
(
)

List of activated apps
Enabled:
 - accessibility: 1.0.1
 - activity: 2.7.0
 - avpreviewprovider: 0.0.1
 - cloud_federation_api: 0.0.1
 - comments: 1.4.0
 - dav: 1.6.0
 - federatedfilesharing: 1.4.0
 - federation: 1.4.0
 - files: 1.9.0
 - files_external: 1.5.0
 - files_pdfviewer: 1.3.2
 - files_sharing: 1.6.2
 - files_texteditor: 2.6.0
 - files_trashbin: 1.4.1
 - files_versions: 1.7.1
 - files_videoplayer: 1.3.0
 - firstrunwizard: 2.3.0
 - gallery: 18.1.0
 - groupfolders: 1.3.3
 - issuetemplate: 0.4.0
 - logreader: 2.0.0
 - lookup_server_connector: 1.2.0
 - music: 0.9.2
 - nextcloud_announcements: 1.3.0
 - notifications: 2.2.1
 - oauth2: 1.2.1
 - password_policy: 1.4.0
 - previewgenerator: 1.1.0
 - provisioning_api: 1.4.0
 - serverinfo: 1.4.0
 - sharebymail: 1.4.0
 - support: 1.0.0
 - survey_client: 1.2.0
 - systemtags: 1.4.0
 - theming: 1.5.0
 - twofactor_backupcodes: 1.3.1
 - updatenotification: 1.4.1
 - workflowengine: 1.4.0
Disabled:
 - admin_audit
 - encryption
 - user_external
 - user_ldap

Configuration (config/config.php)
{
    "instanceid": "***REMOVED SENSITIVE VALUE***",
    "passwordsalt": "***REMOVED SENSITIVE VALUE***",
    "secret": "***REMOVED SENSITIVE VALUE***",
    "trusted_domains": [
        "192.168.178.212",
        "cloud.wiedmann-online.tk"
    ],
    "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
    "datadirectory": "***REMOVED SENSITIVE VALUE***",
    "overwritehost": "cloud.wiedmann-online.tk",
    "overwriteprotocol": "https",
    "overwrite.cli.url": "https:\/\/cloud.wiedmann-online.tk",
    "htaccess.RewriteBase": "\/",
    "dbtype": "mysql",
    "version": "14.0.0.19",
    "dbname": "***REMOVED SENSITIVE VALUE***",
    "dbhost": "***REMOVED SENSITIVE VALUE***",
    "dbport": "",
    "dbtableprefix": "oc_",
    "mysql.utf8mb4": true,
    "dbuser": "***REMOVED SENSITIVE VALUE***",
    "dbpassword": "***REMOVED SENSITIVE VALUE***",
    "installed": true,
    "mail_smtpmode": "sendmail",
    "mail_domain": "***REMOVED SENSITIVE VALUE***",
    "mail_from_address": "***REMOVED SENSITIVE VALUE***",
    "logtimezone": "Europe\/Berlin",
    "cron_log": true,
    "default_language": "de",
    "memcache.local": "\\OC\\Memcache\\APCu",
    "maintenance": false,
    "theme": "",
    "loglevel": 1,
    "enabledPreviewProviders": [
        "OC\\Preview\\PNG",
        "OC\\Preview\\JPEG",
        "OC\\Preview\\GIF",
        "OC\\Preview\\BMP",
        "OC\\Preview\\XBitmap",
        "OC\\Preview\\TXT",
        "OC\\Preview\\MarkDown"
    ],
    "apps_paths": [
        {
            "path": "\/usr\/local\/www\/nextcloud\/apps",
            "url": "\/apps",
            "writable": true
        },
        {
            "path": "\/usr\/local\/www\/nextcloud\/apps-pkg",
            "url": "\/apps-pkg",
            "writable": false
        }
    ]
}

Are you using external storage, if yes which one: local

Are you using encryption:

Are you using an external user-backend, if yes which one:

Client configuration

Browser: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:62.0) Gecko/20100101 Firefox/62.0

Operating system: Windows 10

Logs

Browser log

Nextcloud log

Browser log
@nextcloud-bot
Copy link
Member

GitMate.io thinks possibly related issues are #4219 (Can't share folders by email, files work fine), #3301 (Unsetting maintenance mode using occ doesn't work), #5472 (TempManager is not working), #6603 (Built-in share-by-email date expiration enforcement not working properly ), and #6596 (Built-in share-by-email password protection enforcement not working properly).

@MorrisJobke
Copy link
Member

cc @nickvergessen @blizzz

@blizzz
Copy link
Member

blizzz commented Sep 26, 2018

@rullzer

@rullzer
Copy link
Member

rullzer commented Sep 26, 2018

We upgraded swiftmailer and the php mailer (that was already deprecated for some time) is now removed.

The sendmail options are identical to what they have always been.
I do not use sendmail myself so it is hard to test.

@cwiedmann would you mind shooting in a PR?

cwiedmann added a commit to cwiedmann/server that referenced this issue Sep 29, 2018
@cwiedmann
Copy link
Contributor Author

just added PR #11454

@tflidd
Copy link
Contributor

tflidd commented Oct 19, 2018

I use ssmtp to send out my mails and it requires the option -t as well.

duke-m added a commit to duke-m/server that referenced this issue Nov 5, 2018
from the manpage: "Read message for recipients. To:, Cc:, and Bcc: lines will be scanned for recipient addresses. The Bcc: line will be deleted before transmission."

see issue nextcloud#11281
@MorrisJobke MorrisJobke added this to the Nextcloud 16 milestone Nov 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2. developing Work in progress bug
Projects
None yet
Development

No branches or pull requests

6 participants