View Issue Details

IDProjectCategoryView StatusLast Update
0011493phplist applicationConfigurationpublic18-12-07 19:03
Reporterarawak 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionnot fixable 
Product Version2.10.4 
Target VersionFixed in Version 
Summary0011493: $phpmailer_smtpport being ignored
DescriptionI am not able to get PHPlist (2.10.5) to abide by the phpmailer_smtpport directive. It will use different PHPMAILERHOST variables fine and I can confirm that using tcpdump, but the phpmailer_smtpport directive seems to be simply ignored -- connections continue to go to 25.
Additional InformationMy config is below. System is CentOS5 64-bit. php-common-5.1.6-12.el5

---------------------------------------------------
# If you tend to send out html emails, it is recommended to do so.
define("PHPMAILER",1);

# To use a SMTP please give your server hostname here, leave it blank to use the standard
# PHP mail() command.
define("PHPMAILERHOST",'10.10.10.10');
$phpmailer_smtpport = '125';
---------------------------------------------------

what is also strange is that the smtpport variable only seems to be referenced in the config file and nowhere else:

[root@panel lists]# grep -rin smtpport *
config/config.php:623:$phpmailer_smtpport = '125';
[root@panel lists]# pwd
/www/club/phplist/lists
TagsNo tags attached.

Relationships

related to 0015170 resolvedmichiel Upgrading PhpMailer Class 

Activities

nd_oliveira

19-09-07 15:26

reporter   ~0032651

I believe that there is a "major" bug in de phpmailer class.

When, in class.phplistmailer.php, the application variables are instantiated, then "this->Helo" variable is loaded with de website (phplist) URL, that is configured in the site main page:

$this->Helo = getConfig("website")

By that, when the send() function load the Hello command, it is sent do the site URL (ex.: http://localhost/phplist), WRONG!!!!

The correct instantiation line is:
       $this->Helo = getConfig("PHPMAILERHOST");

This solves the problem....

h2b2

19-09-07 18:44

manager   ~0032684

As a side note, Arawak's report originates from this forum thread: http://forums.phplist.com/viewtopic.php?t=11974

Another way to put his question would IMO be whether or not the *FAQs documention* is correct in stating that one can change the default SMTP port by adding the following line in config.php:
$phpmailer_smtpport = '125';

arawak

21-09-07 04:39

reporter   ~0032798

Definitely adjust the FAQ so more people don't waste hours debugging like I did but, better yet, if the functionality was there once upon a time, why not reimplement it? It's much more logical to have a variable like that set in the config file rather than in the class itself. Just my $0.02... nawt a developer.

h2b2

04-12-07 21:30

manager   ~0037579

I believe I am -at least in part- to blame for the confusion. Based on a number of forum posts indicating that the phpmailer_smtpport could be set, I mistakenly concluded the phpmailer_smtpport was an existing configuration setting in config.php, and included this as a "solution" in the FAQs, without checking first. Sorry about that.

Still, being able to define a different SMTP port than the default port 25 is a recurring question on the forums. In that sense, this issue might be considered a *feature request*.


In the mean time, for those that need a different SMTP port and want to be able to use the $phpmailer_smtpport setting, this is the solution proposed by davidhw:
----------------
The solution is to add this line in class.phplistmailer.php

after (around line 32):
      if (isset($GLOBALS['phpmailer_smtpuser']) && $GLOBALS['phpmailer_smtpuser'] != '') {
        $this->SMTPAuth = true;
        $this->Username = $GLOBALS['phpmailer_smtpuser'];
        $this->Password = $GLOBALS['phpmailer_smtppassword'];


add this:
      $this->Port = $GLOBALS['phpmailer_smtpport'];


That way the port is set by proper class methods, rather than hard-coding the class definition.
----------------
Source: http://forums.phplist.com/viewtopic.php?p=39911#39911

Note: I'll change the FAQ and include a link to this report.

user1822

18-12-07 19:03

  ~0038516

Needs to be hacked in the phpmailer class. See below.

Referenced from http://docs.phplist.com/PhplistFAQ