By default in the general options vBulletin allows the use of a SMTP server to send emails, this is really useful in a chroot environment for example if you do not want to import the sendmail binary, but if a database error occurs, vBulletin sends theses notification only with the Sendmail bin so follow these few steps to patch vBulletin for sending theses db errors notification using your local postfix for example:
Open class_core.php and find
PHP Code:
@mail($technicalemail, $this->appshortname . ' Database Error!', preg_replace("#(\r\n|\r|\n)#s", (@ini_get('sendmail_path') === '') ? "\r\n" : "\n", $message), "From: $technicalemail");
replace to:
PHP Code:
require_once(DIR . '/includes/class_mail2.php');
$mail =& new vB_SmtpMail($vbulletin);
$mail->start($technicalemail, "Database Error!", $message, $technicalemail);
$mail->send();
// @mail($technicalemail, $this->appshortname . ' Database Error!', preg_replace("#(\r\n|\r|\n)#s", (@ini_get('sendmail_path') === '') ? "\r\n" : "\n", $message), "From: $technicalemail");
Now copy the content of class_mail.php to class_mail2.php, open it and find:
PHP Code:
define('MAIL_INCLUDED', true)
add below:
PHP Code:
require_once(DIR . '/includes/functions.php');
Now find:
PHP Code:
($hook = vBulletinHook::fetch_hook('mail_send')) ? eval($hook) : false;
and comment it like that:
PHP Code:
//($hook = vBulletinHook::fetch_hook('mail_send')) ? eval($hook) : false;
and finally find:
PHP Code:
$this->smtpHost = (!empty($this->registry->options['smtp_tls']) ? 'tls://' : '') . $this->registry->options['smtp_host'];
replace it to:
PHP Code:
$this->smtpHost = (!empty($this->registry->options['smtp_tls']) ? 'tls://' : '0.0.0.0') . $this->registry->options['smtp_host'];
Database errors are now sent using your local SMTP server, assuming you have it running on localhost:25 without authentication.
Submitted a support bug for this issue to Jelsoft, they confirmed the glitch however I don't know if this is planned to change soon so a reminder isn't useless.
Have fun!