2 ################################################################################
5 # Revision: $Revision: 1.2 $
6 # Description: This script sets up ssmtp mail configuration
7 # Author: Andrew@DeFaria.com
8 # Created: Wed Jan 9 12:57:13 2002
9 # Modified: $Date: 2010/06/08 15:03:27 $
12 # (c) Copyright 2002, ClearSCM, Inc., all rights reserved
14 ################################################################################
15 # Setup /etc/ssmtp config directory
24 echo "$me: <mail_server> <domain>"
26 if [ ! -z "$msg" ]; then
33 if [ -z "$mail_server" ]; then
34 usage "Mail_server not specified"
37 if [ -z "$domain" ]; then
38 usage "Domain not specified"
44 # Make some simple aliases. Alias $USER to the proper email address and then
45 # alias root, Administrator and postmaster to the user's address thus making
46 # the user "god" of smtp on this machine only.
47 cat > $ssmtp_dir/revaliases <<EOF
50 # Format: local_account:outgoing_address:mailhub
52 # Example: root:your_login@your.domain:mailhub.your.domain:[port]
53 # where [port] is an optional port number that defaults to 25.
54 $USER:$USER@$domain:$mail_server:25
55 root:$USER@$domain:$mail_server:25
56 Administrator:$USER@$domain:$mail_server:25
57 postmaster:$USER@$domain:$mail_server:25
60 # Get a downshifted hostname
61 hostname=$(hostname | tr '[:upper:]' '[:lower:]')
64 cat > $ssmtp_dir/ssmtp.conf <<EOF
65 # ssmtp.conf: Config file for Cygwin's sstmp sendmail
67 # The person who gets all mail for userids < 10
69 # The place where the mail goes. The actual machine name is required
70 # no MX records are consulted. Commonly mailhosts are named mail.domain.com
71 # The example will fit if you are in domain.com and you mailhub is so named.
73 # Where will the mail seem to come from?
74 #rewriteDomain=$USER.$domain
76 hostname=$hostname.$domain
77 # Set this to never rewrite the "From:" line (unless not given) and to
78 # use that address in the "from line" of the envelope.