Log in

View Full Version : disabling email sending


jsharper
06-28-2005, 06:31 PM
I'd like to disable the ability for my dev/test board instance to send out any email to avoid the possibility of an end user ever getting an email from the dev board (which causes nothing but confusion). I know I can delete the scheduled tasks that send most of it, but then I have to do that every time I copy the database from production to dev (which I've been doing a lot lately to keep dev current) and it still doesn't prevent emails from going out if someone posts to a thread that someone is subscribed to.

Is there somewhere quick and easy I can comment something out or otherwise modify some code to disable all email sending abilities? Note that I use the same instance of apache/php for the prod board, so I can't just deliberately break or misconfigure php's mail sending abilities or it will also break the prod board.

This is with vB 3.0.7

Thanks

tamarian
06-28-2005, 06:39 PM
In includes/mail.php

Find:
if ($minusf)
{
$this->success = @mail($toemail, $subject, $message, trim($headers), "-f $fromemail");
}
else
{
$this->success = @mail($toemail, $subject, $message, trim($headers));
}

Replace with this:
$this->success = 1;

And if you use SMTP, replace the entire content of function send in the same file with:

return true;

jsharper
06-28-2005, 06:48 PM
Thanks! I was grepping for something obvious like this but I apparently missed the includes directory.

While I was in there, I noticed a lot of (disabled) SMTP-sending code. Does anyone know if this code, in 3.0.7, is functional enough to use? Or is it untested with known problems? It looks like it would be pretty easy to enable it, but I don't want to do it if others have tried and found it to be buggy.

tamarian
06-28-2005, 07:07 PM
Thanks! I was grepping for something obvious like this but I apparently missed the includes directory.

While I was in there, I noticed a lot of (disabled) SMTP-sending code. Does anyone know if this code, in 3.0.7, is functional enough to use? Or is it untested with known problems? It looks like it would be pretty easy to enable it, but I don't want to do it if others have tried and found it to be buggy.

You can compare it with the 3.5 code, as it's enabled there. I've tested it in 3.5 and it works fine.

Marco van Herwaarden
06-28-2005, 08:23 PM
It is not really supported, but you can make it work by manually editing the files.