[RC1] BetterSMTP

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
01satkins
Registered User
Posts: 82
Joined: Sat Sep 03, 2005 8:12 pm

Post by 01satkins » Mon May 22, 2006 8:09 am

does this mod have proxy support, and if not is it something you are planning for teh future of this mod?

franlee
Registered User
Posts: 4
Joined: Wed May 31, 2006 1:50 pm

plain_error_message() in smtp_squirrelmail.php

Post by franlee » Mon Jun 05, 2006 8:13 am

This has to be a minor issue, but I guess I should report it anyway:

If putting an invalid smtp host or port, the mailer will gives:

Fatal error: Call to undefined function: plain_error_message() in /includes/smtp_squirrelmail/smtp_squirrelmail.php on line 323

Mod verison: 0.9.3
phpBB verison: 2.0.20

ahamer
Registered User
Posts: 1
Joined: Wed Jun 14, 2006 7:46 pm

Post by ahamer » Wed Jun 14, 2006 7:50 pm

I get the following error:

General Error
Server replied:

DEBUG MODE

Line : 129
File : smtp_squirrelmail.php

So I removed

function _($str) { # emulate gettext syntax to avoid errors
message_die(GENERAL_ERROR,$str, "", __LINE__, __FILE__);
}

as suggested, and I get

Fatal error: Call to undefined function: _() in \includes\smtp_squirrelmail\smtp_squirrelmail.php on line 318

So I try stekkel's suggestion and replace it with,

