Loading...
 
Features / Usability

Features / Usability


webmail AUTH problem

posts: 11 United States

I'm having problems with Tiki's Webmail feature. I'm using tiki 1.7.4 on WinXP, running XMail server, domain is "localhost". I've set up three accounts via XMail for testing. In tiki, when I click on the Webmail link, I get "Error: 4" and a link to click for settings. The link takes me to the setup to add new accounts. So I add all three Xmail accounts, and select one for default. But I still get the same error. When I try to send an email, I get the error "AUTH command failed: Authentication failed". I've tested the email functionality using the Uebimaiu email client, and it works fine sending email back and forth between the accounts. I'm using "localhost" as both the POP and SMTP server names, and the default port numbers. I've tried switching SMTP authentication on and off. I've tried the fix of switching from SMTP to MAIL to use Apache's mail function. I don't get an error, but I don't get a confirmation message that the email was sent, and indeed, it's not. I suspect there's a simple solution, but I don't know enough about mail servers/clients to know where to start looking. Any help would be appreciated.

Thanks!
Mitch

posts: 2881 United Kingdom

Hi!

If im not mistaken the webmail in 1.7.4 doesnt like emails without subjects. Could that be your problem?

Damian



posts: 16 Germany

I happend to stumble into a problem with webmail auth recently. It's described in http://tikiwiki.org/tiki-index.php?page=WebmailDev#comments. The problem isn't smtp but pop3 related. A quick solutions (well: hack) is mentioned.

