Bug 878615

Summary: inclusion of phpmailer fails
Product: [Fedora] Fedora Reporter: Harald Reindl <h.reindl>
Component: mantisAssignee: Gianluca Sforna <giallu>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 17CC: giallu, sven
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-11-20 23:55:28 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Harald Reindl 2012-11-20 19:05:59 UTC
Nov 20 18:07:18 localhost httpd: PHP Fatal error:  require_once() [<a href='http://at.php.net/manual/de/function.require.php'>function.require.php</a>]: Failed opening required 'PHPMailer/class.phpmailer.php' (include_path='/usr/share/mantis/core/:/usr/share/mantis/library:.:/usr/share/pear:/usr/share/php') in /usr/share/mantis/core/email_api.php on line 56

Description of problem:
php-PHPMailer-5.2.1-1.fc17.noarch installs to "/usr/share/php/PHPMailer/class.phpmailer.php", /usr/share/php is in the include_path - so i do not understand why this include fails

Version-Release number of selected component (if applicable)
mantis-1.2.12-1.fc17.noarch 

this update is short ago and as far as i remember mantis works on this amchine since years and a lot of upgrades without any problem

How reproducible:
everytime mantis tries to send a mail

# Select the method to mail by: 0 - mail(),
# 1 - sendmail 
# 2 - SMTP. Default is 0.
$g_phpMailer_method = 2;

Comment 1 Gianluca Sforna 2012-11-20 21:26:08 UTC
So I guess you installed the rpm from updates-testing? I built it few days ago to fix several security issues but did not notice the issue in my (short) tests.

Will investigate

Comment 2 Harald Reindl 2012-11-20 21:29:53 UTC
correct - i saw the impressive list of CVE's

mantis is not heavily used currently but server-security is defined by the weakest part, so i updated without real tests and tody i got notified by my regulary monitoring mailing php-errorlogs that something goes wrong

Comment 3 Gianluca Sforna 2012-11-20 23:46:41 UTC
I just double checked and I can definitely use phpmailer. More specifically, I configured it to use Gmail as SMTP like this:

$g_phpMailer_method     = PHPMAILER_METHOD_SMTP
$g_smtp_host            = 'smtp.gmail.com';
$g_smtp_username        = 'name';
$g_smtp_password        = 'pwd';
$g_smtp_port            = 587;
$g_smtp_connection_mode = 'tls';

and I was able to send emails.

Is there any other error message we can use to understand what's going on?

Comment 4 Harald Reindl 2012-11-20 23:51:04 UTC
not really
i do not understand at all what happens here

Failed opening required 'PHPMailer/class.phpmailer.php'
"include_path" contains "/usr/share/php"
so after 10 years php-development i would guess "/usr/share/php/PHPMailer/class.phpmailer.php" should be resloved with the relative include

well, the file exists and all parent folders have chmod 755
i am a little bit out of ideas

maybe i "fix" the include with a absolute path as workaround
with a large reminder to redo this after updates :-(

LANG=en; stat /usr/share/php/PHPMailer/class.phpmailer.php
  File: `/usr/share/php/PHPMailer/class.phpmailer.php'
  Size: 81767           Blocks: 160        IO Block: 4096   regular file
Device: 811h/2065d      Inode: 41582       Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2012-03-20 19:28:47.000000000 +0100
Modify: 2012-03-20 19:28:47.000000000 +0100
Change: 2012-10-17 20:29:58.861761097 +0200
 Birth: -

Comment 5 Harald Reindl 2012-11-20 23:52:38 UTC
errata: what about patching this path in the SPEC-file since it is supposed to work with the phpmailer-package of fedora where the path is 100% clear?

Comment 6 Gianluca Sforna 2012-11-20 23:54:19 UTC
Any SElinux Denials?

Comment 7 Harald Reindl 2012-11-20 23:55:28 UTC
sorry for the noise and you can call me an idiot :-(
php_admin_value open_basedir "/usr/share/mantis:/etc/mantis:/var/www/uploadtemp"

seems like today it sent the first time since years mails or tried to do so
strange - sorry again :-(

Comment 8 Gianluca Sforna 2012-11-21 08:05:19 UTC
No problems. Since it got only mild testing on my side, I was afraid I broken it.

So thank you for testing the package :)