Not logged in. · Lost password · Register
Forum: Support Bug reports and troubleshooting RSS
Can't send any e-mail
Avatar
Draghmar #1
Member since Dec 2006 · 63 posts
Group memberships: Members
Show profile · Link to this post
Subject: Can't send any e-mail
Hello
Recently I've installed UNB and wanted to configure SMTP. After putting each data (login, password, server, port - it isn't standard 25 if it matters) I can't send any mail. I don't know why. Config is 100% correct - I made some tests using phpmailer and there wasn't any problems.
UNB logs didn't gave me any clue because there is only this info:
25.10.2011 07:28:10 - User 1 Admin - @cp - *.*.*.*
Wiadomość nie mogła być wysłana.

Backtrace:
  • site/unb_lib/cp.inc.php : 3065 : UnbErrorLog("Wiadomość nie mogła być wysłana.<b…")
  • */site/forum.php : 114 : require("/*…")
which says that message couldn't be sent.
Any suggestions what I could do?

BTW I don't know why but this error message is cut - see '...'? Is this normal? I had some other errors right after installing and they had longer messages.
"I have come up with a plan so cunning you could stick a tail on it and call it a weasel."
Avatar
Yves (Administrator) #2
User title: UNB developer & webmaster
Member since Jan 2004 · 3855 posts · Location: Erlangen, Germany
Group memberships: Administrators, Members
Show profile · Link to this post
There should be an error log entry like "SMTP error:" when something with the SMTP connection goes wrong. If it doesn't, you could trace the TCP connection to your mail server (e.g. with Wireshark or tcpdump) to see what they're talking.

The parameters in the backtrace are limited in length, that is normal.
♪ ...nanananah, all in all we’re just brilliant thieves, nanananah... ♪♬
Avatar
Draghmar #3
Member since Dec 2006 · 63 posts
Group memberships: Members
Show profile · Link to this post
Thx for reply.
But which log should I check? apache log? All I can find there are errors about problems with timezone settings and those are in abbc.css.php. Probably because of form used for sending e-mails.
System logs doesn't show anything either.
And because of that I can't find source of my problem. :(

I tried to use tcpdump (based on some examples I've found on net):
tcpdump -w test.pcap -i eth0 tcp port 80
but with no luck (it's possible that I don't know how to use it properly ;)). There was nothing worth mentioning - only my requests on port 80 and some communication with smpt server on 587 but I have no idea how to read this file.
I wonder...if I wouldn't suppress timezone errors would they affect sending e-mails?
"I have come up with a plan so cunning you could stick a tail on it and call it a weasel."
This post was edited on 2011-10-28, 08:47 by Draghmar.
Avatar
Draghmar #4
Member since Dec 2006 · 63 posts
Group memberships: Members
Show profile · Link to this post
Ok. I've made some progress with wireshark...It seams that logging into mail server is correct but right after that UNB and mail server says goodbye to each other and that's it. No message sent.
"I have come up with a plan so cunning you could stick a tail on it and call it a weasel."
Avatar
Yves (Administrator) #5
User title: UNB developer & webmaster
Member since Jan 2004 · 3855 posts · Location: Erlangen, Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Hm, I can't say anything about it given the current information. I would need to debug the application on your server which I can't do.
♪ ...nanananah, all in all we’re just brilliant thieves, nanananah... ♪♬
Avatar
Draghmar #6
Member since Dec 2006 · 63 posts
Group memberships: Members
Show profile · Link to this post
Ok, I understand. But could you give some tip about where to start looking? I tried to put something like this:
  1. if ($mail_error) {
  2.     $hx_log = fopen("hx_log", "a");
  3.     fwrite($hx_log, $mail_error);
  4.     fwrite($hx_log, "\n");
  5.     fclose($hx_log);
  6. }
in mail.lib.php at line 184 to get something but $mail_error had to be false because file wasn't created.

Maybe we could start with something ease like where sending e-mail is started? Because if I try to create file (like above) at begging of UnbNotifyUser function then there is no excepted result. :( I tried this in also smtp.lib.php with no luck.
"I have come up with a plan so cunning you could stick a tail on it and call it a weasel."
Avatar
Draghmar #7
Member since Dec 2006 · 63 posts
Group memberships: Members
Show profile · Link to this post
Ok, I found place where problem occurs. It's $this->ValidatedEMail which is empty somehow. I have to find why...Maybe it's because registration was set on admin's permission?
Where this var is set?

Edit: I've put my e-mail instead of $this->ValidatedEMail to check if it works then and...yeah, it works.

Edit2: Hmm...It's seems that it's lack of validation that is causing this problem. In DB there are empty fields in ValidatedEMail row. So I think my question should be: How can I (as admin) activate user who previously registered when "registration by administrator" (I'm not sure how it is called in english) option was enabled?

Edit3: I've made temporary hack - instead of
  1. $mailAddress = $toUnconfirmedAddress ? $user->GetEMail() : $user->GetValidatedEMail();
I've put only:
  1. $mailAddress = $user->GetEMail();
"I have come up with a plan so cunning you could stick a tail on it and call it a weasel."
This post was edited on 2011-11-03, 12:14 by Draghmar.
Avatar
Michael #8
User title: UNB user
Member since Dec 2007 · 19 posts · Location: Bayern, Germany
Group memberships: Members
Show profile · Link to this post
Hi Draghmar,

I noticed this behavior with the empty validation e-mail too. It occurs since a few versions ago. The row ValadiationEmail in Database is empty. I filled the row via phpmyadmin (mysql). Can anyone confirm this "bug"?
Avatar
Yves (Administrator) #9
User title: UNB developer & webmaster
Member since Jan 2004 · 3855 posts · Location: Erlangen, Germany
Group memberships: Administrators, Members
Show profile · Link to this post
There has been a change in the meaning and use of the two e-mail address fields in the user table. This had to do with address validation. That's been ages ago I think. But I'm not aware of any bugs with it.
♪ ...nanananah, all in all we’re just brilliant thieves, nanananah... ♪♬
Avatar
Draghmar #10
Member since Dec 2006 · 63 posts
Group memberships: Members
Show profile · Link to this post
But can I use my "solution"? Isn't there things that it may broke?
"I have come up with a plan so cunning you could stick a tail on it and call it a weasel."
Avatar
Yves (Administrator) #11
User title: UNB developer & webmaster
Member since Jan 2004 · 3855 posts · Location: Erlangen, Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Basically I have no idea what happens if you modify the source code like that. You should better fix your database which should have automatically happened in the upgrade script already. I hope you clicked on that "upgrade" link when when it appeared after you upgraded the software.
♪ ...nanananah, all in all we’re just brilliant thieves, nanananah... ♪♬
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
This board is powered by the Unclassified NewsBoard software, 20120620-dev, © 2003-2011 by Yves Goergen
Page created in 189.2 ms (138.3 ms) · 113 database queries in 101.6 ms
Current time: 2013-05-21, 12:20:36 (UTC +02:00)