Try to telnet localhost 110. If you get an answer longer than 100 chars, (i'm getting something +OK some.server.domain.tld Cyrus POP3 v2.2.3 server ready 910591426.1077059945 at some.server.domain.tld here at a test sever, which is quite a bit longer) it's it.

--
ms


posts: 11 United States

Marino:
I reviewed the "WebmailDev#comments" link. The only hack I saw was to "strip SquirrelMail and roll it into Tiki", but that's more work than I have time for. When executing the "telnet localhost 110" comamnd, I get a very similar response to yours:
+OK XMail 1.17 (Win32/Ix86) POP3 Server service ready;
Which mean what, I don't know, except that the mail server is working.

Chealer9:
The sourgeforge "a quick and dirty hack" is a bit vague - I'm not sure which "auth lines" in htmlMimeMail.php to comment out. Looking at the code, whenever the $auth variable is given a hard value it's being set to FALSE. I'm thinking that it's the auth() function that's causing the "Send Mail" to fail, but that doesn't explain why the mailbox link causes an error.

Damian:
Nope, the subject line is not blank.

Any other potential fixes/solutions/suggentions out there?

Thanks,
Mitch

posts: 16 Germany

hi livewire

> I reviewed the "WebmailDev#comments" link. The only
> hack I saw was to "strip SquirrelMail and roll it into Tiki",

you must look into the comments. Sorry for beeing a bit unclear.

This is what i changed to get things running:

-+-
Some investigation led me to titkiwi/lib/webmail/pop3ph, line 94. Changing it to $this->greeting = @fgets($this->connection); did the trick (might be a good idea to read the complete line from pop3 server everywhere, as php >4.3 does with fgets($connection)).
-+-

Looking at the answer you get from your pop3 server - which is only 59(?) chars long - this might not solve your problem, though.


posts: 16 Germany

hi livewire

> I reviewed the "WebmailDev#comments" link. The only
> hack I saw was to "strip SquirrelMail and roll it into Tiki",

you must look into the comments. Sorry for beeing a bit unclear.

This is what i changed to get things running:

-+-
Some investigation led me to titkiwi/lib/webmail/pop3ph, line 94. Changing it to $this->greeting = @fgets($this->connection); did the trick (might be a good idea to read the complete line from pop3 server everywhere, as php >4.3 does with fgets($connection)).
-+-

Looking at the answer you get from your pop3 server - which is only 59(?) chars long - this might not solve your problem, though.


posts: 11 United States

Oddly enough, Marino, your solution worked! I can now see the inbox.

Now, the problem is sending mail. If I set it to use php's mail() function, and tweak the code with and without the '-f' option, neither works; and all I get is the webmail navigation page with no content - no error message, no success message, no forms, nothing. If I set it to send via SMTP, I get the error "AUTH command failed: Authentication failed". Receiving email from a different client doesn't seem to be a problem. Suggestions?

Thanks!
Mitch

posts: 16 Germany

> If I set it to send via SMTP, I get the error "AUTH command failed:
> Authentication failed". Receiving email from a different client
> doesn't seem to be a problem.

Using other clients, do you have to authenticate to the mail server before sending mail (seems like, from what you wrote)? Are you able to get authenticated by pop-before-smtp (always try to get mail from the server before sending, so pop3 daemon does the authentication stuff)?

If so, there is a time frame (ask sysadmin how long) in which you may send mail via your server after fetching mails from it (try fetching, even if there is none). So lookup your mailbox before sending any - but don't give typing in your mail to much time .. :-(

If you can't authenticate via pop-before-smtp but have to use smtp-auth, i dunno if tikiwiki mail implementation is able to handle this.

As a possible solution, you might get your ISP adding your IP-address to known hosts, so you don't have to auth. at his smtp server.

If you don't have to auth. as i suspect, i dunno what the problem is. For me it works.

--
marino

posts: 16 Germany

Mitch:

i just realized that i didn't read your orginal message thouroughly, when telling you something about the smtp auth stuff etc. I see (again) that you are well aware off this kind of things.

Nevertheless i'll give it a try again and let you know.

BTW:

  • did you try to set the "SMTP requires authentication" option (Webmail -> settings) to 'N'?
  • do your mailserver logs show anything about "auth failure"
  • does your mailserver "auth"? To check try

telnet localhost 25
220 blabla
ehlo test.server.com
250-your.mail.server.com
250-PIPELINING
250-SIZE 10240000
250-ETRN
250-AUTH CRAM-MD5 LOGIN PLAIN
250-AUTH=CRAM-MD5 LOGIN PLAIN
250 8BITMIME
quit

if server doesn't answer AUTH with LOGIN in that line, smtp-auth with tw will not work, from what i see in lib/webmail/htmlMimeMail.php

PS: just tried again. For me it works with and without smtp auth.
--
marino


posts: 16 Germany

> If I set it to send via SMTP, I get the error "AUTH command failed:
> Authentication failed". Receiving email from a different client
> doesn't seem to be a problem.

Using other clients, do you have to authenticate to the mail server before sending mail (seems like, from what you wrote)? Are you able to get authenticated by pop-before-smtp (always try to get mail from the server before sending, so pop3 daemon does the authentication stuff)?

If so, there is a time frame (ask sysadmin how long) in which you may send mail via your server after fetching mails from it (try fetching, even if there is none). So lookup your mailbox before sending any - but don't give typing in your mail to much time .. :-(

If you can't authenticate via pop-before-smtp but have to use smtp-auth, i dunno if tikiwiki mail implementation is able to handle this.

As a possible solution, you might get your ISP adding your IP-address to known hosts, so you don't have to auth. at his smtp server.

If you don't have to auth. as i suspect, i dunno what the problem is. For me it works.

--
marino

posts: 16 Germany

Mitch:

i just realized that i didn't read your orginal message thouroughly, when telling you something about the smtp auth stuff etc. I see (again) that you are well aware off this kind of things.

Nevertheless i'll give it a try again and let you know.

BTW:

  • did you try to set the "SMTP requires authentication" option (Webmail -> settings) to 'N'?
  • do your mailserver logs show anything about "auth failure"
  • does your mailserver "auth"? To check try

telnet localhost 25
220 blabla
ehlo test.server.com
250-your.mail.server.com
250-PIPELINING
250-SIZE 10240000
250-ETRN
250-AUTH CRAM-MD5 LOGIN PLAIN
250-AUTH=CRAM-MD5 LOGIN PLAIN
250 8BITMIME
quit

if server doesn't answer AUTH with LOGIN in that line, smtp-auth with tw will not work, from what i see in lib/webmail/htmlMimeMail.php

PS: just tried again. For me it works with and without smtp auth.
--
marino


posts: 11 United States

Yeah, I get the expected response from the telnet session, and yes, SMTP Authentication is turned off for all accounts. I'll have to poke around a bit to find the mail server error logs, but first glance is no, the auth error isn't being logged.

It's definitely the SMTP auth() function (line ~2230 in htmlMimeMail) that's failing at the password verification, specifically:

AND $this->send_data(base64_encode($this->pass)) // Send pswd
AND substr$error = $this->get_data(,0,3) === '235'

I've verified several times that the webmail password and the mail server passsword for the accounts are identical. Unfortunately, I don't understand how the resource works well enough to figure out what exactly is going on with the send_data function, and why it's failing. Needless to say, I'd rather not have the password verification bit commented out when this goes live!

Another weird side effect is happening in the smtp mail() function (line ~2250 in htmlMimeMail). I have an error_log call to dump the values being tested in the single if statement. Without the error_log calls, I get a series of "Bad command sequence" errors. With the error_log, everything works just fine! Messages are sent, received, and replied to. Go figure! :/

-Mitch

posts: 16 Germany

> and yes, SMTP Authentication is turned off for all accounts.

nevertheless webmail is going to AUTH user? Which version of htmlMimeMail.php are you using? Here it's tw 1.8 and (from lines 5-6)
* Last Modified..: $Date: 2003/12/16 11:09:01 $
* CVS Revision...: $Revision: 1.6.4.1 $

Maybe you can give that version of ./tikiwiki/lib/webmail/* a try.

> With the error_log, everything works just fine! Messages are
> sent, received, and replied to. Go figure!

Logging the complete communication between webmail an smtp server (fussing around a lot in htmlMimeMail.php) and/or having the smtp server log more information might lead to something. If you are using postfix, i'd be able to give you some hints (if you really want to dig into that ...). Trying a newer version will be faster and (hopefully) not that frustrating.

--
marino


posts: 16 Germany

> and yes, SMTP Authentication is turned off for all accounts.

nevertheless webmail is going to AUTH user? Which version of htmlMimeMail.php are you using? Here it's tw 1.8 and (from lines 5-6)
* Last Modified..: $Date: 2003/12/16 11:09:01 $
* CVS Revision...: $Revision: 1.6.4.1 $

Maybe you can give that version of ./tikiwiki/lib/webmail/* a try.

> With the error_log, everything works just fine! Messages are
> sent, received, and replied to. Go figure!

Logging the complete communication between webmail an smtp server (fussing around a lot in htmlMimeMail.php) and/or having the smtp server log more information might lead to something. If you are using postfix, i'd be able to give you some hints (if you really want to dig into that ...). Trying a newer version will be faster and (hopefully) not that frustrating.

--
marino


posts: 11 United States

I've upgraded to tiki1.8. The webmail works now.

Thanks!
Mitch


Upcoming Events

1)  18 Apr 2024 14:00 GMT-0000
Tiki Roundtable Meeting
2)  16 May 2024 14:00 GMT-0000
Tiki Roundtable Meeting
3)  20 Jun 2024 14:00 GMT-0000
Tiki Roundtable Meeting
4)  18 Jul 2024 14:00 GMT-0000
Tiki Roundtable Meeting
5)  15 Aug 2024 14:00 GMT-0000
Tiki Roundtable Meeting
6)  19 Sep 2024 14:00 GMT-0000
Tiki Roundtable Meeting
7) 
Tiki birthday
8)  17 Oct 2024 14:00 GMT-0000
Tiki Roundtable Meeting
9)  21 Nov 2024 14:00 GMT-0000
Tiki Roundtable Meeting
10)  19 Dec 2024 14:00 GMT-0000
Tiki Roundtable Meeting