vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3 Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=187)
-   -   Howto: Enable SMTP for vB 3.0.2/3 (https://vborg.vbsupport.ru/showthread.php?t=67294)

dlouly47 11-09-2004 02:16 AM

is this hack good with vb 3 and i am using exchange 2003 with windows 2003, thanks. i can't get any mail from php to work.

dlouly47 11-09-2004 03:08 AM

ok i did the changes and i get this error,

Parse error: parse error, expecting `','' or `';'' in c:\inetpub\wwwroot\forum\includes\mail.php on line 96

I am running vb3.0.3 on a Windows 2003/Exchange 2003.

Looks like it doesn't like var $smtpUser = webmaster@lou-ly.com;

owner 11-29-2004 07:20 PM

I get this error : Parse error: parse error, unexpected '@', expecting ',' or ';' in /home/***/public_html/includes/mail.php on line 96

Zachery 11-29-2004 08:41 PM

Quote:

Originally Posted by owner
I get this error : Parse error: parse error, unexpected '@', expecting ',' or ';' in /home/***/public_html/includes/mail.php on line 96

Whats on line 96 :)

owner 11-30-2004 01:03 PM

var $smtpHost = "mailserver.server.info";
var $smtpPort = 25;
Line 96 var $smtpUser = admin@site.com;
var $smtpPass = *****;
var $smtpSocket = null;

Illuvatar 12-03-2004 04:23 AM

Hey ya Zach!

I wanted to report back here if and when my programmer fixed the issues that we were having with this, and I must apologise for the delay as we were able to get this working late in October! :nervous:

He did however have to make some changes, but now I am very pleased to report that it works a charm! I get zero, I repeat zero rejections from providers like Hotmail, AOL, and the like. And this also allowed us to change the settings on the server to "Disallow mail to be sent from User Nobody" which was a big security hole, and ended us up on a few blacklists for SPAM. Thanks to you and this hack, we've been removed from most if not all hacks and couldn't be happier. :cool:

Sooo...here is what he had to do to get this to work for us, and I've also attached our functions and mail php files all marked with:
# SMTP mail bug fix Ulf Stabe (server, email, and pass info removed of course..hehe)
Quote:

- the errormessage function needs to be outside the smtp class
- changed the opening HELO command to the EHLO command
- a typo in an if clause of mail class : if ($this->smtpUser AND
$this->smtpPass) --> if ($this->smtpUser & $this->smtpPass)
- explicitely set a socket timeout of 100 millisec, otherwise every call
where the response is checked takes 1 min (default timeout). So sending one
mail took more than 6 min!
- In VB the delimiter for sendmail is a linefeed (/n), SMTP needs carriage
return and linefeed (/r/n) This is only set correctly when the php ini entry
for sendmail path is removed.
I replace the wrong delimiter with the right one now shortly before the mail
is sent.
I hope this helps anyone who was having the same issue as I was, and thanks again ZACHERY!!!

Zachery 12-03-2004 03:47 PM

Quote:

Originally Posted by Illuvatar
Hey ya Zach!

I wanted to report back here if and when my programmer fixed the issues that we were having with this, and I must apologise for the delay as we were able to get this working late in October! :nervous:

He did however have to make some changes, but now I am very pleased to report that it works a charm! I get zero, I repeat zero rejections from providers like Hotmail, AOL, and the like. And this also allowed us to change the settings on the server to "Disallow mail to be sent from User Nobody" which was a big security hole, and ended us up on a few blacklists for SPAM. Thanks to you and this hack, we've been removed from most if not all hacks and couldn't be happier. :cool:

Sooo...here is what he had to do to get this to work for us, and I've also attached our functions and mail php files all marked with:
# SMTP mail bug fix Ulf Stabe (server, email, and pass info removed of course..hehe)
I hope this helps anyone who was having the same issue as I was, and thanks again ZACHERY!!!

Never, NEVER, EVER~! post vBulletin files. ever.

1. When you do you break the license agreement with jelsoft
2. you break the forum rules

You can psot file changes, instructions to fix the bugs, but not whole vBulletin stock files

Illuvatar 12-03-2004 04:32 PM

1 Attachment(s)
Oh jeez.......

Apologies Zach!! :speechless:

Since I didn't actually do the coding I figured it would be less confusing than just posting the changes, but he labled all of his changes so it was easy enough for me to do. I've gone through the two files and have pieced it together the best I can and attached ONLY the changes.

Better? I Really hope this helps!

Sorry for stepping out of bounds. *Considers his hands properly slapped*

Zachery 12-03-2004 05:43 PM

Quote:

Originally Posted by Illuvatar
Oh jeez.......

Apologies Zach!! :speechless:

Since I didn't actually do the coding I figured it would be less confusing than just posting the changes, but he labled all of his changes so it was easy enough for me to do. I've gone through the two files and have pieced it together the best I can and attached ONLY the changes.

