X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-1.3 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SARE_FREE_WEBM_LAPOSTE,T_RP_MATCHES_RCVD,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Message-ID: <4C2AB0BC.9030306@laposte.net> Date: Wed, 30 Jun 2010 04:49:32 +0200 From: Cyrille Lefevre User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1.3) Gecko/20070326 Thunderbird/2.0.0.0 Mnenhy/0.7.5.666 MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: Mail program References: <666107 DOT 84266 DOT qm AT web113504 DOT mail DOT gq1 DOT yahoo DOT com> In-Reply-To: <666107.84266.qm@web113504.mail.gq1.yahoo.com> Content-Type: multipart/mixed; boundary="------------080001050303000408010904" X-me-spamlevel: not-spam X-me-spamrating: 38.400002 X-me-spamcause: OK, (-40)(0000)gggruggvucftvghtrhhoucdtuddrvdelhedrtdeiucetggdotefuucfrrhhofhhilhgvmecuoehnohhnvgeqnecuuegrihhlohhuthemuceftddtneculhhoghhinhculddqvddtmdenlhhoghhinhculddqvddtmd X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , 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 --------------080001050303000408010904 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Le 29/06/2010 14:24, Refr Bruhl a =E9crit : > > > Good Morning > > I am in need of of a mail program similar to the mail found in AIX. I am = emulating an AIX environment. > > I've installed the email, ssmtp and other email apps in the email. I get = a segmentation fault for email > > I like email as it seems to accept the same parameters and funcitonality = as the AIX mail app. I have a multitude of scripts that use the format: > > echo ${MESSAGE} | mail -s '${SUBJECT}' ${EMAIL} > > Where ${EMAIL} is a comma delimited list of addresses. > > I've compiled the mailutils from gnu but I get a different error there wh= ich I'll take up with the buildlist-mailutils AT gnu DOT org which error ? > Anyone got any ideas on how to get email to work without a segmentation f= ault? ah! this one ? do you know the origin ? > Where can I obtain the source for email? I've pretty much hit cygwin head= first and am not as familiar with it as I am with AIX. My apologies for th= e newbie questions. let's try ssmtp w/ /etc/ssmtp/ssmtp.conf configured like this : mailhub=3Dsmtp. FromLineOverride=3DYES hostname=3Dsmtp. rewriteDomain=3D root=3Dpostmaster AuthUser=3D AuthPass=3D AuthMethod=3DLOGIN and w/ /etc/ssmtp/revaliases : ::smtp. don't forget to run ssmtp-config alternative w/ msmtp and /etc/msmtprc : account host smtp. auth login password account : from user account : from user account default : don't forget to run msmtp-config yet another alternative w/ email : /usr/bin/email \ -r smtp. \ -m LOGIN \ -u \ -i \ -n "" \ -f \ ... then, for both ssmtp/msmtp, the attached script should work ! I left you the implementation of the -a (attachment) option :-) Regards, Cyrille Lefevre --=20 mailto:Cyrille DOT Lefevre-lists AT laposte DOT net --------------080001050303000408010904 Content-Type: text/plain; name="mailx" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="mailx" #!/usr/bin/ksh 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' 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 --------------080001050303000408010904 Content-Type: text/plain; charset=us-ascii -- 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 --------------080001050303000408010904--