Results 1 to 9 of 9

Thread: Postfix and PHP

  1. #1
    Join Date
    Dec 2004
    Posts
    67

    Postfix and PHP

    I'm having trouble getting my PHP install to send e-mails. I'm on CentOS 4.1, I have the current postfix rpm (from yum) installed, and my own apache/php install (from source) - I didn't see any need to configure postfix when I installed PHP, so I don't think the fact that I installed from source has anything to do with this.

    Anyways, all I want/need right now is to be able to send emails out to other addresses, like [email protected], etc... I could care less what happens to incoming email at the moment. I have postfix running, and in my php.ini:

    As shown, the default should be fine / typical... right?

    I don't get any errors on the browser end when I try to send an email, I just get a plain white page... anyone know where to begin to troubleshoot this?

  2. #2
    Join Date
    May 2001
    Location
    Dayton, Ohio
    Posts
    4,962
    -Mat Sumpter
    Director, Product Engagement
    Penton Media

  3. #3
    Join Date
    Dec 2004
    Posts
    67
    I've already tried it with that path (and it is the correct path) hardcoded.

    Yes, I compiled PHP by hand, with:

    Code:
    ./configure --with-apxs2=/usr/local/apache2/bin/apxs \
    --with-openssl --with-zlib --with-bz2 --enable-ftp \
    --enable-magic-quotes --with-gd --with-jpeg=/usr/lib \
    --with-jpeg-dir=/usr/lib --with-png=/usr/lib --with-png-dir=/usr/lib  \
    --with-gettext --with-mime-magic --with-mysql=/usr/local/mysql \
    --with-mysqli --with-pgsql=/usr/local/postgresql \
    --enable-mbstring

  4. #4
    Join Date
    Mar 2003
    Location
    California USA
    Posts
    13,294
    does your phpinfo page have a sendmail path?
    Steven Ciaburri | Industry's Best Server Management - Rack911.com
    Software Auditing - 400+ Vulnerabilities Found - Quote @ https://www.RACK911Labs.com
    Fully Managed Dedicated Servers (Las Vegas, New York City, & Amsterdam) (AS62710)
    FreeBSD & Linux Server Management, Security Auditing, Server Optimization, PCI Compliance

  5. #5
    Join Date
    Dec 2004
    Posts
    67
    From php info page:
    Code:
    sendmail_from	no value	no value
    sendmail_path	/usr/sbin/sendmail -t -i	/usr/sbin/sendmail -t -i
    SMTP	localhost	localhost
    smtp_port	25	25

  6. #6
    Join Date
    Mar 2003
    Location
    California USA
    Posts
    13,294
    php is configured to send mail, i would look into your postfix configuration.
    Steven Ciaburri | Industry's Best Server Management - Rack911.com
    Software Auditing - 400+ Vulnerabilities Found - Quote @ https://www.RACK911Labs.com
    Fully Managed Dedicated Servers (Las Vegas, New York City, & Amsterdam) (AS62710)
    FreeBSD & Linux Server Management, Security Auditing, Server Optimization, PCI Compliance

  7. #7
    Join Date
    Jul 2004
    Location
    Reporting Live from Marrz
    Posts
    254
    I didn't see any need to configure postfix when I installed PHP
    Postfix is very safe, very powerful and very configurable. As you go along, you will notice that it does require a lot of learning and reading to be configured properly, and this will take time and effort.

    Tons of books and manuals are written about options you can see in master.cf and main.cf, and there is really an extensive literature lying around.

    I would suggest reading a lot on this - check your master.cf and main.cf and start configuring. Transport maps, access maps, my networks, restrictions... there is a lot to configure and a lot to learn/figure.

    I don't get any errors on the browser end when I try to send an email, I just get a plain white page... anyone know where to begin to troubleshoot this?
    Try tailing the log in shell:

    tail -f -n 50 /var/log/maillog

    while trying to send mail - see if there is anything in Postfix logs.

    Maybe start here:

    What do mynetworks, mydestination and inet_interfaces in your main.cf look like?

    inet_interfaces = localhost, $myhostname (or ip)
    mydestination = $myhostname, localhost.$mydomain, localhost
    mynetworks = your.shared.ip.for-vhosts, 127.0.0.0/8

    Note: I have pasted examplatory values as I presumed would work for you - we have a different config there.

    My apologies if my post is too long, but there are several ways to do something in Postfix, and I love it so much I may have gotten carried away a bit

  8. #8
    Join Date
    Dec 2004
    Posts
    67
    I get nothing in my maillog when I try to send an e-mail using PHP.

    I have the basic settings you mention in main.cf setup... I'm lost here... all I want to do is send e-mail for now.

  9. #9
    Join Date
    Jul 2004
    Location
    Reporting Live from Marrz
    Posts
    254
    Do a

    ls -al /usr/sbin/sendmail

    Is sendmail a link to /etc/alternatives/mta?

    And when you do a

    ls -al /etc/alternatives/mta

    is it a link to

    /usr/sbin/sendmail.postfix ?

    What is your SELinux status? Enabled, warn, disabled?

    See here, check if this is the case:

    https://www.redhat.com/archives/fedo.../msg02283.html

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •