Initial add of defaria.com
[clearscm.git] / defaria.com / Computers / code / adm / bin / setup_ssmtp
1 #!/bin/bash
2 ################################################################################
3 #
4 # File:         setup_ssmtp
5 # Description:  This script sets up ssmtp mail configuration
6 # Author:       Andrew@DeFaria.com
7 # Created:      Wed Jan  9 12:57:13  2002
8 # Language:     Bash Shell
9 # Modifications:<modifications>
10 #
11 # (c) Copyright 2002, Andrew@DeFaria.com, all rights reserved
12 #
13 ################################################################################
14 # Setup /etc/ssmtp config directory
15 ssmtp_dir=/etc/ssmtp
16
17 mkdir -p $ssmtp_dir
18 chmod 700 $ssmtp_dir
19
20 # Make some simple aliases. Alias $USER to the proper email address and then
21 # alias root, Administrator and postmaster to the user's address thus making
22 # the user "god" of smtp on this machine only.
23 cat > $ssmtp_dir/revaliases <<EOF
24 # sSMTP aliases
25
26 # Format:       local_account:outgoing_address:mailhub
27 #
28 # Example: root:your_login@your.domain:mailhub.your.domain:[port]
29 # where [port] is an optional port number that defaults to 25.
30 $USER:$USER@salira.com:sons-exch02.salira.com:25
31 root:$USER@salira.com:sons-exch02.salira.com:25
32 Administrator:$USER@salira.com:sons-exch02.salira.com:25
33 postmaster:$USER@salira.com:sons-exch02.salira.com:25
34 EOF
35
36 # Get a downshifted hostname
37 hostname=$(hostname | tr '[:upper:]' '[:lower:]')
38
39 # Make ssmtp.conf
40 cat > $ssmtp_dir/ssmtp.conf <<EOF
41 # ssmtp.conf: Config file for Cygwin's sstmp sendmail
42 #
43 # The person who gets all mail for userids < 10
44 root=postmaster
45 # The place where the mail goes. The actual machine name is required
46 # no MX records are consulted. Commonly mailhosts are named mail.domain.com
47 # The example will fit if you are in domain.com and you mailhub is so named.
48 mailhub=sons-exch02.salira.com
49 # Where will the mail seem to come from?
50 #rewriteDomain=$USER.salira.com
51 # The full hostname
52 hostname=$hostname.salira.com
53 # Set this to never rewrite the "From:" line (unless not given) and to
54 # use that address in the "from line" of the envelope.
55 #FromLineOverride=YES
56 EOF
57