This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Mail program
- From: Refr Bruhl <refr_bruhl at yahoo dot com>
- To: Cygwin Mail List <cygwin at cygwin dot com>
- Date: Thu, 1 Jul 2010 15:17:20 -0700 (PDT)
- Subject: Re: Mail program
- References: <666107.84266.qm@web113504.mail.gq1.yahoo.com> <4C2AB0BC.9030306@laposte.net> <10197.83436.qm@web113515.mail.gq1.yahoo.com> <20100701200602.GA28647@ateb.com>
Team
I found a resolution to my email problem.
I had to reinstall ssmtp
I discovered where I work was blocking port 25. This was removed for me
I had to configure a basic ssmtp.conf file in /etc/ssmtp
Durng the course of the compiling issues for mailutils (( see the libtools thread )) Cyrille Lefevre made a mailx script included below that plugs into sendmail or ssmtp.
I am happy to report this script works well in cygwin and aix 6.1 environments
Thanks to all who helped with this issue
sample ssmtp.conf file
# cat /etc/ssmtp/ssmtp.conf
#
# /etc/ssmtp.conf -- a config file for sSMTP sendmail.
#
# The person who gets all mail for userids < 1000
root=postmaster
# The place where the mail goes. The actual machine name is required
# no MX records are consulted. Commonly mailhosts are named mail.domain.com
# The example will fit if you are in domain.com and you mailhub is so named.
mailhub=your.mail.host.fully.qualified.name.com
# Where will the mail seem to come from?
#rewriteDomain=localhost.localdomain
# The full hostname
hostname=your.pc.fully.qualified.name.com
mailx script posted with permission
#!/usr/bin/ksh#
#!ident @(#) mailx.sh 1.1 (Cyrille.Lefevre-lists%nospam@laposte.net.invalid) Wed Jun 30 22:35:24 2010
# supprimer "%nospam" et ".invalid" pour me repondre.
# remove "%nospam" and ".invalid" to answer me.
#
# Copyright (c) 2010 Cyrille Lefevre. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# 3. The name of the authors and contributors may not be used to
# endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS''
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
# PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS
# OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
usage () {
echo 'usage: mailx [-dv] [-F name] [-r from] [-s subject]
<-t | [-b bcc] [-c cc] [to...]> at least one of -t, -b, -c or to... must be specified.' >&2
exit $1
}
# sendmail='/usr/sbin/sendmail'
sendmail='/usr/sbin/ssmtp'
bcc= bccsep='BCC: '
cc= ccsep='CC: '
name= namesep='-F '
from= fromsep='-f '
subject='(no subject)' subjectsep='Subject: '
debug= toopt= verbose=
undisclosed='undisclosed-recipients:;'
while getopts 'b:c:dF:hr:s:tv' c; do
case ${c} in
'b') bcc="${bcc}${bccsep}${OPTARG}"; bccsep=',' ;;
'c') cc="${cc}${ccsep}${OPTARG}"; ccsep=',' ;;
'd') debug='-d' ;;
'F') name="${namesep}'${OPTARG}'" ;;
'h') usage 0 ;;
'r') from="${fromsep}'${OPTARG}'" ;;
's') subject="${OPTARG}" ;;
't') toopt='-t' ;;
'v') verbose='-v' ;;
*) usage 1 ;;
esac
done
shift $(($OPTIND-1))
nl='
'
toarg= to= tosep=
if [[ -n ${toopt} ]]; then
cc= bcc=
else
if [[ $# = 0 ]]; then
if [[ -n ${cc}${bcc} ]]; then
set -- "${undisclosed}"
else
usage 1
fi
else
for arg; do toarg="${toarg}${tosep}'${arg}'"; tosep=' '; done
fi
tosep='To: '
for arg; do to="${to}${tosep}${arg}"; tosep=','; done
[[ -n ${to} ]] && to="${to}${nl}"
[[ -n ${cc} ]] && cc="${cc}${nl}"
[[ -n ${bcc} ]] && bcc="${bcc}${nl}"
fi
[[ -n ${subject} ]] && subject="${subjectsep}${subject}${nl}"
read -r line
nl1="${nl}"
nl2=
case ${line} in
*':'*)
case ${line%%:*} in
*' '*)
;;
*)
nl1= nl2="${nl}"
;;
esac
;;
'')
nl1= nl2=
;;
esac
if [[ -n ${debug} ]]; then
sendmail=sendmail
sendmail () { echo sendmail "$@"; cat; } fi eval ${sendmail} ${toopt} ${verbose} ${name} ${from} ${toarg} << EOF
${subject}${to}${cc}${bcc}${nl1}${line}${nl2}$(cat)
EOF
#!eof
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple