From: Daniel F. Dickinson Date: Tue, 27 Aug 2019 05:53:51 +0000 (-0400) Subject: msmtp-scripts: Make conn_test default nc X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=3c15d410a9221d212193d386bcb2dbd9b723c62d;p=feed%2Fpackages.git msmtp-scripts: Make conn_test default nc On OpenWrt nc (netcat) connectivity test makes more sense than ping because a) for non-root users ping is not permitted, and b) nc is a default binary included with OpenWrt. We do, however, have to change the upstream default from using `nc -vz` to `printf ""|nc` (with openwrt nc if text is sent then nc closes after a response and fails if no connection is made; the response is already thrown away (to /dev/null) by the existing code). Signed-off-by: Daniel F. Dickinson --- diff --git a/mail/msmtp-scripts/Makefile b/mail/msmtp-scripts/Makefile index 42ed208edc..34242434e8 100644 --- a/mail/msmtp-scripts/Makefile +++ b/mail/msmtp-scripts/Makefile @@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=msmtp-scripts PKG_VERSION:=1.2.4 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://launchpad.net/$(PKG_NAME)/1.2/$(PKG_VERSION)/+download @@ -116,6 +116,7 @@ define Package/msmtpq-ng/install $(INSTALL_DATA) ./files/msmtpq-ng.rc $(1)/etc/msmtpq-ng.rc $(INSTALL_DIR) $(1)/usr/bin $(CP) $(PKG_BUILD_DIR)/src/usr/bin/msmtpq-ng $(1)/usr/bin/ + $(SED) "s,nc -vz,printf \"HEAD / HTTP/1.1\\\\r\\\\nHost: \$$$${EMAIL_CONN_TEST_SITE}\\\\r\\\\n\\\\r\\\\n\"|nc," $(1)/usr/bin/msmtpq-ng $(CP) $(PKG_BUILD_DIR)/src/usr/bin/msmtpq-ng-queue $(1)/usr/bin/ endef diff --git a/mail/msmtp-scripts/files/msmtpq-ng-mta.rc b/mail/msmtp-scripts/files/msmtpq-ng-mta.rc index f4637ff42e..bb1536adb9 100644 --- a/mail/msmtp-scripts/files/msmtpq-ng-mta.rc +++ b/mail/msmtp-scripts/files/msmtpq-ng-mta.rc @@ -14,9 +14,9 @@ #MSMTPQ_NG=msmtpq-ng #MSMTPQ_NG_QUEUE=msmtpq-ng-queue #MSMTP_CONF=/etc/msmtprc -#EMAIL_CONN_TEST=p -EMAIL_CONN_TEST_PING=openwrt.org +EMAIL_CONN_TEST=n +#EMAIL_CONN_TEST_PING=openwrt.org #EMAIL_CONN_TEST_IP=8.8.8.8 -#EMAIL_CONN_TEST_SITE=www.debian.org +EMAIL_CONN_TEST_SITE=openwrt.org #MSMTP_HOLD_SMTP_MAIL=true #MSMTP_HOLD_CLI_MAIL=false diff --git a/mail/msmtp-scripts/files/msmtpq-ng.rc b/mail/msmtp-scripts/files/msmtpq-ng.rc index 33d721c28b..ef8c0f051a 100644 --- a/mail/msmtp-scripts/files/msmtpq-ng.rc +++ b/mail/msmtp-scripts/files/msmtpq-ng.rc @@ -4,10 +4,10 @@ #LOG=~/log/.msmtp.queue.log #MAXLOGLEVEL=7 #MSMTP_LOCK_DIR=~/.msmtp.lock -EMAIL_CONN_TEST=p -EMAIL_CONN_TEST_PING=openwrt.org +EMAIL_CONN_TEST=n +#EMAIL_CONN_TEST_PING=openwrt.org #EMAIL_CONN_TEST_IP=8.8.8.8 -#EMAIL_CONN_TEST_SITE=www.debian.org +EMAIL_CONN_TEST_SITE=openwrt.org #MSMTP_UMASK=077 #MSMTP_LOG_UMASK=077 #MSMTP_QUEUE_QUIET=false