summaryrefslogtreecommitdiffstats
path: root/net-mail/qmail-usergen/files/qmail.sh
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2019-09-01 00:00:32 +0200
committerSuren A. Chilingaryan <csa@suren.me>2019-09-01 00:00:32 +0200
commitca9627e70852f6b2e835660df870fe3ab405882d (patch)
tree0a008b1d5b16fa0679a195ed7b5662c7891f591c /net-mail/qmail-usergen/files/qmail.sh
downloaddarklin4-ca9627e70852f6b2e835660df870fe3ab405882d.tar.gz
darklin4-ca9627e70852f6b2e835660df870fe3ab405882d.tar.bz2
darklin4-ca9627e70852f6b2e835660df870fe3ab405882d.tar.xz
darklin4-ca9627e70852f6b2e835660df870fe3ab405882d.zip
Initial import
Diffstat (limited to 'net-mail/qmail-usergen/files/qmail.sh')
-rwxr-xr-xnet-mail/qmail-usergen/files/qmail.sh29
1 files changed, 29 insertions, 0 deletions
diff --git a/net-mail/qmail-usergen/files/qmail.sh b/net-mail/qmail-usergen/files/qmail.sh
new file mode 100755
index 0000000..e9f3490
--- /dev/null
+++ b/net-mail/qmail-usergen/files/qmail.sh
@@ -0,0 +1,29 @@
+#!/bin/sh
+
+QMAILHOME=/var/qmail
+
+touch $QMAILHOME/users/assign.passwd
+touch $QMAILHOME/users/assign
+
+# create assign.nopasswd file
+( cat $QMAILHOME/users/assign.passwd && cat $QMAILHOME/users/assign ) \
+ | sort | uniq -u > $QMAILHOME/users/assign.nopasswd
+
+# create the assign file from passwd entries (using getent)
+getent passwd | $QMAILHOME/bin/qmail-pw2u > $QMAILHOME/users/assign.passwd
+
+# merge assign.nopasswd and assign.passwd in assign
+( cat $QMAILHOME/users/assign.nopasswd && cat $QMAILHOME/users/assign.passwd) \
+ | sort -k 2 | uniq | grep -v "^.$" > $QMAILHOME/users/assign
+
+# Fix for vpopmail
+#( cat $QMAILHOME/users/assign.nopasswd && cat $QMAILHOME/users/assign.passwd \
+# | sort -k 2 | uniq ) | grep -v "^.$" > $QMAILHOME/users/assign
+
+
+echo "." >> $QMAILHOME/users/assign
+
+
+
+# make cdb file
+$QMAILHOME/bin/qmail-newu