if (!function_exists('_') {
function _($str) { # emulate gettext syntax to avoid errors
echo $str;
}
}

and then I get

Parse error: parse error in \includes\smtp_squirrelmail\smtp_squirrelmail.php on line 128

Help?

Issac
Registered User
Posts: 6
Joined: Mon Apr 05, 2004 9:36 pm
Location: CT
Contact:

Post by Issac » Thu Jun 22, 2006 12:42 pm

Code: Select all

Fatal error: Cannot redeclare _() in /depot/home/foxtrotls.com/forum/includes/smtp_squirrelmail/smtp_squirrelmail.php on line 128
I followed the install to book, and that is displayed when a user tries to register. auth method is login, ssl auth is on.

Please help, as I'm at a loss :(

phpBB 2.0.21
BetterSMTP 0.9.3

User avatar
TommyV
Registered User
Posts: 45
Joined: Wed Oct 23, 2002 10:42 am
Location: Fredericia, Denmark
Name: Tommy
Contact:

Error message

Post by TommyV » Sat Sep 02, 2006 1:07 pm

Hi

I have also tried to install this mod, but I get (as some others in here do) the error message:

Code: Select all

Fatal error: Cannot redeclare _() in /includes/smtp_squirrelmail/smtp_squirrelmail.php on line 128
Is there any solution to this, or do I have to abandon this MOD?

/Tommy

LAzYbONEz
Registered User
Posts: 17
Joined: Thu Nov 16, 2006 9:44 am
Contact:

Post by LAzYbONEz » Thu Nov 16, 2006 9:48 am

Hi

I'm also getting weird error. I'm a programming n00b but using 2.0.21 i get

Code: Select all

Fatal error: Call to undefined function smtp_squirrelmail() in /var/sites/xxxxxxxxxxxxxxxxx/forums/includes/emailer.php on line 207
line 207 is

Code: Select all

$result = smtpsquirrelmail($to, $this->subject, $this->msg, $this->extra_headers);
Any ideas? I'd love to use this MOD for my gmail

LAzYbONEz

ccb056
Registered User
Posts: 54
Joined: Tue Sep 02, 2003 3:28 am

Post by ccb056 » Tue Nov 28, 2006 5:11 am

Im running phpBB 2.0.21 on my forums and have an account on both a gmail server and another TLS server. I have tried all combinations of settings in the ACP and have only gotten a white screen after sending emails, no error message or anything like that.

I think I read earlier in the thread that getting a white screen means that the mail server was not able to validate the mail account.

Does anyone know how to get this mod to work for gmail on pbpBB 2.0.21

I am running:

Apache 1.3.36
PHP 4.4.2

OpenSSL is installed and enabled for my php.

mattbeals
Registered User
Posts: 3
Joined: Fri Dec 29, 2006 9:41 am

Post by mattbeals » Fri Dec 29, 2006 9:54 am

I just installed phpbb 2.0.22 and am having a real problem getting email sent. I use a third party mail host that requires CRAM-MD5 authentication. Is installing the "better SMTP" mod the best way to go for v2.0.22? Or is there something else that I should do?

Does anyone have a configuration that works with CRAM-MD5?

Short of that is there a way to turn off the email authentication when registering for an account?

TGShaftoe
Registered User
Posts: 17
Joined: Mon Jan 01, 2007 1:56 am

Post by TGShaftoe » Sun Jan 07, 2007 11:10 pm

I have just installed this MOD and was getting the

Code: Select all

Fatal error: Cannot redeclare _() in /includes/smtp_squirrelmail/smtp_squirrelmail.php on line 128
Error I changed that line like it says to

Code: Select all

if (!function_exists('_') { 
function _($str) { # emulate gettext syntax to avoid errors 
echo $str; 
} 
} 
But am now getting this error

Code: Select all

Parse error: parse error, unexpected '{' in /includes/smtp_squirrelmail/smtp_squirrelmail.php on line 127
The coding starting from line 125 is as follows.

Code: Select all

}

    if (!function_exists('_') {
    function _($str) { # emulate gettext syntax to avoid errors
        echo $str;
    }
}
}
Thank for any help you can give.

Rezand
Registered User
Posts: 1
Joined: Fri Jun 02, 2006 11:48 am

Seems to be working now...

Post by Rezand » Fri Feb 02, 2007 9:51 pm

Ok, this took a few hours to get working properly. Wow, I didn't need to spend my day on that.

I was getting a blank page whenever an SMTP email needed to be sent. I have PHP 5.1 and it really hated this squirrelmail mod.

Here's what I changed, though to finally get it to send email.

I deleted this function from smtp_squirremail.php:

Code: Select all

/* If you want to remove the line below, you're probably running php with gettext... :> 
function _($str) { # emulate gettext syntax to avoid errors
    message_die(GENERAL_ERROR,$str, "", __LINE__, __FILE__);
}
*/
and then I pain-stakingly tracked down this line in includes/smtp_squirrelmail/class/mime/Message.class.php which caused more blank pages:

Code: Select all

	$this = $message;
The function (parseBodyStructure) tried to use some clever recursion trick, but reassigning $this is very much not allowed in PHP5+.

So in order to get this to work, I adapted this code:

Code: Select all

	if ($sub_msg) {
	    $message = $sub_msg;
	} else {
	    $message = new Message();
	}
	$this = $message;    
        for ($cnt = strlen($read); $i < $cnt; ++$i) {
            $char = strtoupper($read{$i});
            switch ($char) {
                case '(':
                    switch($arg_no) {
                        case 0:
                            if (!isset($msg)) {
                                $msg = new Message();
                                $hdr = new MessageHeader();
                                $hdr->type0 = 'text';
                                $hdr->type1 = 'plain';
                                $hdr->encoding = 'us-ascii';
                            } else {
                                $msg->header->type0 = 'multipart';
                                $msg->type0 = 'multipart';
                                while ($read{$i} == '(') {
                                    $msg->addEntity($this->parseBodyStructure($read, $i, $msg));
                                }
                            }
                            break;
                        case 1:
                            /* multipart properties */
                            ++$i;
                            $arg_a[] = $this->parseProperties($read, $i);
                            ++$arg_no;
                            break;
                        case 2:
                            if (isset($msg->type0) && ($msg->type0 == 'multipart')) {
                                ++$i;
                                $arg_a[] = $this->parseDisposition($read, $i);
                            } else { /* properties */
                                $arg_a[] = $this->parseProperties($read, $i);
                            }
                            ++$arg_no;
                            break;
                        case 3:
                            if (isset($msg->type0) && ($msg->type0 == 'multipart')) {
                                ++$i;
                                $arg_a[]= $this->parseLanguage($read, $i);
                            }
                        case 7:
                            if (($arg_a[0] == 'message') && ($arg_a[1] == 'rfc822')) {
                                $msg->header->type0 = $arg_a[0];
                                $msg->header->type1 = $arg_a[1];
                                $msg->type0 = $arg_a[0];
                                $msg->type1 = $arg_a[1];
                                $rfc822_hdr = new Rfc822Header();
                                $msg->rfc822_header = $this->parseEnvelope($read, $i, $rfc822_hdr);
                                while (($i < $cnt) && ($read{$i} != '(')) {
                                    ++$i;
                                }
                                $msg->addEntity($this->parseBodyStructure($read, $i,$msg));
                            }
                            break;
                        case 8:
                            ++$i;
                            $arg_a[] = $this->parseDisposition($read, $i);
                            ++$arg_no;
                            break;
                        case 9:
                            ++$i;
                            if (($arg_a[0] == 'text') || (($arg_a[0] == 'message') && ($arg_a[1] == 'rfc822'))) {
                                $arg_a[] = $this->parseDisposition($read, $i);
                            } else {
                                $arg_a[] = $this->parseLanguage($read, $i);
                            }
                            ++$arg_no;
                            break;
                       case 10:
                           if (($arg_a[0] == 'text') || (($arg_a[0] == 'message') && ($arg_a[1] == 'rfc822'))) {
                               ++$i;
                               $arg_a[] = $this->parseLanguage($read, $i);
                           } else {
                               $i = $this->parseParenthesis($read, $i);
                               $arg_a[] = ''; /* not yet described in rfc2060 */
                           }
                           ++$arg_no;
                           break;
                       default:
                           /* unknown argument, skip this part */
                           $i = $this->parseParenthesis($read, $i);
                           $arg_a[] = '';
                           ++$arg_no;
                           break;
                   } /* switch */
                   break;
                case '"':
                    /* inside an entity -> start processing */
                    $arg_s = $this->parseQuote($read, $i);
                    ++$arg_no;
                    if ($arg_no < 3) {
                        $arg_s = strtolower($arg_s); /* type0 and type1 */
                    }
                    $arg_a[] = $arg_s;
                    break;
                case 'n':
                case 'N':
                    /* probably NIL argument */
                    if (strtoupper(substr($read, $i, 4)) == 'NIL ') {
                        $arg_a[] = '';
                        ++$arg_no;
                        $i += 2;
                    }
                    break;
                case '{':
                    /* process the literal value */
                    $arg_s = $this->parseLiteral($read, $i);
                    ++$arg_no;
                    break;
		case '0':    
                case is_numeric($read{$i}):
                    /* process integers */
                    if ($read{$i} == ' ') { break; }
		    ++$arg_no;
		    if (preg_match('/^([0-9]+).*/',substr($read,$i), $regs)) {
			$i += strlen($regs[1])-1;
			$arg_a[] = $regs[1];
		    } else {
			$arg_a[] = 0;
		    }
                    break;
                case ')':
                    $multipart = (isset($msg->type0) && ($msg->type0 == 'multipart'));
                    if (!$multipart) {
                        $shifted_args = (($arg_a[0] == 'text') || (($arg_a[0] == 'message') && ($arg_a[1] == 'rfc822')));
                        $hdr->type0 = $arg_a[0];
                        $hdr->type1 = $arg_a[1];

                        $msg->type0 = $arg_a[0];
                        $msg->type1 = $arg_a[1];
                        $arr = $arg_a[2];
                        if (is_array($arr)) {
                            $hdr->parameters = $arg_a[2];
                        }
                        $hdr->id = str_replace('<', '', str_replace('>', '', $arg_a[3]));
                        $hdr->description = $arg_a[4];
                        $hdr->encoding = strtolower($arg_a[5]);
                        $hdr->entity_id = $msg->entity_id;
                        $hdr->size = $arg_a[6];
                        if ($shifted_args) {
                            $hdr->lines = $arg_a[7];
                            $s = 1;
                        } else {
                            $s = 0;
                        }
                        $hdr->md5 = (isset($arg_a[7+$s]) ? $arg_a[7+$s] : $hdr->md5);
                        $hdr->disposition = (isset($arg_a[8+$s]) ? $arg_a[8+$s] : $hdr->disposition);
                        $hdr->language = (isset($arg_a[9+$s]) ? $arg_a[9+$s] : $hdr->language);
                        $msg->header = $hdr;
                    } else {
                        $hdr->type0 = 'multipart';
                        $hdr->type1 = $arg_a[0];
                        $msg->type0 = 'multipart';
                        $msg->type1 = $arg_a[0];
                        $hdr->parameters = (isset($arg_a[1]) ? $arg_a[1] : $hdr->parameters);
                        $hdr->disposition = (isset($arg_a[2]) ? $arg_a[2] : $hdr->disposition);
                        $hdr->language = (isset($arg_a[3]) ? $arg_a[3] : $hdr->language);
                        $msg->header = $hdr;
                    }
                    return $msg;
                default: break;
            } /* switch */
        } /* for */
    } /* parsestructure */
