#!/bin/bash ################################################################################ # # File: $RCSfile; $ # Revision: $Revision: 1.2 $ # Description: This script sets up ssmtp mail configuration # Author: Andrew@DeFaria.com # Created: Wed Jan 9 12:57:13 2002 # Modified: $Date: 2010/06/08 15:03:27 $ # Language: Bash # # (c) Copyright 2002, ClearSCM, Inc., all rights reserved # ################################################################################ # Setup /etc/ssmtp config directory ssmtp_dir=/etc/ssmtp domain=$1 mail_server=$2 me=$(basename $0) function usage { msg="$1" echo "$me: " if [ ! -z "$msg" ]; then echo $msg fi exit 1 } # usage if [ -z "$mail_server" ]; then usage "Mail_server not specified" fi if [ -z "$domain" ]; then usage "Domain not specified" fi mkdir -p $ssmtp_dir chmod 700 $ssmtp_dir # Make some simple aliases. Alias $USER to the proper email address and then # alias root, Administrator and postmaster to the user's address thus making # the user "god" of smtp on this machine only. cat > $ssmtp_dir/revaliases < $ssmtp_dir/ssmtp.conf <