dotProject Forums

Go Back   dotProject Forums > DOTPROJECT VERSION 2 > Installation Issues 2.x
Register FAQTop Posters Members List Calendar Search Today's Posts Resend Activation Email Mark Forums Read
dotProject Documentation dotProject FAQ Bugs & Feature Requests Language Packs & Themes Download dotProject

Installation Issues 2.x Please use this forum to raise any installation issues you may be experiencing. Use the search facility and check the FAQ's before asking your question please.

Reply
 
Thread Tools Display Modes
  #1  
Old 28-06-07, 01:06 AM
bartmanpt bartmanpt is offline
Junior Member
Return Visitor
dotProject Version:
php Version:
MySQL Version:
Operating System Version:
Browser:
 
Join Date: 27-06-07
Posts: 5
Exclamation [EMAIL Problem] Failed to login to SMTP server...

Hi everyone!

For a while, I've been trying to set my dotProject installation to send email messages (tried three different email accounts). All tried servers require authentication and, for a reason I am not seeing, I get the following errors for the different emails:

- "Failed to login to SMTP server: 250-AUTH LOGIN CRAM-MD5" {using the mail.mycompany.com server}
- "Failed to login to SMTP server: 250-STARTTLS" {using the mail.mycompany.pt or the smtp.gmail.com server}

### dotProject Configuration
Email Transport : SMTP
SMTP Host: mail.mycompany.com or mail.mycompany.pt or smtp.gmail.com
SMTP Port: 25
Host requires login: [checked]
SMTP Username: <my usernames...>
SMTP Password: <my passwords...>

### My setup
dotProject 2.1-rc2
Debian Linux 2.6.18-4-686 etch3
PHP Version 4.4.4-8
Apache/1.3.34 {LOADED MODULES: mod_php4, mod_setenvif, mod_expires, mod_auth, mod_access, mod_rewrite, mod_alias, mod_userdir, mod_cgi, mod_dir, mod_autoindex, mod_status, mod_negotiation, mod_mime, mod_mime_magic, mod_log_config, mod_macro, mod_so, http_core}
MySQL 5.0.32

