DESCRIPTION
Starting:Extremely simple MTA to get mail off the system to a Mailhub
ssmtp is a send-only sendmail emulator for machines which normally pick their mail
up from a centralized mailhub (via pop, imap, nfs mounts or other means). It pro-
vides the functionality required for humans and programs to send mail via the
standard or /usr/bin/mail user agents.
It accepts a mail stream on standard input with recipients specified on the com-
mand line and synchronously forwards the message to the mail transfer agent of a
mailhub for the mailhub MTA to process. Failed messages are placed in dead.letter
in the sender's home directory.
Config files allow one to specify the address to receive mail from root, daemon,
etc.; a default mailhub; a default domain to be used in From: lines; and per-user
From: addresses and mailhub names.
It does not attempt to provide all the functionality of sendmail: it is intended
for use where other programs are the primary means of at last mail delivery. It
is usefull with pop/imap, or to simulate the Sun shared mail spool option for non-
Sun machines, for machines whose sendmails are too difficult (or various) to con-
figure, for machines with known disfeatures in their sendmails or for ones where
there are ``mysterious problems''.
It does not do aliasing, which must be done either in the user agent or on the
mailhub. Nor does it honor .forwards, which have to be done on the recieving host.
It especially does not deliver to pipelines.
Code: Select all
# emerge ssmtp
# cd /etc/ssmtpCode: Select all
# nano /etc/passwdCode: Select all
root:x:0:0:root:/root:/bin/bashCode: Select all
root:x:0:0:admin:/root:/bin/bashCode: Select all
# usermod -c 'admin' rootIn the following example i will be using rogers.com info to demonstrate how to setup ssmpt
Now lets edit ssmtp.conf.
Code: Select all
# nano /etc/ssmtp.confCode: Select all
# /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=<root@email.address>
# 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.
# This should be your remote smtp email server info
mailhub=smtp.broadband.rogers.com
# 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
# For GMAIL users: mailhub=gmail.smtp.com:587
# Where will the mail seem to come from?
rewriteDomain=smtp.broadband.rogers.com
# The full hostname
# Gentoo bug #47562
# Commenting the following line will force ssmtp to figure
# out the hostname itself.
# hostname should be your remote email account
hostname=<username>@rogers.com
# auth user must be your remote email username
AuthUser=<username>
# AuthPass must be your remote email password
AuthPass=<password>
# 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
# With gmail you should use this option insted of the 'UseTLS=YES'
#UseSTARTTLS=YES
# Use SSL/TLS certificate to authenticate against smtp host.
#UseTLSCert=YES
# Use this RSA certificate.
#TLSCert=/etc/ssl/certs/ssmtp.pem
Code: Select all
# nano /etc/ssmtp/revaliasesCode: Select all
# 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.
# with the following example all emails sent from root; when recived
# will show in the from line: From: admin <gentoo@freethinker.net>
# in this case <gentoo> is the box name in /etc/conf.d/hostname
# and <freethinker.net> the domainame in /etc/resolve.conf
root:gentoo@freethinker.net:smtp.broadband.rogers.com
# if a regular user sends an email without a costumized format then
# then the from line would show: From: john@smtp.broadband.rogers.com
# if you wish to have your own regular user sending emails with a better
# looking format like root has, then add something like this for each other user
jack:jack@freethinker.net:smtp.broadband.rogers.com
# what ever you put here <:jack@freethinker.net:> can be costumized
# by your own taste. For a regular user there is no need to change
# anything in /etc/passwd
Code: Select all
# mail -s "testing ssmtp" someguy@some-isp.com
- press enter and you can type whatever you wish as the message body
- press enter and then ctrl+D
- press enter again and the email should be sent
- check your remote mailboxFor more details $man ssmtp
sSMTP moves to bssmtp
http://larve.net/people/hugo/2001/02/ssmtp/
update 14/04/2012
http://nixbits.net/wiki/Ssmtp and gmail