to this code:

Code: Select all

    function parseBodyStructure($read, &$i, $sub_msg = '') {
        $arg_no = 0;
        $arg_a  = array();
        if ($sub_msg) {
            $message = $sub_msg;
        } else {
            $message = new Message();
        }

        for ($cnt = strlen($read); $i < $cnt; ++$i) {
            $char = strtoupper($read{$i});
            switch ($char) {
                case '(':
                    switch($arg_no) {
                        case 0:
                            if (!isset($msg)) {
                                $msg = new Message();
                                $hdr = new MessageHeader();
                                $hdr->type0 = 'text';
                                $hdr->type1 = 'plain';
                                $hdr->encoding = 'us-ascii';
                            } else {
                                $msg->header->type0 = 'multipart';
                                $msg->type0 = 'multipart';
                                while ($read{$i} == '(') {
                                    $msg->addEntity($msg->parseBodyStructure($read, $i, $msg));
                                }
                            }
                            break;
                        case 1:
                            /* multipart properties */
                            ++$i;
                            $arg_a[] = $msg->parseProperties($read, $i);
                            ++$arg_no;
                            break;
                        case 2:
                            if (isset($msg->type0) && ($msg->type0 == 'multipart')) {
                                ++$i;
                                $arg_a[] = $msg->parseDisposition($read, $i);
                            } else { /* properties */
                                $arg_a[] = $msg->parseProperties($read, $i);
                            }
                            ++$arg_no;
                            break;
                        case 3:
                            if (isset($msg->type0) && ($msg->type0 == 'multipart')) {
                                ++$i;
                                $arg_a[]= $msg->parseLanguage($read, $i);
                            }
                        case 7:
                            if (($arg_a[0] == 'message') && ($arg_a[1] == 'rfc822')) {
                                $msg->header->type0 = $arg_a[0];
                                $msg->header->type1 = $arg_a[1];
                                $msg->type0 = $arg_a[0];
                                $msg->type1 = $arg_a[1];
                                $rfc822_hdr = new Rfc822Header();
                                $msg->rfc822_header = $msg->parseEnvelope($read, $i, $rfc822_hdr);
                                while (($i < $cnt) && ($read{$i} != '(')) {
                                    ++$i;
                                }
                                $msg->addEntity($msg->parseBodyStructure($read, $i,$msg));
                            }
                            break;
                        case 8:
                            ++$i;
                            $arg_a[] = $msg->parseDisposition($read, $i);
                            ++$arg_no;
                            break;
                        case 9:
                            ++$i;
                            if (($arg_a[0] == 'text') || (($arg_a[0] == 'message') && ($arg_a[1] == 'rfc822'))) {
                                $arg_a[] = $msg->parseDisposition($read, $i);
                            } else {
                                $arg_a[] = $msg->parseLanguage($read, $i);
                            }
                            ++$arg_no;
                            break;
                       case 10:
                           if (($arg_a[0] == 'text') || (($arg_a[0] == 'message') && ($arg_a[1] == 'rfc822'))) {
                               ++$i;
                               $arg_a[] = $msg->parseLanguage($read, $i);
                           } else {
                               $i = $msg->parseParenthesis($read, $i);
                               $arg_a[] = ''; /* not yet described in rfc2060 */
                           }
                           ++$arg_no;
                           break;
                       default:
                           /* unknown argument, skip this part */
                           $i = $msg->parseParenthesis($read, $i);
                           $arg_a[] = '';
                           ++$arg_no;
                           break;
                   } /* switch */
                   break;
                case '"':
                    /* inside an entity -> start processing */
                    $arg_s = $msg->parseQuote($read, $i);
                    ++$arg_no;
                    if ($arg_no < 3) {
                        $arg_s = strtolower($arg_s); /* type0 and type1 */
                    }
                    $arg_a[] = $arg_s;
                    break;
                case 'n':
                case 'N':
                    /* probably NIL argument */
                    $tmpnil = strtoupper(substr($read, $i, 4));
                    if ($tmpnil == 'NIL ' || $tmpnil == 'NIL)') {
                        $arg_a[] = '';
                        ++$arg_no;
                        $i += 2;
                    }
                    break;
                case '{':
                    /* process the literal value */
                    $arg_a[] = $msg->parseLiteral($read, $i);
                    ++$arg_no;
                    break;
        case '0':
                case is_numeric($read{$i}):
                    /* process integers */
                    if ($read{$i} == ' ') { break; }
            ++$arg_no;
            if (preg_match('/^([0-9]+).*/',substr($read,$i), $regs)) {
                $i += strlen($regs[1])-1;
                $arg_a[] = $regs[1];
            } else {
                $arg_a[] = 0;
            }
                    break;
                case ')':
                    $multipart = (isset($msg->type0) && ($msg->type0 == 'multipart'));
                    if (!$multipart) {
                        $shifted_args = (($arg_a[0] == 'text') || (($arg_a[0] == 'message') && ($arg_a[1] == 'rfc822')));
                        $hdr->type0 = $arg_a[0];
                        $hdr->type1 = $arg_a[1];

                        $msg->type0 = $arg_a[0];
                        $msg->type1 = $arg_a[1];
                        $arr = $arg_a[2];
                        if (is_array($arr)) {
                            $hdr->parameters = $arg_a[2];
                        }
                        $hdr->id = str_replace('<', '', str_replace('>', '', $arg_a[3]));
                        $hdr->description = $arg_a[4];
                        $hdr->encoding = strtolower($arg_a[5]);
                        $hdr->entity_id = $msg->entity_id;
                        $hdr->size = $arg_a[6];
                        if ($shifted_args) {
                            $hdr->lines = $arg_a[7];
                            $s = 1;
                        } else {
                            $s = 0;
                        }
                        $hdr->md5 = (isset($arg_a[7+$s]) ? $arg_a[7+$s] : $hdr->md5);
                        $hdr->disposition = (isset($arg_a[8+$s]) ? $arg_a[8+$s] : $hdr->disposition);
                        $hdr->language = (isset($arg_a[9+$s]) ? $arg_a[9+$s] : $hdr->language);
                        $msg->header = $hdr;
                    } else {
                        $hdr->type0 = 'multipart';
                        $hdr->type1 = $arg_a[0];
                        $msg->type0 = 'multipart';
                        $msg->type1 = $arg_a[0];
                        $hdr->parameters = (isset($arg_a[1]) ? $arg_a[1] : $hdr->parameters);
                        $hdr->disposition = (isset($arg_a[2]) ? $arg_a[2] : $hdr->disposition);
                        $hdr->language = (isset($arg_a[3]) ? $arg_a[3] : $hdr->language);
                        $msg->header = $hdr;
                    }
                    return $msg;
                default: break;
            } /* switch */
        } /* for */
    } /* parsestructure */
