php, apache, ssmtp not working

Hello folks,
I am trying desperately to get ssmtp to work but without much luck.

I followed a number of tutorials on the net. But still ssmtp refuses to forward emails with the php mail function. It does however do the daily and weekly FreeBSD reports.

Here's my system details....
uname -a
Code:
FreeBSD paranoia 10.3-RELEASE-p11 FreeBSD 10.3-RELEASE-p11 #0: Mon Oct 24 18:49:24 UTC 2016     [email]root@amd64-builder.daemonology.net[/email]:/usr/obj/usr/src/sys/GENERIC  amd64

My ssmtp.conf file (edited)
Code:
MailHub=mailhub.com:25
UseTLS=NO
Root=somebody@emailserver.com
UseSTARTTLS=NO

My ISP's SMTP server does not require authentication.

My php.ini sendmail entry.....
Code:
; For Unix only.  You may supply arguments as well (default: "sendmail -t -i").
; http://php.net/sendmail-path
sendmail_path = /usr/sbin/ssmtp -t

I suspect the above is the root of the problem but I could be wrong.

I have disabled sendmail at startup.

Any help would be much appreciated.

Peace,
Jonathan.
 
Last edited by a moderator:
sendmail_path = /usr/sbin/ssmtp -t
The only thing I can imagine is that the link to /usr/sbin/ssmtp does not exist. I have not tested it, but the real "binary" should be present as /usr/local/bin/ssmtp. whereis ssmtp should give the information.
 
...
My ISP's SMTP server does not require authentication.
...
For sure your ISP has some sort of authentication mechanism in place. It maybe IP based, or it may be the quite common POP before SMTP authentication scheme. In the latter case, you won't be able to pass emails by the way of your ISP using ssmtp. Usually ISP's offer different authentication choices in order to accommodate for all the different mail clients.

I would start troubleshooting by testing if you really could send out e-mails without authentication using telnet. There are several tutorials on how to do this in the internet, a quick Google search gave a lot of examples, and the following seems to be useful:

https://mediatemple.net/community/products/dv/204404584/sending-or-viewing-emails-using-telnet

Once you completed the manual test successfully, you would continue troubleshooting the ssmtp settings.
 
Well I had a look at whereis ssmtp, you were quite correct chrbr I had the wrong path for ssmtp. It should have been /usr/local/sbin/ssmtp not /usr/sbin/ssmtp. It did perform in the sense of the mail function returning true. But still failed to send the email.

I do not believe the authentication is an issue obsigna as the daily and weekly reports come through.

The instructions I followed were at https://pydio.com/en/docs/kb/plugins/setting-emailers and the two notable lines in the instructions are....
Code:
mv /usr/sbin/sendmail /usr/sbin/sendmail.org

ln -s /usr/local/sbin/ssmtp /usr/sbin/sendmail

If this is correct, shouldn't the sendmail entry in php.ini be.....
Code:
sendmail_path = /usr/sbin/sendmail -t

This does not work either. Still at a loss. Will try the telnet thing in a couple of hours o_O

Thank you so far for your help.

Peace,
Jonathan.
 
Okay, so the instructions are bad. Which would have to be true as it doesn't work. But could someone please tell me explicitly what the php.ini send mail option should be?

If nessecary I'll remove ssmtp and re-install it. There's so much conflicting information out there. :(
 
mine is set as follows in php.ini
Code:
sendmail_path = /usr/local/sbin/ssmtp -t -i

also make sure you have setup an ssmtp revaliases entry for the uid you are running apache/php server as , eg www . For me it didn't work until the revaliases entry was present
Code:
/usr/local/etc/ssmtp/revaliases
www:your_login@your.domain:mailhub.your.domain[:port]
 
Back
Top