Better? I Really hope this helps!

Sorry for stepping out of bounds. *Considers his hands properly slapped*

Its ok :) just need to ensure that people get the message about posting files :)

Dan 12-04-2004 02:20 AM

ooo nice one zak :D

owner 12-04-2004 06:16 PM

Quote:

Originally Posted by owner
I get this error : Parse error: parse error, unexpected '@', expecting ',' or ';' in /home/***/public_html/includes/mail.php on line 96

var $smtpHost = "mailserver.server.info";
var $smtpPort = 25;
Line 96 var $smtpUser = admin@site.com;
var $smtpPass = *****;
var $smtpSocket = null;

---------

Still StuCK cant send mails nuthing happening .. plz help me on this one will be very greatful :)

bi11i 12-10-2004 09:57 PM

I also was getting the parser error using vb v3.0.3 and Argosoft Mail Server Pro (v1.8.7.0). This fix did not work for me (in fact, it looks like it's designed for an earlier version of vB.)

I ultimately had to use full quotations around my smtpuser field for it to work. I was unable to use the $vbphrase[webmasteremail].

Code:

var $smtpHost = "mailserver.server.info";
var $smtpPort = 25;
var $smtpUser = "admin@site.com";
var $smtpPass = *****;
var $smtpSocket = null;

It's too bad this isn't supported by default - I'm super curious why it's not. Now my poor little board is hacked.

Thanks for whoever it was that finally led me in the right direction...

Gary King 12-21-2004 05:08 PM

Nice mod, but I don't see why I get this errormessage() error like some other people in this thread are getting :(

Gary King 12-21-2004 06:11 PM

Quote:

Originally Posted by Illuvatar
Oh jeez.......

Apologies Zach!! :speechless:

Since I didn't actually do the coding I figured it would be less confusing than just posting the changes, but he labled all of his changes so it was easy enough for me to do. I've gone through the two files and have pieced it together the best I can and attached ONLY the changes.

Better? I Really hope this helps!

Sorry for stepping out of bounds. *Considers his hands properly slapped*

Your mod causes some parse errors.

bi11i 12-21-2004 07:24 PM

I fixed my parsing errors by encapsulating my email address in double quotations.

Gary King 12-21-2004 09:48 PM

Quote:

Originally Posted by bi11i
I fixed my parsing errors by encapsulating my email address in double quotations.

That's not what I'm talking about.

Anyways, I can't seem to get this to work :(

I've contacted Jelsoft and they haven't replied back in 3 hours or so yet as well.

hasan2k 12-22-2004 09:55 PM

Quote:

Originally Posted by Illuvatar
Oh jeez.......

Apologies Zach!! :speechless:

Since I didn't actually do the coding I figured it would be less confusing than just posting the changes, but he labled all of his changes so it was easy enough for me to do. I've gone through the two files and have pieced it together the best I can and attached ONLY the changes.

Better? I Really hope this helps!

Sorry for stepping out of bounds. *Considers his hands properly slapped*

Your FUNCTIONS.php change cause T string error. I followed your txt file and I think it needs to be checked for the {} signs

Zachery 12-22-2004 10:05 PM

Quote:

Originally Posted by Gary King
That's not what I'm talking about.

Anyways, I can't seem to get this to work :(

I've contacted Jelsoft and they haven't replied back in 3 hours or so yet as well.

We wont either this is an unsupported option

bi11i 12-23-2004 12:58 AM

then what ARE you talking about? your post isn't all that specific, what do you expect?
Quote:

Originally Posted by Gary King
That's not what I'm talking about.

Anyways, I can't seem to get this to work :(

I've contacted Jelsoft and they haven't replied back in 3 hours or so yet as well.


hasan2k 12-23-2004 06:46 AM

This hack is so important for so many of us.

hasan2k 12-24-2004 03:34 AM

Quote:

Originally Posted by Illuvatar
Sorry for stepping out of bounds. *Considers his hands properly slapped*

With the help from the above person, I got my smtp to send emails. user "nobody" is not allowed to send emails.

I somehow got it to work but i had to change some setting in my server.(smtp setting)

In the server WHM, I did this:

Server Setup > Security Tweaks > The SMTP Tweak is disabled

Without this the emails were not working and I was getting all kind of errors. Now my smtp is kind of insecure. php doesnt send email as "nobody" now cause I disabled in WHM. But I dont know how to have the smtp check for users id before letting them use smtp to send emails.

Can someone give me some pointers ? I want to be able to have the smtp check for userid/password before they allow someone to send email. Now anyone can i believe.

HuangA 01-10-2005 04:00 AM

Zach, can I please request something similar to Illuvatar's fixed attachement to be posted on the first page entry as well? It took me a good 30 minutes of hair ripping before I finally noticed his little attachement and applied for it to get my vb to work... Now that I'm missing like half of my hair, I'd like to keep the other half next time I need to apply this (maybe the next major release?)....

BlazeXXX 01-22-2005 09:33 PM

If I am not wrong, to be able to send mails through SMTP, first you need to verify your self with user id and password. Thats why this hack needs ur logins to connect. "Nobody" is simply using php mail function to send mail.. so I don't think your SMTP is insecure.

I think you could edit the settings if u still fear in SMTP conf file.

I could not get it to work :(. I haven't tried the second attachment which Illuvator gave. I tried it, but did not work.. so i am trying what Zach gave.

Getting this error:
Fatal error: Call to undefined function: errormessage() in /home/torrents/public_html/includes/mail.php on line 235

at Line 235:
if (!$this->sendMessage(".", 250))
{
return errorMessage("Unexpected response from SMTP server");


I got that code. However, I disabled SMTP tweak, also checked my server doesnt allow to send mails as "NoBody".


EDIT:

I could send mail to single user through diagnose tools, but when I send mass mails I am getting this error:

Fatal error: Call to undefined function: errormessage() in /home/torrents/public_html/includes/mail.php on line 218

The line I got in mail.php at 213 - 219 are:
if (!$this->sendMessage(base64_encode($this->smtpUser), 334) OR !$this->sendMessage(base64_encode($this->smtpPass), 235))

{

return errorMessage("Authorization to the SMTP server failed");

}

It can't be wrong password, because it is able to send mail to a single user. It sent to one person in mass mail list, it only occured for second > user.


Any idea how to overcome it?

zaon 02-08-2005 01:17 AM

I'm on vBulletin 3.0.1 at the moment, but don't see a mail.php file anywhere, much less in the includes directory. I really need to use SMTP to send mail via gmail.com instead of from forums server directly (for reverse lookup reasons/blocking/etc). Is this code found in some other includes file in 3.0.1 versus 3.0.2+? I wouldnt' think any major structural changes to vbulletin would exist between security releases. What do I do?

Zachery 02-08-2005 10:40 AM

Quote:

Originally Posted by zaon
I'm on vBulletin 3.0.1 at the moment, but don't see a mail.php file anywhere, much less in the includes directory. I really need to use SMTP to send mail via gmail.com instead of from forums server directly (for reverse lookup reasons/blocking/etc). Is this code found in some other includes file in 3.0.1 versus 3.0.2+? I wouldnt' think any major structural changes to vbulletin would exist between security releases. What do I do?

NOTE THE TOPIC OF THE THREAD


howto enable smtp for vBulletin 3.0.2 and 3.0.3 It also works on all versions there after.

zaon 02-11-2005 08:39 AM

Thanks, Zachery.

I'll go ahead and renew my maintenance agreement so I can upgrade to latest ver of vbulletin.

One more question tho:

My gmail SMTP server requires some additional settings I want to ensure this forum fix will accommodate:

1) outgoing SMTP server requires authentication (using same settings as incoming POP)
2) outgoing SMTP server port requires SSL encryption (port number 465)

Either of those pose a problem with this install? I can see in your code where you enter your port number, so maybe that automatically enables SSL. But where do you switch on outgoing authentication?

Appreciate your patience with me. Thanks.

--Justin

btappan 02-14-2005 12:28 PM

Has any got this working using Illuvatar's rendition? When I used just Zacherys instructions, it sends emails, but some get bounced even when their good valid addresses. I tried using Illuvatar's fix but get all kinds of errors. part of it is that his instruction have a piece of code repeated twice in them.

PHP Code:

        $mailObj = new SmtpMail($toemail$subject$message$header$vboptions['webmasteremail'], (boolean)$vboptions['needfromemail']);
    }
    else
    {
        
$mailObj = new Mail($toemail$subject$message$header$vboptions['webmasteremail'], (boolean)$vboptions['needfromemail']);
    }    
    return 
