Page MenuHomeFreeBSD

D53061.1774723267.diff
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

D53061.1774723267.diff

diff --git a/usr.sbin/sendmail/Makefile b/usr.sbin/sendmail/Makefile
--- a/usr.sbin/sendmail/Makefile
+++ b/usr.sbin/sendmail/Makefile
@@ -25,6 +25,13 @@
BINMODE=2555
.endif
+# Add a pkg(8) trigger that automatically restarts sendmail on upgrade.
+# This is required because if /var/spool/mqueue is deleted and recreated,
+# sendmail will stop working until it's restarted.
+FILESGROUPS= TRIGGERS
+TRIGGERS= sendmail.ucl
+TRIGGERSDIR= /usr/share/pkg/triggers
+
# Define the database format to use for aliases et al.
DBMDEF= -DNEWDB
# If you don't want NIS alias/map support, comment out this line
diff --git a/usr.sbin/sendmail/sendmail.ucl b/usr.sbin/sendmail/sendmail.ucl
new file mode 100644
--- /dev/null
+++ b/usr.sbin/sendmail/sendmail.ucl
@@ -0,0 +1,34 @@
+/*
+ * SPDX-License-Identifier: ISC
+ *
+ * Copyright (c) 2025 Lexi Winter <ivy@FreeBSD.org>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+path: [
+ "/var/spool/mqueue",
+ "/var/spool/clientmqueue",
+]
+
+trigger: {
+ type: lua
+ sandbox: false
+ script: <<EOD
+ pkg.exec({"/bin/sh", "-c",
+ "/usr/sbin/service sendmail status >/dev/null 2>&1 && " ..
+ "echo 'Restarting sendmail(8).' && " ..
+ "/usr/sbin/service sendmail onerestart"})
+EOD
+}
+

File Metadata

Mime Type
text/plain
Expires
Sat, Mar 28, 6:41 PM (12 h, 31 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28219418
Default Alt Text
D53061.1774723267.diff (1 KB)

Event Timeline