Browse Source

mail/msmtp-scripts: Add queuing mta wrapper for msmtp

This commit adds the msmtp-scripts package from SourceForge, which
is a wrapper around msmtp that provides queueing, syslog or file logging,
and a basic SMTP (no auth) server.

Signed-off-by: Daniel Dickinson <lede@daniel.thecshore.com>
lilik-openwrt-22.03
Daniel Dickinson 9 years ago
committed by Daniel Dickinson
parent
commit
4d64a05350
3 changed files with 176 additions and 0 deletions
  1. +141
    -0
      mail/msmtp-scripts/Makefile
  2. +17
    -0
      mail/msmtp-scripts/files/msmtpq-ng-mta.init
  3. +18
    -0
      mail/msmtp-scripts/files/msmtpq-ng.rc

+ 141
- 0
mail/msmtp-scripts/Makefile View File

@ -0,0 +1,141 @@
#
# Copyright (C) 2009 David Cooper <dave@kupesoft.com>
# Copyright (C) 2009-2015 OpenWrt.org
# Copyright (C) 2016 Daniel Dickinson <lede@daniel.thecshore.com>
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=msmtp-scripts
PKG_VERSION:=1.0.8
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@SF/msmtp-scripts
PKG_MD5SUM:=2aec48d47b02facf2a33cf97a7434e969c1a054224406e6c55320d825c7902b2
PKG_LICENSE:=GPL-3.0+
PKG_LICENSE_FILES:=COPYING
PKG_MAINTAINER:=Daniel Dickinson <lede@daniel.thecshore.com>
include $(INCLUDE_DIR)/package.mk
define Package/msmtp-scripts/Default
SECTION:=mail
CATEGORY:=Mail
TITLE:=Simple sendmail SMTP queueing and forwarding
URL:=http://msmtp-scripts.sourceforge.net/
endef
define Package/msmtp-scripts/Default/description
msmtp-scripts are scripts wrappers around the msmtp SMTP client that
add queueing, logging to syslog or file, a subset of sendmail/postfix
mailq/postsuper/postqueue commands implemented in a compatible fashion.
endef
define Package/msmtpq-ng
$(call Package/msmtp-scripts/Default)
DEPENDS+= @(PACKAGE_msmtp||PACKAGE_msmtp-nossl)
TITLE+= (msmtpq-ng wrappers)
endef
define Package/msmtpq-ng/conffiles
/etc/msmtpq-ng.rc
endef
define Package/msmtpq-ng/description
$(call Package/msmtp-scripts/Default/description)
This package contains the msmtpq-ng and msmtpq-ng-queue
wrappers around msmtp, which provide the bulk of the
functionality.
endef
define Package/msmtpq-ng-mta
$(call Package/msmtp-scripts/Default)
TITLE+= (as MTA)
DEPENDS+=+msmtpq-ng
USERID:=msmtp=482:msmtp=482
endef
define Package/msmtp-queue-mta/conffiles
/etc/msmtpq-ng-mta.rc
endef
define Package/msmtpq-ng-mta/description
$(call Package/msmtp-scripts/Default/description)
This package provides sendmail, mailq, postfix,
and postsuper symlinks to wrappers that configure
msmtpq-ng for use as the system mail transport
agent via the sendmail command.
endef
define Package/msmtpq-ng-mta-smtpd
$(call Package/msmtp-scripts/Default)
DEPENDS+= +msmtpq-ng-mta +xinetd
TITLE+= (basic SMTP server)
endef
define Package/msmtp-ng-mta-smtpd/description
$(call Package/msmtp-scripts/Default/description)
This package uses the -bs option to msmtpq-ng
(which, like the sendmail -bs command, provides
SMTP over stdin/stdout) combined with xinetd to
provide a basic SMTP server. In it's default
configuration it only accepts connections from
localhost AND network mail must be released from
the hold queue before it can be delivered.
endef
define Package/msmtpq-ng-mta/postinst
mkdir -p $${IPKG_INSTROOT}/etc/crontabs
if ! grep -q msmtpq-ng-mta $${IPKG_INSTROOT}/etc/crontabs/root; then echo $$'\n'"*/60 * * * * /usr/bin/msmtpq-ng-mta -q" >>$${IPKG_INSTROOT}/etc/crontabs/root; fi
endef
define Package/msmtp-queue-mta/prerm
if grep -q msmtpq-ng-mta $${IPKG_INSTROOT}/etc/crontabs/root; then grep -v '\*/60 \* \* \* \* /usr/bin/msmtpq-ng-mta -q' $${IPKG_INSTROOT}/etc/crontabs/root >$${IPKG_INSTROOT}/etc/crontabs/root.new; mv -f $${IPKG_INSTROOT}/etc/crontabs/root.new $${IPKG_INSTROOT}/etc/crontabs; fi
endef
define Build/Configure
true
endef
define Build/Compile
true
endef
define Package/msmtpq-ng/install
$(INSTALL_DIR) $(1)/etc
$(INSTALL_CONF) ./files/msmtpq-ng.rc $(1)/etc/msmtpq-ng.rc
$(INSTALL_DIR) $(1)/usr/bin
$(CP) $(PKG_BUILD_DIR)/msmtpq-ng/msmtpq-ng $(1)/usr/bin/
$(SED) 's/logger -i/logger/' $(1)/usr/bin/msmtpq-ng
$(CP) $(PKG_BUILD_DIR)/msmtpq-ng/msmtpq-ng-queue $(1)/usr/bin/
endef
define Package/msmtpq-ng-mta/install
$(INSTALL_DIR) $(1)/usr/bin $(1)/usr/sbin $(1)/usr/lib $(1)/etc/init.d
$(INSTALL_CONF) $(PKG_BUILD_DIR)/msmtpq-ng-mta/msmtpq-ng-mta.rc $(1)/etc/
echo 'MSMTP_LOCK_DIR=/var/lock/msmtp' >>$(1)/etc/msmtpq-ng-mta.rc
$(INSTALL_BIN) $(PKG_BUILD_DIR)/msmtpq-ng-mta/msmtpq-ng-mta $(1)/usr/bin/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/msmtpq-ng-mta/msmtpq-ng-queue-mta $(1)/usr/bin/
$(INSTALL_DIR) $(1)/etc/crontabs
$(INSTALL_BIN) ./files/msmtpq-ng-mta.init $(1)/etc/init.d/msmtpq-ng-mta
ln -sf ../bin/msmtpq-ng-mta $(1)/usr/sbin/sendmail
ln -sf ../bin/msmtpq-ng-mta $(1)/usr/lib/sendmail
ln -sf ../bin/msmtpq-ng-queue-mta $(1)/usr/sbin/mailq
ln -sf ../bin/msmtpq-ng-queue-mta $(1)/usr/sbin/postqueue
ln -sf ../bin/msmtpq-ng-queue-mta $(1)/usr/sbin/postsuper
endef
define Package/msmtpq-ng-mta-smtpd/install
$(INSTALL_DIR) $(1)/etc/xinetd.d
$(INSTALL_BIN) $(PKG_BUILD_DIR)/msmtpq-ng-mta/sendmail-bs.xinetd $(1)/etc/xinetd.d/msmtpq-ng-mta-smtpd
endef
$(eval $(call BuildPackage,msmtpq-ng))
$(eval $(call BuildPackage,msmtpq-ng-mta))
$(eval $(call BuildPackage,msmtpq-ng-mta-smtpd))

