aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcello Coutinho <marcellocoutinho@gmail.com>2012-03-21 11:52:25 -0300
committerCharlie <root@pfsense.localdomain>2012-03-21 11:52:25 -0300
commitb3a38ba93ce0dd7381899ceef6b0b271c51efa71 (patch)
treeb069d5beb6382063b8cbf60bfe726933d997a413
parent9b2ae97ee1a9503464d822f4ef190eaf8c04f488 (diff)
downloadpfsense-packages-b3a38ba93ce0dd7381899ceef6b0b271c51efa71.tar.gz
pfsense-packages-b3a38ba93ce0dd7381899ceef6b0b271c51efa71.tar.bz2
pfsense-packages-b3a38ba93ce0dd7381899ceef6b0b271c51efa71.zip
postfix - check and create /var postfix dirs to fix nanobsd after boot error.
-rw-r--r--config/postfix/postfix.inc18
1 files changed, 14 insertions, 4 deletions
diff --git a/config/postfix/postfix.inc b/config/postfix/postfix.inc
index 5fde243e..6c1ae21c 100644
--- a/config/postfix/postfix.inc
+++ b/config/postfix/postfix.inc
@@ -3,7 +3,7 @@
postfix.inc
part of the Postfix package for pfSense
Copyright (C) 2010 Erik Fonnesbeck
- Copyright (C) 2011 Marcello Coutinho
+ Copyright (C) 2012 Marcello Coutinho
All rights reserved.
@@ -658,9 +658,19 @@ MASTEREOF2;
{
mwexec("/usr/local/sbin/postmap /usr/local/etc/postfix/".$file);
}
-
- if (!is_dir("/etc/mail"))
- mkdir("/etc/mail", 0755);
+
+ #check postix dirs
+ $dirs=array("/var/spool/postfix","/etc/mail","/var/db/postfix","/var/mail/postfix");
+ foreach ($dirs as $dir)
+ if (!is_dir($dir))
+ mkdir($dir, 0755);
+
+ #check postfix owners
+ $dirs=array("/var/db/postfix","/var/mail/postfix");
+ foreach ($dirs as $dir){
+ chown($dir, 'postfix');
+ chgrp($dir, 'postfix');
+ }
if (!file_exists("/etc/mail/aliases"))
touch("/etc/mail/aliases");
exec("/usr/local/bin/newaliases");