Hi Simon,

It doesn't make much sense to try to detect the version of Qmail, since the stable one is 1.0.3 for almost 10 years now. A lot of different patches can be applied which you will not be able to detect accurately.

Qmail goes to /var/qmail by default. You can access the config files in /var/qmail/control, though i'ts no warranty that qmail is indeed up and running (or able to) on the server.

Cheers,
Olivier

Quatrain, Conseil et solutions web pour l'entreprise
33 rue de la Bonneterie, 84000 Avignon, France
tél. +33 (0)4 90 80 40 40  fax +33 (0)4 90 80 40 43
Skype : crapougnax / +33 (0) 870 445 250
http://www.quatrain.com
--



Simon Mundy a écrit :
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


Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to