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

Missing Sendmail binary error is displayed when using occ user:resetpassword #32564

Open
settermjd opened this issue Sep 4, 2018 · 10 comments
Open

Comments

@settermjd
Copy link
Contributor

Steps to reproduce

  1. Attempt to reset a user's password on a system that doesn't have a Sendmail binary installed, using the following command (as an example):
sudo -u www-data php occ user:resetpassword --send-email user1

Expected behaviour

Should display only console output from the command. If an error occurs, it should be handled, or displayed to the user in an intentional/professional way.

Actual behaviour

If the Sendmail binary (or a replacement) is not installed, an error message is output, saying that it was not found, as in the example below.

sh: 1: /usr/sbin/sendmail: not found

Server configuration

Operating system: Ubuntu 18.04 LTS

Web server: Apache/2.4.29

Database: SQLite 3.22.0-1

PHP version: 7.2.7-0ubuntu0.18.04.2

ownCloud version: 10.1.0 prealpha

Updated from an older ownCloud or fresh install: updated (using git)

Where did you install ownCloud from: Cloned the official repository.

The content of config/config.php:

{
    "system": {
        "apps_paths": [
            {
                "path": "\/var\/www\/html\/apps",
                "url": "\/apps",
                "writable": true
            },
            {
                "path": "\/var\/www\/html\/apps-external",
                "url": "\/apps-external",
                "writable": true
            }
        ],
        "dbtype": "sqlite3",
        "dbhost": "db",
        "dbname": "owncloud",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "dbtableprefix": "oc_",
        "default_language": "en",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "localhost"
        ],
        "datadirectory": "\/var\/www\/html\/data-autotest",
        "overwrite.cli.url": "http:\/\/localhost:8080",
        "version": "10.1.0.1",
        "logtimezone": "UTC",
        "installed": true,
        "instanceid": "oc21s4c9iej2",
        "theme": "",
        "loglevel": 2,
        "maintenance": false
    }
}

List of activated apps:

Enabled:
  - comments: 0.3.0
  - dav: 0.3.2
  - federatedfilesharing: 0.3.1
  - federation: 0.1.0
  - files: 1.5.2
  - files_external: 0.7.1
  - files_sharing: 0.10.1
  - files_trashbin: 0.9.1
  - files_versions: 1.3.0
  - provisioning_api: 0.5.0
  - systemtags: 0.3.0
  - updatenotification: 0.2.1

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

Are you using encryption: no

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

@ownclouders
Copy link
Contributor

GitMate.io thinks possibly related issues are #26902 (error), #28840 (-Error-), #29082 (a Error), #15762 (What's the correct way to use ./occ --password-from-env user:resetpassword), and #7509 (Remove error display on productive systems and use log file instead).

@sharidas
Copy link
Contributor

sharidas commented Sep 4, 2018

I was able to reproduce this issue.

How to reproduce:
  • Create a user1 and add email address to the user.
  • Now try do not configure the Email server in the Settings->General page.
  • Try to run the command :
➜  owncloud3 git:(master) ✗ ./occ user:resetpassword --send-email user1
Cannot load Xdebug - it was already loaded
sh: 1: /usr/sbin/sendmail: not found
The password reset link is: http://localhost/index.php/lostpassword/reset/form/XrwI8jk18dzNptGa0L7Ms/user1
➜  owncloud3 git:(master) ✗ 

After debugging the code, it has been found that we use swiftmailer version Swift-5.4.12 ( copied from the VERSION file ). And the line which causes the problem is https://github.com/swiftmailer/swiftmailer/blob/5.x/lib/classes/Swift/Transport/SimpleMailInvoker.php#L34.

@PVince81
Copy link
Contributor

need to retry on master as we just upgraded swiftmailer here #29943

@paurakhsharma
Copy link
Member

I was unable to reproduce this on my system. Here is the PR verifying it #33385

@phil-davis
Copy link
Contributor

@paurakhsharma the issue reported seems to be for when the system-under-test is actually missing the sendmail program. How can we test that?

@paurakhsharma
Copy link
Member

@phil-davis When we change the value of mail_smtpmode to some random word. Isn't it considered as the mail sending program is missing?

@phil-davis
Copy link
Contributor

That's a good question! The "randomword" program would be missing.

@paurakhsharma
Copy link
Member

paurakhsharma commented Nov 6, 2018

@phil-davis, so in #33385, I have set mail_smtpmode to sendmail which is, in my opinion, is missing in our system (we use smtp). So, I guess this pull request should answer this issue?

@individual-it
Copy link
Member

@settermjd @sharidas could you retests if the issue still exist and close the issue if not

@individual-it
Copy link
Member

taking this issue out of the QA sprint for now because I cannot see what QA can do here currently

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants