You are not logged in.

#1 2016-06-29 00:31:12

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,597
Website

Error testing sendmail in owncloud 9.0.2 [solved]

I have dma (from the AUR) and s-nail on this box and am trying and failing to use sendmail for my owncloud email notifications.  My email address I defined for my administrator is 'myuser@localhost' and I have owncloud set to use send mode = sendmail.  When I go to test this, I get this error:

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

I am able to send mails from the shell:

% echo 'Message body' | mailx -s 'A subject' myuser@localhost
% echo $?
0

Any suggestions?

Last edited by graysky (2016-06-30 19:58:02)


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#2 2016-06-30 06:12:39

Elizine
Member
From: United Kingdom
Registered: 2015-10-07
Posts: 39
Website

Re: Error testing sendmail in owncloud 9.0.2 [solved]

This problem can generally occur when you do not enable two step verification for the gmail account you are using to send an email. So first, enable two step verification, you can find plenty of resources for enabling two step verification. After you enable it, then you have to create an app password. And use the app password in your .env file. When you are done with it, your .env file will look something like.

MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=<<your email address>>
MAIL_PASSWORD=<<app password>>
MAIL_ENCRYPTION=tls

and your mail.php

<?php

return [
    'driver' => env('MAIL_DRIVER', 'smtp'),
    'host' => env('MAIL_HOST', 'smtp.gmail.com'),
    'port' => env('MAIL_PORT', 587),
    'from' => ['address' => '<<your email>>', 'name' => '<<any name>>'],
    'encryption' => env('MAIL_ENCRYPTION', 'tls'),
    'username' => env('MAIL_USERNAME'),
    'password' => env('MAIL_PASSWORD'),
    'sendmail' => '/usr/sbin/sendmail -bs',
    'pretend' => false,

];

After doing so, run php artisan config:cache and php artisan config:clear, then check, email should work.

Offline

#3 2016-06-30 08:45:58

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,597
Website

Re: Error testing sendmail in owncloud 9.0.2 [solved]

Thanks a for the reply, but I ink you misunderstand: I wish to use sendmail locally not gmail or other services.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#4 2016-06-30 19:57:53

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,597
Website

Re: Error testing sendmail in owncloud 9.0.2 [solved]

The solution was to change the send more from 'sendmail' to 'php' in owncloud.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

Board footer

Powered by FluxBB