Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

sendmail and qmail both run on the same server. How can I know the one used to send email ?

I have a PHP application that sends email via the mail() function. The SMTP server it uses has both process running. It is a server used for live applications, so I can't stop one process to do some tests.

Thanks Cedric

share|improve this question
    
I'd make sure that the machine really is as you describe. It's possible to get confused about these things, especially as most Unix/Linux MTSes have a sendmail program image file that is nothing whatsoever to do with the Sendmail software package. There's almost never a need to set up a system in this way with two different MTS softwares running in parallel. (Multiple instances of one package is as exotic a configuration as things normally get.) – JdeBP Jun 18 '11 at 12:45

You will have to look in your php.ini file, under [mail function]. Here, the path to the mail sending binary is specified. Whatever is specified here, the mail() function in PHP will use.

sendmail_path = /usr/sbin/sendmail -t -i

The above one should be the default. So, if you haven't changed anything, PHP will use sendmail.

As @JdeBP mentions, you can also take a quick look at the headers of the mails received. If you look under the various Received sections, you will find some identification of the server software being used.

share|improve this answer
    
Some systems have sendmail as a symlink to the actual binary provided by the MTA, e.g. sendmail.sendmail or sendmail.qmail. – Ignacio Vazquez-Abrams Jun 17 '11 at 12:25
    
Oh, okay. Yeah, I'd trace down that one. Like your option though. – slhck Jun 17 '11 at 12:28
    
+1. The suggestion in the PHP manual is to point sendmail_path directly at qmail_inject, which will be directly indicative with no further research. But in the general case finding out whose binary sendmail_path is pointing to is the right answer for PHP on Unix/Linux. – JdeBP Jun 18 '11 at 12:40
    
While you're at it, you could mention in your answer that the Received: header fields in the received messages will yield very strong clues as to which software, Sendmail or qmail, processed the mail. Sendmail and qmail write trace information in different forms. – JdeBP Jun 18 '11 at 12:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .