DropHit DropHit - 3 months ago 13
PHP Question

Netwinsite SurgeMail does not allow PHP mail() and/or sendmail commands

Why after installing SurgeMail mail server on an Ubuntu 14.04 box (and likely other Linux flavors) does the sendmail and/or PHP mail NOT work as expected?

From the command line -

echo "Subject: sendmail test" | sendmail -v youremail@email.com


Should result in an outbound email as the Surgemail docs state:


SurgeMail replaces the sendmail binary with a sendmail stub, this
basically pretends to be sendmail and redirects everything to
SurgeMail.


However the command line response indicates that sendmail is not working as expected.

Also - sendmail is not installed on this box and never has been :)

Answer Source

The reason for this is pretty simple. There was never a sendmail binary so SurgeMail does not work as expected.

To correct this create a file called sendmail_surge.ini in /etc on *nix or the windows directory on Windows.

In this file add the following setting -

host 127.0.0.1

Next go to the SurgeMail folder - /usr/local/surgemail and copy the sendmail binary into /usr/sbin

Now do a test - echo "Subject: sendmail test" | sendmail -v youremail@email.com and you should see a successful message in your inbox.