Subject: After all this time...

Posted on: 13/03/05 09:13pm
By: Anonymous

...my mail functions still don't work. I'm back for another try.

My mail is currently set up for SMTP. When I attempt to send a test message, this is the error message I get:

Fatal error: Cannot redeclare display_form() (previously declared in d:websitesblah3.comwwwadminmail.php:62) in d:websitesblah3.comwwwadminMail.php on line 60


At this point, I have nearly 550 users signed up, and most of them do not have a password.

Can anyone help? Thanks.

-Don

After all this time

Posted on: 13/03/05 10:37pm
By: Don

Further information:

I changed the mail settings to pear=true and mail settings to 'pear.' Same error message.

my path to pear in config.php is:

$_CONF['path_pear'] = $_CONF['path_system'] . 'pear/PEAR';

When I remove the /PEAR from the path, the error message is not there, but the GL page that breaks down successes and failures comes up instead. As you can guess, all attempts are failures.

Is it safe to assume that the problem is in the 'PEAR' directory? I uploaded a clean set of pear files, but I still get that 'cannot re-declare' error message.

-Don

After all this time

Posted on: 14/03/05 01:59am
By: newblogger

what version on php are you using?
could you post the mail portion of your config file
don't forget to use the code button

After all this time

Posted on: 18/03/05 10:46am
By: Dirk

It should actually work when you set $_CONF['have_pear'] = false;

The problem is that on a file system that is not case sensitive (like the ones Windows or MacOS X use by default), there is no difference between 'mail.php' (which implements Geeklog's "Mail Users" function) and 'Mail.php' (which is part of the PEAR package to send emails).

So when when you try to send an email via "Mail Users", it will try to load 'mail.php' instead of 'Mail.php' because it a) doesn't recognize the difference and b) it checks in the current directory first. So it tries to load a file into itself and finds that all the functions are already defined ...

When you set $_CONF['have_pear'] = false; Geeklog will set its PEAR directory as the first directory in PHP's search path which should ensure that the proper 'Mail.php' is being loaded. And it works for me on MacOS X ...

bye, Dirk

After all this time

Posted on: 19/03/05 08:44pm
By: Don

Thanks again for your help, Dirk. But I must be missing something somewhere.

Here are the Pear settings from my config.php file:

// If your server is running PHP 4.3.0 (or newer) then chances are that PEAR
// is already installed and you can change this to: $_CONF['have_pear'] = true;
$_CONF['have_pear'] = false;

// Geeklog comes with the necessary PEAR packages and will pick them up from
// the following directory if $_CONF['have_pear'] = false (above).
$_CONF['path_pear'] = $_CONF[path_system] . 'pear/PEAR';


Here are the Mail settings:

