BlackCatDevelopment / BlackCatCMS

BlackCat CMS is a PHP5, HTML5 content management system
https://blackcat-cms.org
Other
11 stars 9 forks source link

V1.0.1 can´t send testmail and other mail #196

Closed Morpheus1966 closed 10 years ago

Morpheus1966 commented 10 years ago

The mail delivery is not working. PHP mail with the following error message:

Fatal error: Call to undefined method Swift_MailTransport::setUsername() in /homepages/25/xxxxxxxxxx/htdocs/bc/framework/CAT/Helper/Mail/SwiftDriver.php on line 99

with smtp: Fatal error: Uncaught exception 'Swift_TransportException' with message 'Connection could not be established with host imap.1und1.de [Connection timed out #110]' in /homepages/25/xxxxxxxx/htdocs/bc/modules/lib_swift/swift/classes/Swift/Transport/StreamBuffer.php:259 Stack trace: #0 /homepages/25/xxxxxxxx/htdocs/bc/modules/lib_swift/swift/classes/Swift/Transport/StreamBuffer.php(64): Swift_Transport_StreamBuffer->_establishSocketConnection() #1 /homepages/25/xxxxxxxxx/htdocs/bc/modules/lib_swift/swift/classes/Swift/Transport/AbstractSmtpTransport.php(115): Swift_Transport_StreamBuffer->initialize(Array) #2 /homepages/25/xxxxxxxx/htdocs/bc/modules/lib_swift/swift/classes/Swift/Mailer.php(80): Swift_Transport_AbstractSmtpTransport->start() #3 /homepages/25/xxxxxxxx/htdocs/bc/framework/CAT/Helper/Mail/SwiftDriver.php(110): Swift_Mailer->send(Object(Swift_Message)) #4 /homepages/25/xxxxxxxx/htdocs/bc/backend/settings/ajax_testmail.php(73): CAT_Helper_Mail_SwiftDriver->sendMail('webseite@blatt-...', 'webseite@blatt-. in /homepages/25/xxxxxxxxxx/htdocs/bc/modules/lib_swift/swift/classes/Swift/Transport/StreamBuffer.php on line 259

(original replaced by xxxxx)

webbird commented 10 years ago

Hm, "connection timed out" seems self-explaining to me. ;) The server cannot contact the SMTP host. Please check your settings.

webbird commented 10 years ago

The first error occurs when "SMTP Authentication" is enabled while PHP Mail is checked. Will fix this.

Morpheus1966 commented 10 years ago

Oh, I forgot also with SMTP au .. the same.

Fatal error: Uncaught exception 'Swift_TransportException' with message 'Connection could not be established with host imap.1und1.de [Connection timed out #110]' in /homepages/25/xxxxxxx/htdocs/bc/modules/lib_swift/swift/classes/Swift/Transport/StreamBuffer.php:259 Stack trace: #0 /homepages/xxxxxxxxx/htdocs/bc/modules/lib_swift/swift/classes/Swift/Transport/StreamBuffer.php(64): Swift_Transport_StreamBuffer->_establishSocketConnection() #1 /homepages/25/xxxxxxx/htdocs/bc/modules/lib_swift/swift/classes/Swift/Transport/AbstractSmtpTransport.php(115): Swift_Transport_StreamBuffer->initialize(Array) #2 /homepages/25/xxxxxxx/htdocs/bc/modules/lib_swift/swift/classes/Swift/Mailer.php(80): Swift_Transport_AbstractSmtpTransport->start() #3 /homepages/25/xxxxxxx/htdocs/bc/framework/CAT/Helper/Mail/SwiftDriver.php(110): Swift_Mailer->send(Object(Swift_Message)) #4 /homepages/25/xxxxxxxx/htdocs/bc/backend/settings/ajax_testmail.php(73): CAT_Helper_Mail_SwiftDriver->sendMail('webseite@blatt-...', 'webseite@blatt-. in /homepages/25/xxxxxxxxxx/htdocs/bc/modules/lib_swift/swift/classes/Swift/Transport/StreamBuffer.php on line 259

webbird commented 10 years ago

Grrr, where's my last comment gone???

webbird commented 10 years ago

grmpf Trying again...

You may try to increase the timeout value, but I don't think this will solve the issue.

In file ./framework/CAT/Helper/Mail/SwiftDriver.php, FIND

`self::$transport->setPassword(self::$settings['smtp_password']);`

AFTER, ADD

`self::$transport->setTimeout(30);`

Also check if your webserver is able to resolve the hostname imap.1und1.de.

webbird commented 10 years ago

Seems to be a problem at 1und1. See

http://www.websitebaker.org/forum/index.php/topic,24231.msg165230.html#msg165230

I've tried with WB 2.8.3 and got the same issue. So there's nothing we can do at the moment. Maybe it works with "POP3 authentication before SMTP", but we will have to add this option first.

webbird commented 10 years ago

Here's the solution:

https://community.contao.org/de/showthread.php?6847-2-8-Probleme-mit-Mailversand-und-Frage&p=52740&viewfull=1#post52740

Tried, works.

Morpheus1966 commented 10 years ago

Works fine with SMTP-Server: mrvnet.kundenserver.de and no SMTP-Authentification

SpeGal commented 10 years ago

1und1 told us that no SMTP-Authentification is required with mrvnet.kundenserver.de (which is the only usuable server for that matter). They said it´s because mrvnet.kundenserver.de is a server within their system and the communication can´t be tracked by anybody anyways. But that´s a little hard to understand and believe. How could the server that hosts our website communicate securly with 1und1 without an authentification protocol (SSL/TLS)? Does anybody understand this? Is it really secure to send e-mails with the settings posted above (without authentification) and if so, why?

webbird commented 10 years ago

If your Webserver is one of 1und1, the communication between this server and the mail server is done within the 1und1 data centre, so it can't be tracked from outside. Of course, this only involves the authentication, not the mail that is sent!

SpeGal commented 10 years ago

So is there any posibility to encrypt the mail as well?

webbird commented 10 years ago

You will have to use something like PGP to encrypt mails. This is not part of the mailer driver. If you need this feature, you may open a new issue (feature request).