Added client work scripts
[clearscm.git] / clients / HP / 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 domain=${domain:-broadcom.com}
17 mail_server=smtphost
18
19 mkdir -p $ssmtp_dir
20 chmod 700 $ssmtp_dir
21
22 # Make some simple aliases. Alias $USER to the proper email address and then
23 # alias root, Administrator and postmaster to the user's address thus making
24 # the user "god" of smtp on this machine only.
25 cat > $ssmtp_dir/revaliases <<EOF
26 # sSMTP aliases
27
28 # Format:       local_account:outgoing_address:mailhub
29 #
30 # Example: root:your_login@your.domain:mailhub.your.domain:[port]
31 # where [port] is an optional port number that defaults to 25.
32 $USER:$USER@$domain:$mail_server:25
33 root:$USER@$domain:$mail_server:25
34 Administrator:$USER@$domain:$mail_server:25
35 postmaster:$USER@$domain:$mail_server:25
36 EOF
37
38 # Get a downshifted hostname
39 hostname=$(hostname | tr '[:upper:]' '[:lower:]')
40
41 # Make ssmtp.conf
42 cat > $ssmtp_dir/ssmtp.conf <<EOF
43 # ssmtp.conf: Config file for Cygwin's sstmp sendmail
44 #
45 # The person who gets all mail for userids < 10
46 root=postmaster
47 # The place where the mail goes. The actual machine name is required
48 # no MX records are consulted. Commonly mailhosts are named mail.domain.com
49 # The example will fit if you are in domain.com and you mailhub is so named.
50 mailhub=$mail_server
51 # Where will the mail seem to come from?
52 #rewriteDomain=$USER.$domain
53 # The full hostname
54 hostname=$hostname.$domain
55 # Set this to never rewrite the "From:" line (unless not given) and to
56 # use that address in the "from line" of the envelope.
57 #FromLineOverride=YES
58 EOF