Hello community,
my first post... after so much reading and time spending in this forum. First of all, I have to say, that I'm really a great fan of FreeBSD. Such a great and reliable system. I've tried some distribution, but no one was as fun, as FreeBSD. The freedom of the system is great and it's so easy to start with, in my eyes more simple than Linux, but I know it's just taste .
I've just installed and updated my RPI 3. Sadly, my backup broke and I couldn't restore my backup files. So I had to re-install freebsd to my Rasperry PI 3, this as far went very well.
Nearly no problems at all; my Website (Wordpress) works great, no problems, only one thing... I can't send E-Mail using PHP.
I've tried so many stuff and couldn't get it working; ssmtp works fine, if I use as my logged in User and as Root, but PHP/Wordpress can't send e-mail.
What am I doing wrong? I've even configured in php.ini the mail attributes:
ssmtp files:
ssmtp is kinda working, as said above, I can send mails using CLI; with no problems at all (and even receive then ), what am I doing wrong?
Sorry my for bad English, really, German is my native language .
thanks in advance for any help.
Greetings,
Sebastian
my first post... after so much reading and time spending in this forum. First of all, I have to say, that I'm really a great fan of FreeBSD. Such a great and reliable system. I've tried some distribution, but no one was as fun, as FreeBSD. The freedom of the system is great and it's so easy to start with, in my eyes more simple than Linux, but I know it's just taste .
I've just installed and updated my RPI 3. Sadly, my backup broke and I couldn't restore my backup files. So I had to re-install freebsd to my Rasperry PI 3, this as far went very well.
Nearly no problems at all; my Website (Wordpress) works great, no problems, only one thing... I can't send E-Mail using PHP.
I've tried so many stuff and couldn't get it working; ssmtp works fine, if I use as my logged in User and as Root, but PHP/Wordpress can't send e-mail.
What am I doing wrong? I've even configured in php.ini the mail attributes:
Code:
; For Win32 only.
; https://php.net/smtp
SMTP = localhost
; https://php.net/smtp-port
smtp_port = 25
; For Win32 only.
; https://php.net/sendmail-from
;sendmail_from = me@example.com
; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
; https://php.net/sendmail-path
#sendmail_path = /usr/local/sbin/ssmtp
#sendmail_path = /usr/local/sbin/ssmtp -t -i
#sendmail_path = /usr/local/sbin/ssmtp -t -i
sendmail_from = my-email@gmail.com
sendmail_path = /usr/local/sbin/ssmtp -i
; Force the addition of the specified parameters to be passed as extra parameters
; to the sendmail binary. These parameters will always replace the value of
; the 5th parameter to mail().
;mail.force_extra_parameters =
; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename
mail.add_x_header = Off
; The path to a log file that will log all mail() calls. Log entries include
; the full path of the script, line number, To address and headers.
;mail.log =
; Log mail to syslog (Event Log on Windows).
;mail.log = syslog
ssmtp files:
Code:
[rpi-3:local/etc/ssmtp] Sebastian% cat revaliases
# sSMTP aliases
#
# Format: local_account:outgoing_address:mailhub
#
# Example: root:your_login@your.domain:mailhub.your.domain[:port]
# where [:port] is an optional port number that defaults to 25.
root:mymail@gmail.com:smtp.gmail.com:587
www:mymail@gmail.com:smtp.gmail.com:587
ssmtp:mymail@gmail.com:smtp.gmail.com:587
Code:
[rpi-3:local/etc/ssmtp] Sebastian% cat ssmtp.conf
#
# /etc/ssmtp.conf -- a config file for sSMTP sendmail.
#
# The person who gets all mail for userids < 1000
# Make this empty to disable rewriting.
#root=postmaster
mymail@gmail.com
# The place where the mail goes. The actual machine name is required
# no MX records are consulted. Commonly mailhosts are named mail.domain.com
# The example will fit if you are in domain.com and your mailhub is so named.
#mailhub=mail
mailhub=smtp.gmail.com:587
# Example for SMTP port number 2525
# mailhub=mail.your.domain:2525
# Example for SMTP port number 25 (Standard/RFC)
# mailhub=mail.your.domain
# Example for SSL encrypted connection
# mailhub=mail.your.domain:465
# Where will the mail seem to come from?
#rewriteDomain=
rewriteDomain=gmail.com
# The full hostname
#hostname=_HOSTNAME_
hostname=localhost
# Set this to never rewrite the "From:" line (unless not given) and to
# use that address in the "from line" of the envelope.
FromLineOverride=YES
# Use SSL/TLS to send secure messages to server.
UseTLS=YES
# Use SSL/TLS certificate to authenticate against smtp host.
#UseTLSCert=YES
# Use this RSA certificate.
#TLSCert=/usr/local/etc/ssmtp/ssmtp.pem
# Get enhanced (*really* enhanced) debugging information in the logs
# If you want to have debugging of the config file parsing, move this option
# to the top of the config file and uncomment
#Debug=YES
# Use these parameters for securely authenticating against your
# mailhub; check ssmtp.conf(5) for further details.
UseSTARTTLS=YES
AuthUser=mymail@gmail.com
AuthPass=_mygoogleapppassword_
Code:
[rpi-3:/usr/local/etc] Sebastian% cat /etc/aliases
# $FreeBSD$
# @(#)aliases 5.3 (Berkeley) 5/24/90
#
# Aliases in this file will NOT be expanded in the header from
# Mail, but WILL be visible over networks.
#
# >>>>>>>>>> The program "newaliases" must be run after
# >> NOTE >> this file is updated for any changes to
# >>>>>>>>>> show through to sendmail.
#
#
# See also RFC 2142, `MAILBOX NAMES FOR COMMON SERVICES, ROLES
# AND FUNCTIONS', May 1997
# http://tools.ietf.org/html/rfc2142
# Pretty much everything else in this file points to "root", so
# you would do well in either reading root's mailbox or forwarding
# root's email from here.
root: mymail@gmail.com
# Basic system aliases -- these MUST be present
MAILER-DAEMON: root
postmaster: root
# General redirections for pseudo accounts
_dhcp: root
_pflogd: root
auditdistd: root
bin: root
bind: root
daemon: root
games: root
hast: root
kmem: root
mailnull: postmaster
man: root
news: root
nobody: root
operator: root
pop: root
proxy: root
smmsp: postmaster
sshd: root
system: root
toor: root
tty: root
usenet: news
uucp: root
# Well-known aliases -- these should be filled in!
# manager:
# dumper:
# BUSINESS-RELATED MAILBOX NAMES
# info:
# marketing:
# sales:
# support:
# NETWORK OPERATIONS MAILBOX NAMES
abuse: root
# noc: root
security: root
# SUPPORT MAILBOX NAMES FOR SPECIFIC INTERNET SERVICES
ftp: root
ftp-bugs: ftp
# hostmaster: root
# webmaster: root
www: root
# NOTE: /var/msgs and /var/msgs/bounds must be owned by sendmail's
# DefaultUser (defaults to mailnull) for the msgs alias to work.
#
# msgs: "| /usr/bin/msgs -s"
# bit-bucket: /dev/null
# dev-null: bit-bucket
ssmtp is kinda working, as said above, I can send mails using CLI; with no problems at all (and even receive then ), what am I doing wrong?
Sorry my for bad English, really, German is my native language .
thanks in advance for any help.
Greetings,
Sebastian