From 89b7b67a13ebb7965cc7f13ad0595e2194a2d34c Mon Sep 17 00:00:00 2001 From: Jannis Hoffmann Date: Wed, 3 Jul 2024 15:48:04 +0200 Subject: add sqmail-4.2.29a --- service/run_log | 13 +++++++++++++ service/run_pop3d | 8 ++++++++ service/run_pop3sd | 7 +++++++ service/run_postgrey | 22 ++++++++++++++++++++++ service/run_qmqpd | 10 ++++++++++ service/run_qmtpd | 9 +++++++++ service/run_qmtpsd | 11 +++++++++++ service/run_send | 3 +++ service/run_smtpd | 12 ++++++++++++ service/run_smtpsd | 11 +++++++++++ service/run_smtpsub | 11 +++++++++++ service/ssl.env | 19 +++++++++++++++++++ 12 files changed, 136 insertions(+) create mode 100755 service/run_log create mode 100755 service/run_pop3d create mode 100755 service/run_pop3sd create mode 100755 service/run_postgrey create mode 100755 service/run_qmqpd create mode 100755 service/run_qmtpd create mode 100755 service/run_qmtpsd create mode 100755 service/run_send create mode 100755 service/run_smtpd create mode 100755 service/run_smtpsd create mode 100755 service/run_smtpsub create mode 100644 service/ssl.env (limited to 'service') diff --git a/service/run_log b/service/run_log new file mode 100755 index 0000000..25d0f62 --- /dev/null +++ b/service/run_log @@ -0,0 +1,13 @@ +#!/bin/sh +LOG_USER="qmaill" +LOG_GROUP=`id -g ${LOG_USER}` +LOG_NAME=`basename ${PWD%/log}` +LOG_DIR="/var/log/${LOG_NAME}" +if [ ! -d "${LOG_DIR}" ]; then + mkdir -p "${LOG_DIR}" + chown ${LOG_USER}:${LOG_GROUP} "${LOG_DIR}" + echo "Creating log dir for ${LOG_NAME}:" + ls -ld "${LOG_DIR}" +fi +exec 2>&1 +exec setuidgid ${LOG_USER} multilog t s2000000 "${LOG_DIR}" diff --git a/service/run_pop3d b/service/run_pop3d new file mode 100755 index 0000000..952912c --- /dev/null +++ b/service/run_pop3d @@ -0,0 +1,8 @@ +#!/bin/sh +HOSTNAME=`hostname` +export UCSPITLS="" +. /var/qmail/ssl/ssl.env +exec env PATH="/var/qmail/bin:$PATH" \ + sslserver -seVn -Rp -l $HOSTNAME 0 pop3 \ + qmail-popup $HOSTNAME qmail-authuser \ + qmail-pop3d Maildir true 2>&1 5>&1 diff --git a/service/run_pop3sd b/service/run_pop3sd new file mode 100755 index 0000000..409949b --- /dev/null +++ b/service/run_pop3sd @@ -0,0 +1,7 @@ +#!/bin/sh +HOSTNAME=`hostname` +. /var/qmail/ssl/ssl.env +exec env PATH="/var/qmail/bin:$PATH" \ + sslserver -seV -Rp -l $HOSTNAME 0 pop3s \ + qmail-popup $HOSTNAME qmail-authuser \ + qmail-pop3d Maildir true 2>&1 5>&1 diff --git a/service/run_postgrey b/service/run_postgrey new file mode 100755 index 0000000..29a2c39 --- /dev/null +++ b/service/run_postgrey @@ -0,0 +1,22 @@ +#!/bin/sh +HOST_IP="127.0.0.1" +HOST_PORT="60000" +PIDFILE_DIR="/var/qmail/etc/" +WHITELIST_CLIENTS="/var/qmail/etc/whitelist_clients" +WHITELIST_RECIPIENTS="/var/qmail/etc/whitelist_recipients" +touch $WHITELIST_CLIENTS +touch $WHITELIST_RECIPIENTS +mkdir -p /var/spool/postfix/postgrey +chown postgrey /var/spool/postfix/postgrey +chmod +s /var/spool/postfix/postgrey +DBDIR_PATH="/var/qmail/etc/" +POSTGREY_DIR=" ../../Postgrey/postgrey-1.36" +# Assuming postgrey is not in the $PATH +exec 2>&1 # Logging! +exec ${POSTGREY_DIR}/postgrey -v --inet="$HOST_IP:$HOST_PORT" \\ + --whitelist-clients="$WHITELIST_CLIENTS" \\ + --whitelist-recipients="$WHITELIST_RECIPIENTS" \\ + --dbdir="$DBDIR_PATH" \\ + --pidfile="$PIDFILE_DIR" +# --user=qmaild --group=nofiles + diff --git a/service/run_qmqpd b/service/run_qmqpd new file mode 100755 index 0000000..857ecb4 --- /dev/null +++ b/service/run_qmqpd @@ -0,0 +1,10 @@ +#!/bin/sh +QMAILU=`id -u qmaild` +QMAILG=`id -g qmaild` +HOSTNAME=`hostname` +QMQP="628" +exec env PATH="/var/qmail/bin:$PATH" \ + tcpserver -v -Rp -l $HOSTNAME \ + -Xx /var/qmail/control/rules.qmqpd.cdb \ + -u $QMAILU -g $QMAILG 0 $QMQP \ + qmail-qmqpd 2>&1 diff --git a/service/run_qmtpd b/service/run_qmtpd new file mode 100755 index 0000000..695cc1f --- /dev/null +++ b/service/run_qmtpd @@ -0,0 +1,9 @@ +#!/bin/sh +QMAILU=`id -u qmaild` +QMAILG=`id -g qmaild` +HOSTNAME=`hostname` +exec env PATH="/var/qmail/bin:$PATH" \ + tcpserver -v -Rp -l $HOSTNAME \ + -Xx /var/qmail/control/rules.smtpd.cdb \ + -u $QMAILU -g $QMAILG 0 qmtp \ + qmail-qmtpd 2>&1 diff --git a/service/run_qmtpsd b/service/run_qmtpsd new file mode 100755 index 0000000..db66d11 --- /dev/null +++ b/service/run_qmtpsd @@ -0,0 +1,11 @@ +#!/bin/sh +QMAILU=`id -u qmaild` +QMAILG=`id -g qmaild` +QMTPS="6209" +HOSTNAME=`hostname` +. /var/qmail/ssl/ssl.env +exec env PATH="/var/qmail/bin:$PATH" \ + sslserver -seV -Rp -l $HOSTNAME \ + -Xx /var/qmail/control/rules.smtpd.cdb \ + -u $QMAILU -g $QMAILG 0 $QMTPS \ + qmail-qmtpd 2>&1 diff --git a/service/run_send b/service/run_send new file mode 100755 index 0000000..86ac38c --- /dev/null +++ b/service/run_send @@ -0,0 +1,3 @@ +#!/bin/sh +exec env - PATH="/var/qmail/bin:$PATH" \ + qmail-start ./Maildir/ diff --git a/service/run_smtpd b/service/run_smtpd new file mode 100755 index 0000000..68edafa --- /dev/null +++ b/service/run_smtpd @@ -0,0 +1,12 @@ +#!/bin/sh +QMAILU=`id -u qmaild` +QMAILG=`id -g qmaild` +HOSTNAME=`hostname` +export UCSPITLS="" +export SPF="3" +. /var/qmail/ssl/ssl.env +exec env PATH="/var/qmail/bin:$PATH" \ + sslserver -seVn -Rp -l $HOSTNAME \ + -Xx /var/qmail/control/rules.smtpd.cdb \ + -u $QMAILU -g $QMAILG 0 smtp \ + qmail-smtpd 2>&1 diff --git a/service/run_smtpsd b/service/run_smtpsd new file mode 100755 index 0000000..c373b83 --- /dev/null +++ b/service/run_smtpsd @@ -0,0 +1,11 @@ +#!/bin/sh +QMAILU=`id -u qmaild` +QMAILG=`id -g qmaild` +HOSTNAME=`hostname` +export SMTPAUTH="" +. /var/qmail/ssl/ssl.env +exec env PATH="/var/qmail/bin:/usr/local/bin:$PATH" \ + sslserver -seV -Rp -l $HOSTNAME \ + -Xx /var/qmail/control/rules.smtpd.cdb \ + -u $QMAILU -g $QMAILG 0 smtps \ + qmail-smtpd qmail-authuser true 2>&1 diff --git a/service/run_smtpsub b/service/run_smtpsub new file mode 100755 index 0000000..6292bf5 --- /dev/null +++ b/service/run_smtpsub @@ -0,0 +1,11 @@ +#!/bin/sh +QMAILU=`id -u qmaild` +QMAILG=`id -g qmaild` +HOSTNAME=`hostname` +export SMTPAUTH="!" +export UCSPITLS="!" +. /var/qmail/ssl/ssl.env +exec env PATH="/var/qmail/bin:/usr/local/bin:$PATH" \ + sslserver -seVn -Rp -l $HOSTNAME \ + -u $QMAILU -g $QMAILG 0 submission \ + qmail-smtpd qmail-authuser true 2>&1 diff --git a/service/ssl.env b/service/ssl.env new file mode 100644 index 0000000..bfa5875 --- /dev/null +++ b/service/ssl.env @@ -0,0 +1,19 @@ +# Environment +SSL_USER=SQMTLS +SSL_GROUP=NOFILES +SSL_DIR="QMAIL/ssl" +SSL_CHROOT="$SSL_DIR" +# Checks +SSL_UID=`id -u $SSL_USER` +[ $? -ne 0 ] && ( echo "No such user '$SSL_USER'" ; exit ) +SSL_GID=`id -g $SSL_USER` +[ $? -ne 0 ] && ( echo "No such group '$SSL_GROUP'" ; exit ) +# Files +CERTCHAINFILE="$SSL_DIR/chain6.pem" +CERTFILE="$SSL_DIR/localhost.pem" +KEYFILE="$SSL_DIR/localhost.key" +DHFILE="$SSL_DIR/dh1024.pem" +# Exported +export SSL_UID SSL_GID SSL_CHROOT +export CERTFILE KEYFILE DHFILE +#export CERTCHAINFILE -- cgit v1.2.3