1
0
镜像自地址 https://github.com/mail-in-a-box/mailinabox.git 已同步 2026-04-01 21:27:22 +02:00

mail-postfix.sh: move db files to db subdir

这个提交包含在:
Jeff Volkenant
2021-12-23 14:14:22 -08:00
提交者 jeff
父节点 404f3e7ec9
当前提交 3d8a518beb

查看文件

@@ -243,19 +243,19 @@ tools/editconf.py /etc/postfix/main.cf \
# symlink without spaces that can point to a folder with spaces). We'll just assume
# $STORAGE_ROOT won't have spaces to simplify things.
tools/editconf.py /etc/default/postgrey \
POSTGREY_OPTS=\""--inet=127.0.0.1:10023 --delay=180 --dbdir=$STORAGE_ROOT/mail/postgrey"\"
POSTGREY_OPTS=\""--inet=127.0.0.1:10023 --delay=180 --dbdir=$STORAGE_ROOT/mail/postgrey/db"\"
# Make destination postgrey database directory under $STORAGE_ROOT
mkdir -p $STORAGE_ROOT/mail/postgrey
mkdir -p $STORAGE_ROOT/mail/postgrey/db
# If the $STORAGE_ROOT/mail/postgrey is empty, copy the postgrey database over from the old location
if [ ! "$(ls -A $STORAGE_ROOT/mail/postgrey)" ]; then
if [ ! "$(ls -A $STORAGE_ROOT/mail/postgrey/db)" ]; then
# Stop the service
service postgrey stop
# Copy over the databse.
# We didn't cp -p to preserve perms since we have to chown the newly created directory above anyway.
# There really shouldn't be any folders in this path, but if there are for any reason cp fails without -r (recursive).
cp -r /var/lib/postgrey/* $STORAGE_ROOT/mail/postgrey/
cp -r /var/lib/postgrey/* $STORAGE_ROOT/mail/postgrey/db
fi
# Fix permissions
chown -R postgrey:postgrey $STORAGE_ROOT/mail/postgrey/