$mailObj->success;


this section ends up in functions.php twice if you just copy in past from his .txt file. who has this working?

zaon 02-17-2005 08:55 AM

Hmmm.. if no one is able to answer my question two posts up, maybe someone can state whether or not they're able to use this SMTP send function with web-based real email like gmail, hotmail, yahoo, etc., which offer POP/SMTP access to those accounts?

ALcorn 02-17-2005 09:19 AM

Quote:

Originally Posted by zaon
But where do you switch on outgoing authentication?

Outgoing authentification is set just by filling the following parameters
$smtpUser = user@domain.com;
$smtpPass = password;

But I think there will be a problem with SSL.

zaon 02-17-2005 01:03 PM

Thanks, ALcorn :-)

Also, I rechecked and google mail does indeed require TSL/SSL for outgoing SMTP connections and there's no way around that.

Google tells me this shouldn't be a problem because ALL current mail clients in the world, no matter how obscure, have a setting for TSL (sometimes called 'SSL') for both incoming and outgoing mail sending. So, there must be a way for our Linux/PHP server to send that way, right?

Or, is this SMTP function proprietary to vbulletin, being Jelsoft's hand-made mail-sending code that bypasses normal protocol and only contains the capabilities Jelsoft's programmers have chosen to include?

Thanks for any clarification y'all can offer! :-)