Can anyone help? Please? (notice that I'm not familiar with PHP). If anyone knows a free email provider that works, please let me know

My Best Regards,
Bart.

Reply With Quote
  #2  
Old 28-06-07, 03:00 AM
pedroa's Avatar
pedroa pedroa is offline
Valued Users
Utter Fanatic
dotProject Version:
php Version:
MySQL Version:
Operating System Version:
Browser:
 
Join Date: 18-01-05
Posts: 3,554
Default Re: [EMAIL Problem] Failed to login to SMTP server...

Did you try using the PHP alternative?
System Admin, System Config., Mail Transport (from the top of my head)

Pedro A.
__________________
Peace!!!
Reply With Quote
  #3  
Old 28-06-07, 03:15 AM
bartmanpt bartmanpt is offline
Junior Member
Return Visitor
dotProject Version:
php Version:
MySQL Version:
Operating System Version:
Browser:
 
Join Date: 27-06-07
Posts: 5
Default Re: [EMAIL Problem] Failed to login to SMTP server...

Hi Pedro!

As a manner of fact, I did. What happens is that all email accounts I use require authentication and, if I am not wrong, I can only use PHP if authentication is not required. Right?

I have been trying to put it to work but I must be missing something...

Regards from Aveiro!
Bart.

Reply With Quote
  #4  
Old 28-06-07, 04:29 AM
pedroa's Avatar
pedroa pedroa is offline
Valued Users
Utter Fanatic
dotProject Version:
php Version:
MySQL Version:
Operating System Version:
Browser:
 
Join Date: 18-01-05
Posts: 3,554
Default Re: [EMAIL Problem] Failed to login to SMTP server...

PHP does not require login because it uses your servers own sendmail app
I remember using it with SMTP without problems on some servers but on others it blows up, mainly due to wrong handshakes that require debugging each step of the negotiation procedure on classes/libmail.class.php

See ya around in Aveiro, you may end up stumbling on me one of these days

Pedro A.
__________________
Peace!!!
Reply With Quote
  #5  
Old 28-06-07, 06:54 PM
bartmanpt bartmanpt is offline
Junior Member
Return Visitor
dotProject Version:
php Version:
MySQL Version:
Operating System Version:
Browser:
 
Join Date: 27-06-07
Posts: 5
Default Re: [EMAIL Problem] Failed to login to SMTP server...

So, what you are saying is that if I only have email accounts requiring authentication, I should not go for the SMTP approach because I might have to debug the whole handshake mechanism in the classes/libmail.class.php file? Instead I should install sendmail and use PHP Default? In this case, are there any special requirements in what concerns the sendmail installation?

Best Regards,
Bart.

Reply With Quote
  #6  
Old 28-06-07, 10:15 PM
pedroa's Avatar
pedroa pedroa is offline
Valued Users
Utter Fanatic
dotProject Version:
php Version:
MySQL Version:
Operating System Version:
Browser:
 
Join Date: 18-01-05
Posts: 3,554
Default Re: [EMAIL Problem] Failed to login to SMTP server...

You see some mail servers use different protocol procedures when it comes to SMTP, though there are specific standards regarding that protocol. But we know what MS thinks about standards just look at the IE example.
Some use HELO to start a conversation, others use EHLO, others like the domain name after it, others want the bracketed IP.
The libmail does not provide an overall interface to all situations that's why sometimes you'll need to debug each step of the process.
In your case I believe the problem is about the AUTH LOGIN step, which is the second step.
So HELO worked correctly, but the AUTH LOGIN didn't.
When you send the HELO (line 401 of libmail.class.php) it returns a message with the mail servers features.
If it supports or demands for STARTTLS encryption then it should be after the HELO (or EHLO) and before the AUTH, so you can try to add after:
Code:
	$this->socketSend("HELO " . $this->getHostName());
this:
Code:
	$this->socketSend("STARTTLS");
And see how that goes, apparently your mail server accepts the AUTH LOGIN method, which means it requires authentication to send mail with a simple base64 encryption of the username and password sent one at a time, which is the way it is implemented on dPs libmail.class.php

Pedro A.
__________________
Peace!!!
Reply With Quote
  #7  
Old 30-06-07, 02:10 AM
bartmanpt bartmanpt is offline
Junior Member
Return Visitor
dotProject Version:
php Version:
MySQL Version:
Operating System Version:
Browser:
 
Join Date: 27-06-07
Posts: 5
Default Re: [EMAIL Problem] Failed to login to SMTP server...

Hello Pedro,

I went to the CVS, got a clean version of the libmail.class.php and added the line you suggested (in line 406):

Code:
$this->socketSend("STARTTLS");
The result was a bit different, since now, instead of the "Failed to login to SMTP server: 250-STARTTLS", i got "Failed to login to SMTP server: "only.

Actually I tried to mimic the procedure in the SMTPSend(...) function (with the command you suggested included) by using telnet [telnet smtp.gmail.com 25, and so on...]. However, I found that after issuing the STARTTLS command I am instructed by the server to create a TLS connection, as shown bellow:
Code:
Connected to <servername>.
Escape character is '^]'.
220 <servername> ESMTP CommuniGate Pro 5.0.10
EHLO bartmio
250-<servername> domain name should be qualified bartmio
250-DSN
250-SIZE 10485760
250-STARTTLS
250-AUTH LOGIN PLAIN
250-ETRN
250-TURN
250-ATRN
250-NO-SOLICITING
250-8BITMIME
250-HELP
250-PIPELINING
250 EHLO
STARTTLS
220 please start a TLS connection
I cannot see were, in the SMTPSend(...) function, is a "TLS connection created".

From my perspective and, as I said before I'm not familiar with PHP, the SMTPSend(...) cannot handle email authentication using either SSL or TLS transports. I guess it can only work with email accounts that do not require this kind of transport (unencrypted login and password communication between client and server). {Notice that the base64_encode function only provides a weak encryption, easily breakable if you can sniff the whole transaction using ethereal, for example.}

The only way I can successfully login (without using a common email client) to my servers is by using an ssl client:
An example:
Code:
openssl s_client -verify 0 -connect smtp.gmail.com:465
Another one:
Code:
openssl s_client -starttls smtp -crlf -connect mail.ua.pt:25
Please advise about the line of course to put it working... should I try to get an email account that works (which I already tried without success...)? or should I install a sendmail server for relaying the emails? or work with PHP Default? In this scenario, should I configure sendmail with some specific parameters?

Again, thanks for your patience and advise,
Bart.

Reply With Quote
  #8  
Old 03-07-07, 08:17 AM
pedroa's Avatar
pedroa pedroa is offline
Valued Users
Utter Fanatic
dotProject Version:
php Version:
MySQL Version:
Operating System Version:
Browser:
 
Join Date: 18-01-05
Posts: 3,554
Default Re: [EMAIL Problem] Failed to login to SMTP server...

Indeed libmail.class.php was not designed to work with tls/ssl therefore you can either rebuild the smtpsend to work with it or you can use sendmail if that is an option to you.
If you notice dP uses a very simple approach for issuing emails, it either uses the smtp with no AUTH or AUTH LOGIN by opening a socket to the mail server and outputting direct instructions to that socket pretty much like you do via telnet, or it uses phps mail function (which on a UNIX server will probably use sendmail as MTA).
If you have sendmail properly working on your server it should work with PHP Default right away, unless the relaying is being denied on the given domain.

Good luck there in the ua.pt

Pedro A.
__________________
Peace!!!
Reply With Quote
  #9  
Old 14-07-07, 08:51 AM
bartmanpt bartmanpt is offline
Junior Member
Return Visitor
dotProject Version:
php Version:
MySQL Version:
Operating System Version:
Browser:
 
Join Date: 27-06-07
Posts: 5
Smile Re: [EMAIL Problem] Failed to login to SMTP server...

Hi Pedro,

I've managed to make it work using the mail account given by my ISP. I found that some ISPs provide email servers that do not require authentication (open relays). Others just need unencripted login/password authentication (as the one I tried with telnet).

Thanks 4 your support

Bart.

Reply With Quote
  #10  
Old 14-03-08, 08:04 AM
chermucsnis's Avatar
chermucsnis chermucsnis is offline
Valued Users
Frequent Visitor
dotProject Version:
php Version:
MySQL Version:
Operating System Version:
Browser:
 
Join Date: 13-03-07
Posts: 46
Thumbs up Re: [EMAIL Problem] Failed to login to SMTP server...

I believe I found the problem.

I've post a bug report, with proposed fix, in the following link:

http://www.dotproject.net/mantis/view.php?id=2353

Hope it can help who is facing the same problem.
__________________
[B][U]Alex Vieira ___________[/U][/B]
dotProject v2.1.2
MySQL 5.0.45
PHP 5.2.5 - Apache 2.2.6
Windows Server 2003
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT +10. The time now is 03:54 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.