nano /etc/ssmtp/ssmtp.conf #
# Config file for sSMTP sendmail
#
# The person who gets all mail for userids < 1000
# Make this empty to disable rewriting.
#root=postmaster
root=emailuser@remotemail.ir
# The place where the mail goes. The actual machine name is required no
# MX records are consulted. Commonly mailhosts are named mail.domain.com
mailhub=mail.remotemail.ir
# Where will the mail seem to come from?
#rewriteDomain=
# The full hostname
hostname=remotemail.ir
# Are users allowed to set their own From: address?
# YES - Allow the user to specify their own From: address
# NO - Use the system generated From: address
#FromLineOverride=YES
به دوحالت می توان کاری کرد که ایمیل ها به جای ارسال از
www-data
از فرستنده مورد نظر ارسال شود
روش اول:
nano /etc/aliases
www-data:journals
روش دوم:
nano /etc/ssmtp/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.
www-data:useremail@remotemail.ir:mail.remotemail.ir:25
nano /etc/php5/apache2/php.ini
sendmail_path = /usr/sbin/ssmtp -t
بررسی آخرین ایمیل های ارسال
tail /var/log/syslog -n 100 |grep sSMTP
sSMTP has debug logging built in. In your ssmtp.conf file, include the following line: Debug=YES
When debug logging is active, the entire contents of emails sent via sSMTP, including headers, is logged to syslog.