The updated code is more-or-less the function used in the current revisions of squirrelmail that is floating around out there.

When I made this change, happily everything worked because my GMail SMTP settings were proper.

Hope this helps someone else,
-Rezand

iissmart
Registered User
Posts: 4
Joined: Wed Feb 23, 2005 3:04 am
Location: West Chester, Ohio
Contact:

Re: [RC1] BetterSMTP

Post by iissmart » Thu Mar 29, 2007 6:00 am

Rezand, even with applying your changes I still get a white page. What port should be used if we are trying to use gmail's smtp?
--iissmart--

User avatar
bonelifer
Community Team Member
Community Team Member
Posts: 3480
Joined: Wed Oct 27, 2004 11:35 pm
Name: William
Contact:

Re: [RC1] BetterSMTP

Post by bonelifer » Thu Mar 29, 2007 7:11 am

port 587
Knowledge Base | phpBB Board Rules | Search Customisation Database
Image
Please don't contact me via PM or email for phpBB support .

iissmart
Registered User
Posts: 4
Joined: Wed Feb 23, 2005 3:04 am
Location: West Chester, Ohio
Contact:

Re: [RC1] BetterSMTP

Post by iissmart » Thu Mar 29, 2007 3:52 pm

Actually, I set it to port 465 and its working perfectly now. Sweet!
--iissmart--

Tim Taylor
Registered User
Posts: 9
Joined: Mon Jan 22, 2007 2:10 pm

Re: [RC1] BetterSMTP

Post by Tim Taylor » Fri Apr 13, 2007 8:22 pm

I followed your instructions, ended up with a brand new error...

Parse error: parse error, unexpected ';', expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /homepages/22/d190004196/htdocs/includes/smtp_squirrelmail/class/mime/Message.class.php on line 808

~T

babevi
Registered User
Posts: 14
Joined: Sun Apr 15, 2007 9:00 am

Re: [RC1] BetterSMTP

Post by babevi » Mon Apr 16, 2007 6:06 pm

Parse error: parse error, unexpected ';', expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/www/babevi.com/forum/includes/smtp_squirrelmail/class/mime/Message.class.php on line 811


Similar error as above. Please help.

Post Reply

Return to “[2.0.x] MODs in Development”