git: 27ecd7d58ffd - main - mail/notimail: Server-side email notification manager with push support

From: Robert Clausecker <fuz_at_FreeBSD.org>
Date: Sun, 16 Mar 2025 10:20:22 UTC
The branch main has been updated by fuz:

URL: https://cgit.FreeBSD.org/ports/commit/?id=27ecd7d58ffddc87a191128ad8cb9921539f53fa

commit 27ecd7d58ffddc87a191128ad8cb9921539f53fa
Author:     Stefano Marinelli <stefano@dragas.it>
AuthorDate: 2025-02-22 17:33:01 +0000
Commit:     Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2025-03-16 10:19:26 +0000

    mail/notimail: Server-side email notification manager with push support
    
    NotiMail is a server-side email notification manager that utilizes
    various push providers for real-time alerts, conserving mobile battery
    life without compromising on notification immediacy.
    
    WWW: https://github.com/draga79/NotiMail
    
    PR:             274676
---
 mail/notimail/Makefile             | 36 ++++++++++++++++++++++++++++
 mail/notimail/distinfo             |  3 +++
 mail/notimail/files/notimail.in    | 49 ++++++++++++++++++++++++++++++++++++++
 mail/notimail/files/pkg-message.in |  9 +++++++
 mail/notimail/pkg-descr            |  3 +++
 mail/notimail/pkg-plist            |  5 ++++
 6 files changed, 105 insertions(+)

diff --git a/mail/notimail/Makefile b/mail/notimail/Makefile
new file mode 100644
index 000000000000..83b344443955
--- /dev/null
+++ b/mail/notimail/Makefile
@@ -0,0 +1,36 @@
+PORTNAME=	NotiMail
+DISTVERSIONPREFIX=	v
+DISTVERSION=	2.0.1
+CATEGORIES=	mail python
+
+MAINTAINER=	stefano@dragas.it
+COMMENT=	Server-side email notification manager with push support
+WWW=		https://github.com/draga79/NotiMail
+
+LICENSE=	BSD3CLAUSE
+LICENSE_FILE=	${WRKSRC}/LICENSE
+
+RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}requests>0:www/py-requests@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}sqlite3>0:databases/py-sqlite3@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}configparser>0:devel/py-configparser@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}argparse>0:devel/py-argparse@${PY_FLAVOR}
+
+USES=		python shebangfix
+USE_GITHUB=	yes
+GH_ACCOUNT=	draga79
+USE_RC_SUBR=	notimail
+SHEBANG_FILES=	NotiMail.py
+
+NO_BUILD=	yes
+NO_ARCH=	yes
+SUB_FILES=	pkg-message
+
+do-install:
+	${INSTALL_SCRIPT} ${WRKSRC}/NotiMail.py ${STAGEDIR}${PREFIX}/bin/notimail
+	${MKDIR} ${STAGEDIR}${PREFIX}/etc/notimail
+	${INSTALL_DATA} ${WRKSRC}/config.ini.sample ${STAGEDIR}${PREFIX}/etc/notimail/config.ini.sample
+	${INSTALL_MAN} ${WRKSRC}/man/notimail.1 ${STAGEDIR}${PREFIX}/share/man/man1/
+	${MKDIR} ${STAGEDIR}/var/cache/notimail
+	${MKDIR} ${STAGEDIR}/var/log/notimail
+
+.include <bsd.port.mk>
diff --git a/mail/notimail/distinfo b/mail/notimail/distinfo
new file mode 100644
index 000000000000..7b26cbe19a12
--- /dev/null
+++ b/mail/notimail/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1740244881
+SHA256 (draga79-NotiMail-v2.0.1_GH0.tar.gz) = 297123f920607f5c4b4db4d7ebb2c7cb6e23bd40b9acb7bc8892251ce82ea880
+SIZE (draga79-NotiMail-v2.0.1_GH0.tar.gz) = 18061
diff --git a/mail/notimail/files/notimail.in b/mail/notimail/files/notimail.in
new file mode 100644
index 000000000000..de087d13c7b7
--- /dev/null
+++ b/mail/notimail/files/notimail.in
@@ -0,0 +1,49 @@
+#!/bin/sh
+
+# PROVIDE: notimail
+# REQUIRE: DAEMON
+# KEYWORD: shutdown
+
+. /etc/rc.subr
+
+name="notimail"
+rcvar="${name}_enable"
+
+load_rc_config $name
+
+: ${notimail_enable:="NO"}
+: ${notimail_user:="daemon"}
+: ${notimail_group:="daemon"}
+: ${notimail_command:="%%PREFIX%%/bin/notimail"}
+: ${notimail_flags:="-c %%PREFIX%%/etc/notimail/config.ini"}
+
+pidfile="/var/run/${name}.pid"
+command="/usr/sbin/daemon"
+command_args="-p ${pidfile} -f ${notimail_command} ${notimail_flags}"
+
+start_cmd="${name}_start"
+stop_cmd="${name}_stop"
+restart_cmd="${name}_restart"
+
+notimail_start() {
+    echo "Starting ${name}."
+    /usr/sbin/daemon -p ${pidfile} -f ${notimail_command} ${notimail_flags}
+}
+
+notimail_stop() {
+    echo "Stopping ${name}."
+    if [ -e "${pidfile}" ]; then
+        kill -s TERM `cat ${pidfile}`
+        rm -f ${pidfile}
+    else
+        echo "${name} is not running."
+    fi
+}
+
+notimail_restart() {
+    ${name}_stop
+    sleep 2
+    ${name}_start
+}
+
+run_rc_command "$1"
diff --git a/mail/notimail/files/pkg-message.in b/mail/notimail/files/pkg-message.in
new file mode 100644
index 000000000000..8d259eb4aa96
--- /dev/null
+++ b/mail/notimail/files/pkg-message.in
@@ -0,0 +1,9 @@
+Thank you for installing NotiMail!
+
+To finalize the installation, please configure
+
+    %%PREFIX%%/etc/notimal/config.ini
+
+according to your needs.  If this is an upgrade and you already have
+a config.ini, the new config file is installed as config.ini.sample.
+Review and merge any necessary changes.
diff --git a/mail/notimail/pkg-descr b/mail/notimail/pkg-descr
new file mode 100644
index 000000000000..cdaa8d01e792
--- /dev/null
+++ b/mail/notimail/pkg-descr
@@ -0,0 +1,3 @@
+NotiMail is a server-side email notification manager that utilizes
+various push providers for real-time alerts, conserving mobile battery
+life without compromising on notification immediacy.
diff --git a/mail/notimail/pkg-plist b/mail/notimail/pkg-plist
new file mode 100644
index 000000000000..49451bb7e9b8
--- /dev/null
+++ b/mail/notimail/pkg-plist
@@ -0,0 +1,5 @@
+bin/notimail
+@sample(daemon,daemon,640) etc/notimail/config.ini.sample
+share/man/man1/notimail.1.gz
+@dir(daemon,daemon,755) /var/cache/notimail
+@dir(daemon,daemon,755) /var/log/notimail