aboutsummaryrefslogtreecommitdiffstats
path: root/debian/fetchmail.postinst
diff options
context:
space:
mode:
authorvg <vgm+dev@devys.org>2024-03-29 11:16:52 +0100
committervg <vgm+dev@devys.org>2024-03-29 11:16:52 +0100
commit8eae1aca826e08d953a43978bae554f20d07897a (patch)
treebcbb8a580d5b29f35bb90d6ef1a05d80aed67e66 /debian/fetchmail.postinst
parent9f542a1e74323a7247a19de9d7349a7269c63002 (diff)
downloadfetchmail-8eae1aca826e08d953a43978bae554f20d07897a.tar.gz
fetchmail-8eae1aca826e08d953a43978bae554f20d07897a.tar.bz2
fetchmail-8eae1aca826e08d953a43978bae554f20d07897a.zip
get debian directory from debian archive
Diffstat (limited to 'debian/fetchmail.postinst')
-rw-r--r--debian/fetchmail.postinst31
1 files changed, 31 insertions, 0 deletions
diff --git a/debian/fetchmail.postinst b/debian/fetchmail.postinst
new file mode 100644
index 00000000..c3bf1145
--- /dev/null
+++ b/debian/fetchmail.postinst
@@ -0,0 +1,31 @@
+#!/bin/sh
+#
+# Postinst script for fetchmail
+# $Id: fetchmail.postinst 469 2008-05-18 12:47:05Z nion $
+#
+
+set -e
+
+# Create fetchmail user and its homedir if we may need it
+if ! getent passwd fetchmail >/dev/null; then
+ adduser --system --ingroup nogroup --home /var/lib/fetchmail \
+ --shell /bin/false --disabled-password fetchmail
+fi
+
+# if the login shell is not /bin/false, change this, see #481727
+LOGINSH=$(getent passwd fetchmail | cut -d ':' -f 7)
+if [ "x$LOGINSH" != "x/bin/false" ]; then
+ chsh -s /bin/false fetchmail
+fi
+
+if ! [ -d /var/lib/fetchmail ]; then
+ mkdir -p /var/lib/fetchmail
+fi
+chmod 700 /var/lib/fetchmail
+chown -h -R fetchmail:nogroup /var/lib/fetchmail
+
+#DEBHELPER#
+
+exit 0
+
+# vim:ts=4:sw=4: