On 2020-10-24 22:37, Brian Inglis wrote: > On 2020-10-24 17:50, Jon Turney wrote: >> On 25/10/2020 00:19, Brian Inglis wrote: >>> On 2020-10-24 16:21, Brian Inglis wrote: >>>> On 2020-10-24 15:42, Ken Brown via Cygwin-apps wrote: >>>>> On 10/24/2020 4:53 PM, Brian Inglis wrote: >>>>>> Do any/some/many of you use cygport ...cygport announce to generate your >>>>>> update >>>>>> announcements, and does it work successfully? >>>>> >>>>> I use it. You have to set several SMTP_* variables in your >>>>> ~/.cygport.conf. If >>>>> you don't already have that file, copy /etc/cygport.conf to >>>>> ~/.cygport.conf and >>>>> edit it. >>>> >>>> Thanks, already set up with SMTP_SERVER=smtp which is all I need from my >>>> home >>>> ISP connection for all SMTP clients (POP3, web, mobile needs user and >>>> password). >>>> Nothing else is required (yet)! >>> >>> Hacked out the perl code into a file and got it running and failing. >>> Added Net:SMTP() Debug parameter and set it. >>> Problem is ISP SMTP MX will not accept localhost.localdomain as EHLO/HELO >>> maildomain! >> >> Whatever you are doing it spamming cygwin-announce with messages which are >> (fortunately) being held due to 'Message has implicit destination'. >> >> I rejected all the held mails, but please stop. > > Sorry about that; trying to diagnose, debug, and fix failures and content > issues > with cygport ... announce; hacking without any real background knowledge of > SMTP, Perl, or cygport; still trying to track down issues with generated > message > content: sorry about those that made it thru; I'll do my best to ensure future > tests are directed elsewhere.
After hours of testing, nailed down cygport ... announce SMTP issues. ISP requires non-default Net::SMTP Hello parameter - localhost.localdomain is rejected - and does not allow or recognize first initial header "From " line! So we need to drop the first initial header "From " line, and pass the Hello parameter with a non-default mail domain value. Suitable mail domain values available are provided by the Net::Domain hostdomain, hostfqdn, domainname functions, or the From address domain: the attached patch uses the first and overrides with the last if available. -- Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada This email may be disturbing to some readers as it contains too much technical detail. Reader discretion is advised. [Data in binary units and prefixes, physical quantities in SI.]
cygport-lib-pkg_upload.cygpart(__pkg_announce): use non-default Hello string update copyright year (__pkg_upload): source package includes -src.hint (__pkg_announce): drop first From header as it gets treated as data; quote addresses in <>; add Reply-To: <cygwin@\...> header; override Net:SMTP default Hello string localhost.localdomain with ISP/org host domain; could optionally be FQDN or just domain name; override with From: address domain if available; add Net::SMTP Hello parameter and value; add extra failure diagnostic output; add Cc and Bcc recipients if headers added --- a/pkg_upload.cygpart 2019-03-04 19:28:36.593859100 -0700 +++ b/pkg_upload.cygpart 2020-10-25 01:13:35.236753400 -0600 @@ -2,8 +2,8 @@ # # pkg_upload.cygpart - cygport package uploading functions # -# Copyright (C) 2014-2019 Yaakov Selkowitz, Andrew Schulman -# Provided by the Cygwin Ports project <http://sourceware.org/cygwinports/> +# Copyright (C) 2014-2020 Cygport authors +# Provided by the Cygwin project <https://cygwin.com/> # # cygport is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -81,7 +81,7 @@ __pkg_upload() { # Check that binary and source package files exist - pkg_files=("${NAME}/${NAME}-${PVR}-src.tar.xz" "${NAME}/${NAME}-${PVR}.hint") + pkg_files=("${NAME}/${NAME}-${PVR}-src.tar.xz" "${NAME}/${NAME}-${PVR}-src.hint") while (( n < pkg_count )) do @@ -173,10 +173,11 @@ __pkg_announce() { local msgat=$(date +@%s) local -i n=0 +#From cygwin-announce-${PF} $(date '+%a %b %d %H:%M:%S %Y' --date=${msgat}) cat > ${msg} <<_EOF -From cygwin-announce-${PF} $(date '+%a %b %d %H:%M:%S %Y' --date=${msgat}) From: ${SMTP_SENDER} -To: [email protected] +To: <[email protected]> +Reply-To: <[email protected]> Date: $(date -R --date=${msgat}) Message-Id: <$(date "+%Y%m%d%H%M%S.$$" --date=${msgat})-1-$(echo ${SMTP_SENDER} | sed 's|.*<\(.*\)>.*|\1|')> Subject: ${NAME} ${PVR} @@ -202,6 +203,7 @@ _EOF use strict; use MIME::Parser; use Net::SMTP; +use Net::Domain qw(hostdomain hostfqdn domainname); my \$smtp_server = "${SMTP_SERVER:-localhost}"; my \$smtp_encryption = "${SMTP_ENCRYPTION:-none}"; @@ -214,10 +216,13 @@ my \$entity = \$parser->parse_open("$msg print "Sending announcement of ${NAME}-${PVR} via \$smtp_server\n"; +my \$hello = hostdomain(); # hostfqdn(); domainname(); +\$hello = \$1 if (\$entity->head->get('From') =~ m/<?[^@>]+@([^>]+)>?/); my \$smtp = new Net::SMTP(\$smtp_server, ${SMTP_SERVER_PORT+Port => ${SMTP_SERVER_PORT},} + Hello => \$hello, SSL => \$smtp_encryption eq 'ssl') - or die "No mailserver at ".\$smtp_server; + or die "No mailserver at ".\$smtp_server.":".\$@; if (\$smtp_encryption eq 'tls') { require Net::SMTP::SSL; \$smtp->command('STARTTLS'); @@ -233,6 +238,8 @@ if (defined \$smtp_user) { } \$smtp->mail(\$entity->head->get('From')) or die "unable to set sender"; \$smtp->to(\$entity->head->get('To')) or die "unable to address message"; +\$smtp->cc(\$entity->head->get('Cc')) if \$entity->head->get('Cc'); +\$smtp->bcc(\$entity->head->get('Bcc')) if \$entity->head->get('Bcc'); \$smtp->data() or die "unable to start data send"; \$smtp->datasend(\$entity->as_string()) or die "Message send failed"; \$smtp->dataend() or die "Message end failed";