ALcorn 02-17-2005 01:33 PM

Quote:

Originally Posted by zaon
is this SMTP function proprietary to vbulletin, being Jelsoft's hand-made mail-sending code that bypasses normal protocol and only contains the capabilities Jelsoft's programmers have chosen to include?

In fact the support of SSL/TLS should be sincluded not only the server side (i.e. Google server) but yet on the client side, in our case in the VBulletin script. So if there's no SSL/TLS support included in VBulletin no communication via SSL/TLS protocol will be possible.

That mean its probably impossible actually (please, correct me if I am wrong on this point) to have VBulletin send mail via Google SMTP service.

Keep in mind that the SMTP e-mail future is not actually supported by Jelsoft. ;)

zaon 02-20-2005 05:01 AM

So has anyone out there got this SMTP function to work with web-based email of any kind (yahoo, hotmail, gmail, etc.)?

Zachery 02-20-2005 04:05 PM

Quote:

Originally Posted by zaon
So has anyone out there got this SMTP function to work with web-based email of any kind (yahoo, hotmail, gmail, etc.)?

Do any of them support SMTP ?

ALcorn 02-20-2005 06:56 PM

Quote:

Originally Posted by Zachery
Do any of them support SMTP ?

Yes, gmail support the SMTPS.

In fact, I looked more closely to the mail.php and found that the function fsockopen() is used. That mean (at least in theory) we can establish a secure connection via SSL if we prefixe the server name with ssl:// AND we have PHP version better than 4.3.0 AND it was compiled with openssl support. Actually, my host does not have PHP compiled with openssl, so i didn't tried it.

zaon 02-21-2005 09:31 AM

Quote:

Originally Posted by Zachery
Do any of them support SMTP ?

Yeah, most do. Like yahoo supports SMTP via all sorts of mail clients if you pay the $19/year for the bigger mail box, etc.

Google's Gmail supports it for free but requires it be SSL and authenticated, and even has step-by-step instructions posted online for every type of mail client you can think of.


@ALcorn: Thanks, man :-) So you mean like use:
var $smtpHost = "ssl://mail.domain.com";
??

And I do have PHP 4.3.10, but not sure about openssl compiling..guess i'd have to try it.

code-frog 03-11-2005 07:29 PM

In the example you post shouldn't the smtpuser and password be in quotes?

I get errors unless I have those items quoted. Even with quotes this isn't working. Ideas?

P.S. - Running this on a Windows box. UGH!

bi11i 03-11-2005 08:50 PM

Quote:

Even with quotes this isn't working. Ideas?
so are you not getting any errors with the quotes? any more info? any logs, etc when you're getting no errors, but no functionality.....?

Viks 03-13-2005 04:39 PM

This setting worked for me perfectly. thanks Zachery

============
var $smtpHost = "smtp.example.com";
var $smtpPort = 25;
var $smtpUser = "myemail@address.com";
var $smtpPass = *********;
var $smtpSocket = null;
=================

zaon 03-22-2005 08:59 PM

Ok, I upgraded vbulletin so I could install this hack.

I ran into same errors until i put double quotes around all three string items, leaving just port and socket without quotes.

But then i got that Fatal error: Call to undefined function:
errormessage() in /home/sites/www/zaon.org/includes/mail.php on line 218
error which of course points back to just this line:
return errorMessage("Unexpected response from SMTP server");
which I assume has something to do with this hack and the mail server not playing nice.

So, in order to test and then use this feature, if ANYONE has this working can you please post your account settings? And by that I obviously don't mean your username/pass, but rather which settings and which web-based SMTP email provider (yahoo, hotmail, whatever) you're using.

code-frog 03-22-2005 09:05 PM

If you are running on Windows 2003 or a Windows Server you need to find your php mail.ini file and change it's smtp server to: 127.0.0.1 and it's smtp user to a real account on the message board domain. I did that and it worked fine. I also had to allow "SMTP Relaying for authenticated users" on SMTP server. It works about 80% of the time now and the other 20% is a configuration problem on my server that I'm slowly tuning out. I've purposely left out the location of the mail.ini file for php because it may not be the same on every server. I use a program called PLESK to admin my windows server and CPANEL to admin my Linux server.

- Rex


All times are GMT. The time now is 08:40 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01765 seconds
  • Memory Usage 1,859KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)bbcode_php_printable
  • (18)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete