info-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Setting up Email Notification


From: Bill
Subject: RE: Setting up Email Notification
Date: Tue, 17 Sep 2002 15:56:49 -0400

Which OS is the server running?

My server is Windows 2000 professional.  I use the cygwin tools for all my
scripting. http://www.cygwin.com/

They have an ssmtp client which I use for mail.  I wrap it in the following
mail bash script:
#!/bin/bash


from="address@hidden"

from="$USERNAME"
subject="mail test"
html=""
test=""
send_mail()
{
        typeset line
        printf "To: $to_list\n"
        printf "From: $from\n"
        printf "Subject: $subject\n"
        if test "$html" != ""
        then
                printf "Content-type: text/html;\n\n"
                printf "<html>\n<body>\n\n"
        else
                printf "\n"
        fi
        cat
        if test "$html" != ""
        then
                printf "\n</body>\n</html>\n"
        fi
        return
        while read line
        do
                if test "$line" = "."
                then
                        return
                else
                        printf "$line\n"
                fi
        done
}
#set -x
while test "${1:0:1}" = "-"
do
        case "$1"  in
        "-s" )
                subject="$2"
                shift
                shift ;;
        "-f" )
                from="$2"
                shift
                shift ;;
        "-html" )
                html=1
                shift ;;
        "-test" )
                test=1
                shift ;;
        esac
done

if test "$*" = ""
then
        echo "usage: $0 [ -s subjectline ] [ -s sender ] [ -html ] [ -test ]
recipient [ recipient . . . ]  "
        exit
fi
to_list="$*"

if test "$test" != ""
then
        #send_mail | sed 's/\n/\r\n/g' | tee | /usr/sbin/ssmtp $to_list
        send_mail | sed 's/\n/\r\n/g'
else
        send_mail | sed 's/\n/\r\n/g' | /usr/sbin/ssmtp $to_list
fi
###########################################
This script can be used
echo "the include file changed" | mail -s "Include File Change Notice"
address@hidden

I usually take the to-list from the contents of CVSROOT/writers.

ssmtp requires a config file  /etc/ssmtp/ssmtp.conf to be set up to point to
your smtp server.


Bill

-----Original Message-----
From: address@hidden [mailto:address@hidden Behalf Of
Riechers, Matthew W
Sent: Monday, September 16, 2002 09:05
To: 'the_witchman'
Cc: address@hidden
Subject: RE: Setting up Email Notification



> From: the_witchman [mailto:address@hidden
>
> Has anyone successfully set up email notification on a CVS server that
> doesn't have a mail server?

You could probably send messages via command-line email client (assuming it
had access to a mail server).

-Matt


_______________________________________________
Info-cvs mailing list
address@hidden
http://mail.gnu.org/mailman/listinfo/info-cvs





reply via email to

[Prev in Thread] Current Thread [Next in Thread]