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

Sending Email doesnt work #3364

Closed
ataraxus opened this issue Jul 11, 2020 · 12 comments
Closed

Sending Email doesnt work #3364

ataraxus opened this issue Jul 11, 2020 · 12 comments

Comments

@ataraxus
Copy link

ataraxus commented Jul 11, 2020

Expected behavior

Email should be sent. I receive all of my emails, when i click on answer and then on send, the email should be sent.

Actual behavior

I get an error

I have this enabled in my config.php, but it didnt change anything (still horde exception)
'app.mail.transport' => 'php-mail'

OCA\Mail\Exception\ServiceException: Could not send message: mail() returned failure.
/var/www/html/custom_apps/mail/lib/Controller/AccountsController.php - line 345:

OCA\Mail\Service\MailTransmission->sendMessage(OCA\Mail\Mod ... {}, OCA\Mail\Mod ... {}, null, 192)
Horde_Mime_Exception: mail() returned failure.
/var/www/html/custom_apps/mail/vendor/pear-pear.horde.org/Horde_Mime/Horde/Mime/Mail.php - line 479:

Horde_Mime_Part->send("redacted <redacted>", Horde_Mime_Headers {}, Horde_Mail_T ... "})

/var/www/html/custom_apps/mail/lib/Service/MailTransmission.php - line 174:

Horde_Mime_Mail->send(Horde_Mail_T ... "}, false, false)
Sending mail failed: Could not send message: mail() returned failure.
{"reqId":"vfngDF3L2uwTTkPBNWkw","level":4,"time":"2020-07-11T13:18:30+00:00","remoteAddr":"87.79.237.48","user":"redacted","app":"mail","method":"POST","url":"/nextcloud/index.php/api/accounts/1/send","message":"Sending mail failed: Could not send message: mail() returned failure.","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36","version":"19.0.0.12"}
{"reqId":"vfngDF3L2uwTTkPBNWkw","level":3,"time":"2020-07-11T13:18:30+00:00","remoteAddr":"87.79.237.48","user":"redacted","app":"mail","method":"POST","url":"/nextcloud/index.php/api/accounts/1/send","message":{"Exception":"OCA\\Mail\\Exception\\ServiceException","Message":"Could not send message: mail() returned failure.","Code":0,"Trace":[{"file":"/var/www/html/custom_apps/mail/lib/Controller/AccountsController.php","line":345,"function":"sendMessage","class":"OCA\\Mail\\Service\\MailTransmission","type":"->","args":[{"__class__":"OCA\\Mail\\Model\\NewMessageData"},{"__class__":"OCA\\Mail\\Model\\RepliedMessageData"},null,192]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":170,"function":"send","class":"OCA\\Mail\\Controller\\AccountsController","type":"->","args":[1,"Re:redacted <redacted>","","",false,192,"SU5CT1g=",15807,[],null]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":100,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Mail\\Controller\\AccountsController"},"send"]},{"file":"/var/www/html/lib/private/AppFramework/App.php","line":137,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Mail\\Controller\\AccountsController"},"send"]},{"file":"/var/www/html/lib/private/AppFramework/Routing/RouteActionHandler.php","line":47,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Mail\\Controller\\AccountsController","send",{"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},{"accountId":"1","_route":"mail.accounts.send"}]},{"function":"__invoke","class":"OC\\AppFramework\\Routing\\RouteActionHandler","type":"->","args":[{"accountId":"1","_route":"mail.accounts.send"}]},{"file":"/var/www/html/lib/private/Route/Router.php","line":297,"function":"call_user_func","args":[{"__class__":"OC\\AppFramework\\Routing\\RouteActionHandler"},{"accountId":"1","_route":"mail.accounts.send"}]},{"file":"/var/www/html/lib/base.php","line":1007,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/apps/mail/api/accounts/1/send"]},{"file":"/var/www/html/index.php","line":37,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/custom_apps/mail/lib/Service/MailTransmission.php","Line":176,"Previous":{"Exception":"Horde_Mime_Exception","Message":"mail() returned failure.","Code":0,"Trace":[{"file":"/var/www/html/custom_apps/mail/vendor/pear-pear.horde.org/Horde_Mime/Horde/Mime/Mail.php","line":479,"function":"send","class":"Horde_Mime_Part","type":"->","args":["jug gler <redacted>",{"__class__":"Horde_Mime_Headers"},{"sep":"\n","__class__":"Horde_Mail_Transport_Mail"}]},{"file":"/var/www/html/custom_apps/mail/lib/Service/MailTransmission.php","line":174,"function":"send","class":"Horde_Mime_Mail","type":"->","args":[{"sep":"\n","__class__":"Horde_Mail_Transport_Mail"},false,false]},{"file":"/var/www/html/custom_apps/mail/lib/Controller/AccountsController.php","line":345,"function":"sendMessage","class":"OCA\\Mail\\Service\\MailTransmission","type":"->","args":[{"__class__":"OCA\\Mail\\Model\\NewMessageData"},{"__class__":"OCA\\Mail\\Model\\RepliedMessageData"},null,192]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":170,"function":"send","class":"OCA\\Mail\\Controller\\AccountsController","type":"->","args":[1,"redacted \u2013\n>   <redacted>","","",false,192,"SU5CT1g=",15807,[],null]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":100,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Mail\\Controller\\AccountsController"},"send"]},{"file":"/var/www/html/lib/private/AppFramework/App.php","line":137,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Mail\\Controller\\AccountsController"},"send"]},{"file":"/var/www/html/lib/private/AppFramework/Routing/RouteActionHandler.php","line":47,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Mail\\Controller\\AccountsController","send",{"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},{"accountId":"1","_route":"mail.accounts.send"}]},{"function":"__invoke","class":"OC\\AppFramework\\Routing\\RouteActionHandler","type":"->","args":[{"accountId":"1","_route":"mail.accounts.send"}]},{"file":"/var/www/html/lib/private/Route/Router.php","line":297,"function":"call_user_func","args":[{"__class__":"OC\\AppFramework\\Routing\\RouteActionHandler"},{"accountId":"1","_route":"mail.accounts.send"}]},{"file":"/var/www/html/lib/base.php","line":1007,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/apps/mail/api/accounts/1/send"]},{"file":"/var/www/html/index.php","line":37,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/custom_apps/mail/vendor/pear-pear.horde.org/Horde_Mime/Horde/Mime/Part.php","Line":1642,"Previous":{"Exception":"Horde_Mail_Exception","Message":"mail() returned failure.","Code":0,"Trace":[{"file":"/var/www/html/custom_apps/mail/vendor/pear-pear.horde.org/Horde_Mime/Horde/Mime/Part.php","line":1620,"function":"send","class":"Horde_Mail_Transport_Mail","type":"->","args":["redacted",{"From":"redacted <redacted>","Cc":"","References":"<.issue-2359..17@redacted>","In-Reply-To":"<.issue-2359..17@redacted>","Message-ID":"<20200711131830.Horde.8RHCXR2-GfQv8MFT-Pk42qs.redacted>","User-Agent":"Horde Application Framework 5","Date":"Sat, 11 Jul 2020 13:18:30 +0000","Content-Type":"text/plain; charset=utf-8","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable"},redacted},{"file":"/var/www/html/custom_apps/mail/vendor/pear-pear.horde.org/Horde_Mime/Horde/Mime/Mail.php","line":479,"function":"send","class":"Horde_Mime_Part","type":"->","args":["jug gler <redacted>",{"__class__":"Horde_Mime_Headers"},{"sep":"\n","__class__":"Horde_Mail_Transport_Mail"}]},{"file":"/var/www/html/custom_apps/mail/lib/Service/MailTransmission.php","line":174,"function":"send","class":"Horde_Mime_Mail","type":"->","args":[{"sep":"\n","__class__":"Horde_Mail_Transport_Mail"},false,false]},{"file":"/var/www/html/custom_apps/mail/lib/Controller/AccountsController.php","line":345,"function":"sendMessage","class":"OCA\\Mail\\Service\\MailTransmission","type":"->","args":[{"__class__":"OCA\\Mail\\Model\\NewMessageData"},{"__class__":"OCA\\Mail\\Model\\RepliedMessageData"},null,192]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":170,"function":"send","class":"OCA\\Mail\\Controller\\AccountsController","type":"->","args":[1 <redacted>","","",false,192,"SU5CT1g=",15807,[],null]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":100,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Mail\\Controller\\AccountsController"},"send"]},{"file":"/var/www/html/lib/private/AppFramework/App.php","line":137,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Mail\\Controller\\AccountsController"},"send"]},{"file":"/var/www/html/lib/private/AppFramework/Routing/RouteActionHandler.php","line":47,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Mail\\Controller\\AccountsController","send",{"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},{"accountId":"1","_route":"mail.accounts.send"}]},{"function":"__invoke","class":"OC\\AppFramework\\Routing\\RouteActionHandler","type":"->","args":[{"accountId":"1","_route":"mail.accounts.send"}]},{"file":"/var/www/html/lib/private/Route/Router.php","line":297,"function":"call_user_func","args":[{"__class__":"OC\\AppFramework\\Routing\\RouteActionHandler"},{"accountId":"1","_route":"mail.accounts.send"}]},{"file":"/var/www/html/lib/base.php","line":1007,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/apps/mail/api/accounts/1/send"]},{"file":"/var/www/html/index.php","line":37,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/custom_apps/mail/vendor/pear-pear.horde.org/Horde_Mail/Horde/Mail/Transport/Mail.php","Line":111}},"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36","version":"19.0.0.12"}

Mail app

Mail app version: 1.4.1

Mailserver or service: 1und1.de

Server configuration

Operating system: Ubuntu 18.04

Web server: official Docker Image of nextcloud 19

Database: mysql

PHP version: (e.g. 7.0)

Nextcloud Version: 19

Client configuration

Browser: latest firfox

Operating system: ubuntu 18.04

@ChristophWurst
Copy link
Member

I have this enabled in my config.php, but it didnt change anything (still horde exception)

Did this setup ever work or are you using Nextcloud Mail for the very first time?

@ataraxus
Copy link
Author

Hello @ChristophWurst first time NextcloudMail user. Longtime Nextcloud user...
Didnt work with or without this setting, i tried both

@no-response no-response bot removed the needs info label Jul 16, 2020
@ChristophWurst
Copy link
Member

Are you sure php-mail works? Why do you use this and not SMTP?

@ataraxus
Copy link
Author

It didnt work (sending) so I search ed for a Solution and Found this:
'app.mail.transport' => 'php-mail'
Which one should use if Service Provider is 1und1 which happens to be in our case

@ataraxus
Copy link
Author

We Do use 1und1, since it didnt work out of the Box i followed this: https://github.com/nextcloud/mail/blob/master/doc/admin.md#use-php-mail-for-sending-mail

@ChristophWurst
Copy link
Member

Got it. That is quite an old setting and I can't fully recall why this was/is necessary. Would you have the skills and time to debug if sending via php's sendmail is allowed on that setup? I don't currently have the time to help with this due to other priorities, sorry.

@ataraxus
Copy link
Author

ataraxus commented Aug 10, 2020

It didnt worked without, so i tried to follow these advices.... my first attempt was using it "vanilla" without any success.
Without any success means: email get displayed and are readable, but searching and answering emails is not possible.

I dont have any PHP skills, so I think i'm not capable to debug anything :( I hoped these logs will tell you something

@ataraxus
Copy link
Author

ataraxus commented Oct 5, 2020

upgraded to most recent version of nextcloud, sadly still not working. deleted account and created it again. only retreival of emails work, sending and search are still failing.

@ataraxus
Copy link
Author

ataraxus commented Oct 7, 2020

upgraded to nextcloud 20 and mail 1.5.0 deleted account and created a new one. still email sending breaks with:
Horde_Mime_Exception: mail() returned failure
custom_apps/mail/vendor/pear-pear.horde.org/Horde_Mime/Horde/Mime/Mail.php","line":479,

@ataraxus
Copy link
Author

ataraxus commented Oct 7, 2020

ok. now it works.
with the current nextcloud version 20 and mail 1.5.0 without 'app.mail.transport' => 'php-mail' it works with 1und1 1&1.

If I enable php-mail it doesn't work anymore with 1und1, maybe the hint from: https://github.com/nextcloud/mail/blob/master/doc/admin.md should be revised.

@ataraxus ataraxus closed this as completed Oct 7, 2020
@ChristophWurst
Copy link
Member

If I enable php-mail it doesn't work anymore with 1und1, maybe the hint from: https://github.com/nextcloud/mail/blob/master/doc/admin.md should be revised.

If you have an explanation for it I'm happy to accept PRs that update the docs with this knowledge :)

@ataraxus
Copy link
Author

ataraxus commented Oct 8, 2020

I dont have any explanation besides with nextcloud 18 and 19 I tried with and without this option. After upgrading to 20 I tried again with and without this option. Without enabling it it did work. I provided and read extensive debug logs (#3304) but i cant tell whats the issue.

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

2 participants