Welcome to Geeklog, Anonymous Friday, March 29 2024 @ 08:31 am EDT

Geeklog Forums

After all this time...


Don

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
 Quote

Status: offline

Don

Forum User
Full Member
Registered: 06/09/04
Posts: 153
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
 Quote

Status: offline

newblogger

Forum User
Regular Poster
Registered: 08/22/04
Posts: 107
Location:Virginia Beach
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
Got Hot wheels? http://www.dcmotoring.com
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
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
 Quote

Status: offline

Don

Forum User
Full Member
Registered: 06/09/04
Posts: 153
Thanks again for your help, Dirk. But I must be missing something somewhere.

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

Text Formatted Code
// 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:

Text Formatted Code
$_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:

Text Formatted Code
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
 Quote

Status: offline

Praxxus

Forum User
Newbie
Registered: 12/08/04
Posts: 6
Try
Text Formatted Code
$_CONF['path_pear'] = $_CONF['path_system'] . 'pear/';
 


instead of the
Text Formatted Code
$_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.
 Quote

Status: offline

Don

Forum User
Full Member
Registered: 06/09/04
Posts: 153
Hey, Prax! Fancy meeting you here....

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

-D
 Quote

Status: offline

Don

Forum User
Full Member
Registered: 06/09/04
Posts: 153
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

Status: offline

Don

Forum User
Full Member
Registered: 06/09/04
Posts: 153
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
 Quote

Status: offline

Praxxus

Forum User
Newbie
Registered: 12/08/04
Posts: 6
Yeah, I'm trying to give some back to GeekLog, even if it is just via seat-of-my-pants technical advice. Razz

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


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.


 Quote

Status: offline

Don

Forum User
Full Member
Registered: 06/09/04
Posts: 153
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
 Quote

Status: offline

Praxxus

Forum User
Newbie
Registered: 12/08/04
Posts: 6
Yay, mail!

 Quote

Status: offline

Don

Forum User
Full Member
Registered: 06/09/04
Posts: 153
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:

Text Formatted Code
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
 Quote

Status: offline

eg0master

Forum User
Regular Poster
Registered: 07/21/05
Posts: 73
Location:Stockholm
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.
Geeklog Plugins: http://plugincms.com
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
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.

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
 Quote

Status: offline

eg0master

Forum User
Regular Poster
Registered: 07/21/05
Posts: 73
Location:Stockholm
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 ...


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?
Geeklog Plugins: http://plugincms.com
 Quote

Status: offline

eg0master

Forum User
Regular Poster
Registered: 07/21/05
Posts: 73
Location:Stockholm
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?
Geeklog Plugins: http://plugincms.com
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
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
 Quote

Status: offline

eg0master

Forum User
Regular Poster
Registered: 07/21/05
Posts: 73
Location:Stockholm
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.


CVS version works fine thank you.
Geeklog Plugins: http://plugincms.com
 Quote

All times are EDT. The time is now 08:31 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content