Mail-Mime install ?

also just noticed this in 'phpinfo'

is this compiled ‘–without-pear’ causing the problem I am having ?

No. That’s because pear has become a separate package, and isn’t built along-side PHP. This is normal and expected and has nothing to do with SELinux issues.

ok, thanks. so I guess I need to enable it in this case and set this up.

I’m learning.

all this just for Mail-Mime, must be a better way ;o)

have not done this yet.
when looking into enabling it gave me a warning and I had to reboot server.
I think i need to do this on a (local) test server first before attempting this.

having a local testserver is good policy though not waterproof (I learned the hard way)

I just don’t understand why requiring a class Mail_mime is all this difficult. I must be missing something :o)

I’m currently going to try and create a script myself, it just needs the mime stuff in the right place (have basic html working but not an image or attachment), then I’ll try and get the class sorted.

I just don't understand why requiring a class Mail_mime is all this difficult.

I don’t understand what is difficult. What problem are you having? I thought you’d gotten it installed successfully earlier?

yep, what you did got mail_mime installed eaily :o)

however, when you try and call the script you get these selinux security errors, so that needs to be enabled somehow. I was concerned when I tried to set up that I might do something to prevent access to my server, and so I think I need to try this on a local server, which I hope to do this week sometime.

my comment was directed at mail_mime, in that why does it not just install some scripts onto the server instead of having so many other things needing set up

however, when you try and call the script you get these selinux security errors, so that needs to be enabled somehow.

As Eric and I mentioned earlier…just disabling SELinux is probably the simplest solution. We disable it by default when you install Virtualmin with install.sh.

You can do that with:

setenforce 0

It can be quite challenging to get a policy that works smoothly in a virtual hosting environment. The existing policies just don’t really fit very comfortably into a multi-user hosting environment.

ok, I mis-undertsood.

I thought when you said that you had disabled it then I had to enable it.

I have done ‘setenforce 0’

error appears to have gone now, but a class error now occurs.

[Wed Apr 15 10:48:05 2009] [warn] mod_fcgid: stderr: PHP Warning: include(Mail.php) [<a href=‘function.include’>function.include</a>]: failed to open stream: No such file or directory in /home/fife/public_html/mail_test.php on line 10
[Wed Apr 15 10:48:05 2009] [warn] mod_fcgid: stderr: PHP Warning: include() [<a href=‘function.include’>function.include</a>]: Failed opening ‘Mail.php’ for inclusion (include_path=’.:/usr/share/pear:/usr/share/php’) in /home/fife/public_html/mail_test.php on line 10
[Wed Apr 15 10:48:05 2009] [warn] mod_fcgid: stderr: PHP Fatal error: Class ‘Mail’ not found in /home/fife/public_html/mail_test.php on line 32

I did notice that after installing the class then that there was no file ("Mail.php") as used by the example from PEAR.

<?
include(‘Mail.php’);
include(‘Mail/mime.php’);

I see the ‘mime.php’ file loaded in the pear folder, but no Mail.php.

Mime_Mail doesn’t provide Mail.php, and isn’t supposed to. I see Mail.php in the php-pear-Mail package. So install that, and this error will go away.

Oh, and I’m talking about an RPM, so you can install it with yum:

yum install php-pear-Mail

Joe, thanks once again, for your invaluable help.

anyway, as I said earlier sending mail should be easy :o)
and I have found out why I was having a problem before.
I could not get images to work in html emails (just manually building a message and headers for use in ‘mail’, hence why I wanted to use Pear package mail_mime)
I went back last night to first principles and used my new server for the test. and mysteriously the html emails worked fine. wow !

what I did find is that when I tried to use images on www.happygolf.co.uk they did not work in the email, very strange indeed. I thought it was maybe something to do with leech settings, but don’t think so. so now I can get on with this customer and finish setting up wonderfull looking emails ;o)

should I just do a "rpm -U" on this package ?

I notice reference to modifying in yum.repos.d and a section [vmbleed] but I think I should just install the package by itself.

mail_mime isn’t working, not sure how to solve this problem (yet)

SELinux is preventing php-cgi (httpd_suexec_t) "accept" to
/var/run/mod_fcgid/12738.0 (httpd_t).

host=domain.com type=AVC msg=audit(1239621399.546:104871): avc: denied { accept } for pid=12752 comm="php-cgi" path="/var/run/mod_fcgid/12738.0" scontext=root:system_r:httpd_suexec_t:s0 tcontext=root:system_r:httpd_t:s0 tclass=unix_stream_socket

mail_mime isn’t working, not sure how to solve this problem (yet)

SELinux is preventing php-cgi (httpd_suexec_t) "accept" to
/var/run/mod_fcgid/12738.0 (httpd_t).

host=domain.com type=AVC msg=audit(1239621399.546:104871): avc: denied { accept } for pid=12752 comm="php-cgi" path="/var/run/mod_fcgid/12738.0" scontext=root:system_r:httpd_suexec_t:s0 tcontext=root:system_r:httpd_t:s0 tclass=unix_stream_socket