summaryrefslogtreecommitdiffstats
path: root/net-mail/qmail-usergen/files/qmail.sh
blob: e9f34906e61044deb0a27a24b241f7c9b0a3bd21 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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