$_CONF['mail_settings'] = array (  
    'backend' => 'mail', // can be one of 'mail', 'sendmail', 'smtp'

    // sendmail parameters (for 'backend' => 'mail')
    'sendmail_path' => '/usr/sbin/sendmail',
    'sendmail_args' => '-i -t',

    // SMTP parameters (for 'backend' => 'smtp')
    'host'     => 'localhost',
    'port'     => '25',
    'auth'     => 'true',
    'username' => '*******',
    'password' => '*******'


Obviously, the user and password have been redacted.

I'm still getting the 'cannot redeclare' error message.

I also got this in my error log:

03/19/2005 07:13:19 PM - [pear_error: message="Validation failed for "Blah3.com <editor@mail.blah3.com>"" code=0 mode=return level=notice prefix="" info=""] 



I got 11 of them - I was trying to send an email to my Story Admins, a group of 11 people.

Thanks again in advance.

-Don

After all this time

Posted on: 19/03/05 10:05pm
By: Praxxus

Try
$_CONF['path_pear'] = $_CONF['path_system'] . 'pear/';


instead of the
$_CONF['path_pear'] = $_CONF['path_system'] . 'pear/PEAR';
that you have. With that extra "PEAR" on the end, you're actually descending one directory too deep into GeekLog's Pear library, so GeekLog still isn't aware of "Mail.php" and is trying to reload "mail.php" back into itself.

After all this time

Posted on: 19/03/05 10:31pm
By: Don

Hey, Prax! Fancy meeting you here....

I tried that once before. no reason not to try it again, tho...

-D

After all this time

Posted on: 19/03/05 10:36pm
By: Don

Removed the extra 'pear' from the path.

Now I get the 'Successfully sent 0 messages and unsuccessfully sent 11 messages' message. My error log shows 11 of these:


03/19/2005 10:33:27 PM - [pear_error: message="Validation failed for "Blah3.com "" code=0 mode=return level=notice prefix="" info=""]

So I'm assuming the problem lies elsewhere...

-D

After all this time

Posted on: 19/03/05 10:50pm
By: Don

Okay, I found this on The Geekog Project:

http://www.geeklog.net/forum/viewtopic.php?forum=3&showtopic=44356


When using GeekLog v1.3.11 some special characters like square brackets [] still give a pear-error when trying to send a mail to new users.

Example:

Change
$_CONF['site_name'] = 'MySite [dot] com';

Register new user.

Error log displays following entry:

Mon 24 Jan 2005 08:09:32 PM CET - [pear_error: message="Validation failed for "MySite [dot] com "" code=0 mode=return level=notice prefix="" info=""]


I changed the site name from 'Blah3.com' to 'Blah3,' and now I'm sending messages successfully.

I won't believe it until the emails actually show up in my inbox, but I'm encouraged.

Thanks to all for the suggestions.

-D

After all this time

Posted on: 19/03/05 10:54pm
By: Praxxus

Yeah, I'm trying to give some back to GeekLog, even if it is just via seat-of-my-pants technical advice.

Well, at least you got beyond your "can't redefine function" error. It's progress, of a sort.

[QUOTE BY= Don] Removed the extra 'pear' from the path.

Now I get the 'Successfully sent 0 messages and unsuccessfully sent 11 messages' message. My error log shows 11 of these:


03/19/2005 10:33:27 PM - [pear_error: message="Validation failed for "Blah3.com "" code=0 mode=return level=notice prefix="" info=""]

So I'm assuming the problem lies elsewhere...

-D[/QUOTE]

Do you have $_CONF['site_mail'] defined? Correctly? Just looking at your error message and a quick Googling makes me think that what PEAR can't validate is an e-mail address.

Speculation:
For whatever reason, it's getting "Blah3.com" as the formatted address, and then barfing out because there is no "@" symbol, which it expects in a valid e-mail address.



After all this time

Posted on: 19/03/05 11:08pm
By: Don

Yeah, site_mail is defined. See the post above yours - Geeklog was b0rking due to 'site_name' being 'Blah3.com.' I shortened it to 'Blah3,' and now it works.

I sent test emails to my Story Editors. Luckily, one of them is my wife, and she got the email. But I'm a Story Admin, and I didn't get my test email. Weird.

-D

After all this time

Posted on: 19/03/05 11:22pm
By: Praxxus

Yay, mail!


After all this time

Posted on: 19/03/05 11:27pm
By: Don

I started a new thread, but since you're still here...

Now I'm trying to sign up as a new user to see if I'd get a confirmation email. Instead, I get this error:

Fatal error: Cannot redeclare class mail_rfc822 in d:\websites\blah3.com\www\system\pear\Mail\RFC822.php on line 59


Any suggestions? TIA.

-D

After all this time

Posted on: 25/07/05 06:22pm
By: eg0master

I had a similar problem with swedish characters in the title.
PEAR uses a RFC822 class to validate an email.
My problem (and probably yours too) is that when sending out passwordds the sender PEAR tries to verify is:
sitename
In my case I removed the chek at line 557 in RFC822.php (in pear/Mail folder). The if statement is in function _validateAtom and is preceeded by the comment "Check for any char from ASCII 0 - ASCII 127

If your site name had a dot in the name the next test "check for specials" would fail in the same function.

Instead of hacking this file it would be nice if the site name was NOT added when using pear to send email. havn't figured out where to do that just yet.

After all this time

Posted on: 26/07/05 01:59am
By: Dirk

[QUOTE BY= eg0master] Instead of hacking this file it would be nice if the site name was NOT added when using pear to send email. havn't figured out where to do that just yet.[/QUOTE]
FWIW: In the CVS version, we're now enclosing the sender's name in quotes as soon as it contains something other than digits or the letters a-z. I hope that this finally solves all these problems ...

bye, Dirk

After all this time

Posted on: 26/07/05 03:07am
By: eg0master

[QUOTE BY= Dirk] FWIW: In the CVS version, we're now enclosing the sender's name in quotes as soon as it contains something other than digits or the letters a-z. I hope that this finally solves all these problems ...[/QUOTE]

I guess it should. Just GREPing on $_CONF['site_name'] should find all places affected or is there a better search I can do to manually patch this in the mean time?

After all this time

Posted on: 26/07/05 04:08pm
By: eg0master

I went thru the code where site_name is used together with mail and as far as I can see (got 1.3.11sr1) the site_name is quoted with " everywhere it is used as from address, however when in RFC822 it is not quoted when printed to the error log.

So where are you adding quotes when not present?

After all this time

Posted on: 26/07/05 04:20pm
By: Dirk

COM_formatEmailAddress should handle that. You could also try using that function from the CVS version and see if it makes a difference.

bye, Dirk

After all this time

Posted on: 27/07/05 04:16pm
By: eg0master

[QUOTE BY= Dirk] COM_formatEmailAddress should handle that. You could also try using that function from the CVS version and see if it makes a difference.[/QUOTE]

CVS version works fine thank you.

Geeklog - Forum
https://www.geeklog.net/forum/viewtopic.php?showtopic=49637