Hi everyone
I'm in the middle of writing a 'Mail' config utility for
Zend_Environment that tries to determine the locally installed MTA -
it will help debugging quite a lot.
So far I can reliably determine Postfix (since it's my MTA of
choice :) and I _think_ I've got Exim covered but can't for the life
of me work out how you can check which version of Qmail is installed.
Can anyone help with the following:-
* Using either a config file or binary to determine version for Qmail
* Using either a config file or binary to determine version for Exim
(I currently use:-
if (preg_match('/Exim version/msi', $this->_config =
shell_exec('exim -bV'))) {
return 'exim';
}
* Using either a config file or binary to determine version for Sendmail
Any others that we should be looking for?
I'm also needing it to be cross platform, although the php.ini file
can give some clues as to the path/host/port etc.
As a start, here's how Postfix config can be returned:-
if (preg_match('/mail_version/msi', $this->_config = shell_exec
('postconf -d'))) {
return 'postfix';
}
and parsed...
preg_match_all('/([^\s]+)\s=\s([^\s]+)/msi', $this->_config,
$config, PREG_PATTERN_ORDER);
$config = array_combine($config[1], $config[2]);
Cheers
--
Simon Mundy | Director | PEPTOLAB
""" " "" """""" "" "" """"""" " "" """"" " """"" " """""" "" "
202/258 Flinders Lane | Melbourne | Victoria | Australia | 3000
Voice +61 (0) 3 9654 4324 | Mobile 0438 046 061 | Fax +61 (0) 3 9654
4124
http://www.peptolab.com