+ 17
- 0
mail/msmtp-scripts/files/msmtpq-ng-mta.init View File

@ -0,0 +1,17 @@
#!/bin/sh /etc/rc.common
# Copyright (C) 2006-2016 OpenWrt.org
START=90
boot() {
[ ! -d /var/spool/msmtp ] && {
mkdir -m 0770 -p /var/spool/msmtp
chown msmtp:msmtp /var/spool/msmtp
}
[ ! -d /var/lock/msmtp ] && {
mkdir -m 0770 -p /var/lock/msmtp
chown msmtp:msmtp /var/lock/msmtp
}
}

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

@ -0,0 +1,18 @@
#Q=~/msmtp.queue
#LOG=~/log/.msmtp.queue.log
#MAXLOGLEVEL=7
#MSMTP_LOCKDIR=/var/lock
EMAIL_CONN_TEST=p
EMAIL_CONN_TEST_SITE=www.lede-project.org
#EMAIL_CONN_TEST_IP=8.8.8.8
#MSMTP_UMASK=077
#MSMTP_LOG_UMASK=077
#MSMTP_QUEUE_QUIET=false
#MSMTP_IGNORE_NO_RECIPIENTS=false
#MSMTP_QUEUE_ONLY=false
#MSMTP_SEND_DELAY=0
#MSMTP_MAXIMUM_QUEUE_LIFETIME=345600 # Four days
#MSMTP=msmtp
#MSMTPQ_NG_QUEUE=msmtpq-ng-queue
#MSMTP_HOLD_SMTP_MAIL=true
#MSMTP_HOLD_CLI_MAIL=false

Loading…
Cancel
Save