delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/07/01/18:17:35

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-0.3 required=5.0 tests=AWL,BAYES_50,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,T_RP_MATCHES_RCVD
X-Spam-Check-By: sourceware.org
Message-ID: <143303.88298.qm@web113520.mail.gq1.yahoo.com>
References: <666107 DOT 84266 DOT qm AT web113504 DOT mail DOT gq1 DOT yahoo DOT com> <4C2AB0BC DOT 9030306 AT laposte DOT net> <10197 DOT 83436 DOT qm AT web113515 DOT mail DOT gq1 DOT yahoo DOT com> <20100701200602 DOT GA28647 AT ateb DOT com>
Date: Thu, 1 Jul 2010 15:17:20 -0700 (PDT)
From: Refr Bruhl <refr_bruhl AT yahoo DOT com>
Subject: Re: Mail program
To: Cygwin Mail List <cygwin AT cygwin DOT com>
In-Reply-To: <20100701200602.GA28647@ateb.com>
MIME-Version: 1.0
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Note-from-DJ: This may be spam

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 AT laposte DOT net DOT 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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019