Emailing from Redhat server

BASE-user
Jay Norf
2010-03-04
2013-06-03
  • Jay Norf

    Jay Norf - 2010-03-04

    After setting up BASE on a Redhat 5 server, we had problems sending snort logs via email from its interface (Checked the obvious, php.ini, etc). Neither Base, nor any of our other logs reported any errors. After doing some digging in the code, was able to come up with a quick fix, and swapping out the following code solved our problem.

    File name: include/base_action.inc.php
    Line numb: 813

    Replaced this:

     if ( !send_email($smtp_host, $smtp_auth, $smtp_user, $smtp_pw, $mail_recip, $hdrs, $body, $smtp_localhost) )
    

    With this:

     if ( !mail($mail_recip, $action_email_subject, $body) )
    

    I think our problem had to deal with Mail::factory in the send_email() function within the same file, but debugging source code is above my pay-grade. Anyway, this wasn't meant as a bug report (Maybe under Redhat server), but only as a quick hack for others in the IS or IA fields who have run across the same issue.

    • We have tons of sensors with customized rules across our networks, and as a centralized interface, BASE is Awesome!
     
  • Jay Norf

    Jay Norf - 2010-03-08

    Just as a follow up:

    After implementing the above fix, I started receiving the following errors in httpd/error_log

    Failed opening 'Mail/mime.php' for inclusion (include_path='.:/usr/share/pear/PEAR') in /var/www/base/includes/base_action.inc.php on line 30

    After running the following, then un-commenting the original line of code, and restarting apache, everything worked fine.

    cd /usr/share/pear/bin
    ./pear install Mail
    ./pear install Net_SMTP
    ./pear install Mail_mime

    Though I'm still miffed over not receiving errors when trying to send email originally, this at least fixed our original problem.

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks