From b3a38ba93ce0dd7381899ceef6b0b271c51efa71 Mon Sep 17 00:00:00 2001 From: Marcello Coutinho Date: Wed, 21 Mar 2012 11:52:25 -0300 Subject: postfix - check and create /var postfix dirs to fix nanobsd after boot error. --- config/postfix/postfix.inc | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'config/postfix/postfix.inc') 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"); -- cgit v1.2.3