Browse Source

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 "<http head request>"|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 <cshored@thecshore.com>
lilik-openwrt-22.03
Daniel F. Dickinson 5 years ago
parent
commit
3c15d410a9
3 changed files with 8 additions and 7 deletions
  1. +2
    -1
      mail/msmtp-scripts/Makefile
  2. +3
    -3
      mail/msmtp-scripts/files/msmtpq-ng-mta.rc
  3. +3
    -3
      mail/msmtp-scripts/files/msmtpq-ng.rc

+ 2
- 1
mail/msmtp-scripts/Makefile View File

@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=msmtp-scripts PKG_NAME:=msmtp-scripts
PKG_VERSION:=1.2.4 PKG_VERSION:=1.2.4
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://launchpad.net/$(PKG_NAME)/1.2/$(PKG_VERSION)/+download 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_DATA) ./files/msmtpq-ng.rc $(1)/etc/msmtpq-ng.rc
$(INSTALL_DIR) $(1)/usr/bin $(INSTALL_DIR) $(1)/usr/bin
$(CP) $(PKG_BUILD_DIR)/src/usr/bin/msmtpq-ng $(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/ $(CP) $(PKG_BUILD_DIR)/src/usr/bin/msmtpq-ng-queue $(1)/usr/bin/
endef endef


+ 3
- 3
mail/msmtp-scripts/files/msmtpq-ng-mta.rc View File

@ -14,9 +14,9 @@
#MSMTPQ_NG=msmtpq-ng #MSMTPQ_NG=msmtpq-ng
#MSMTPQ_NG_QUEUE=msmtpq-ng-queue #MSMTPQ_NG_QUEUE=msmtpq-ng-queue
#MSMTP_CONF=/etc/msmtprc #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_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_SMTP_MAIL=true
#MSMTP_HOLD_CLI_MAIL=false #MSMTP_HOLD_CLI_MAIL=false

+ 3
- 3
mail/msmtp-scripts/files/msmtpq-ng.rc View File

@ -4,10 +4,10 @@
#LOG=~/log/.msmtp.queue.log #LOG=~/log/.msmtp.queue.log
#MAXLOGLEVEL=7 #MAXLOGLEVEL=7
#MSMTP_LOCK_DIR=~/.msmtp.lock #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_IP=8.8.8.8
#EMAIL_CONN_TEST_SITE=www.debian.org
EMAIL_CONN_TEST_SITE=openwrt.org
#MSMTP_UMASK=077 #MSMTP_UMASK=077
#MSMTP_LOG_UMASK=077 #MSMTP_LOG_UMASK=077
#MSMTP_QUEUE_QUIET=false #MSMTP_QUEUE_QUIET=false


Loading…
Cancel
Save