Linux – How to find out what mail program is installed/sending emails

emaillinuxPHPubuntu-12.04

I'm trying to find out what emailing program (if any) is sending emails on my server. My employer has a few servers, most of which use sendmail, but on 2 of our servers I'm not finding an email program, but somehow email has been sent with it? I don't want to just install sendmail if something is already setup, I'm just unsure as to how to find out what is setup.
The server is Ubuntu Server 12.04 LTS, and I'm using the PHP mail() command.

The only information I can find to try answering my question is Sinan's question: How to find out what program is sending emails. I tried both the answers there and found nothing.

which mail does nothing, and /var/log/mail.log is completely empty.

I tried using strace ./mail-testing-strace.php to see what happened when this file was executed, but I kept getting "permission denied", just like the below:

execve("./mail-testing-strace.php", ["./mail-testing-strace.php"], [/* 19 vars */]) = -1 EACCES (Permission denied)
dup(2)                                  = 3
fcntl64(3, F_GETFL)                     = 0x8002 (flags O_RDWR|O_LARGEFILE)
fstat64(3, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb77ca000
_llseek(3, 0, 0xbfa1ae34, SEEK_CUR)     = -1 ESPIPE (Illegal seek)
write(3, "strace: exec: Permission denied\n", 32strace: exec: Permission denied
) = 32
close(3)                                = 0
munmap(0xb77ca000, 4096)                = 0
exit_group(1)                           = ?

The file mail-testing-strace.php was very basic, just having the code:

<?php
$to = "chris@test.com";
$subject = "Emailing Test";
$message = "This is a test, is it working?";
mail($to,$subject,$message);
?>

It's possible I'm not using strace correctly, as this is my first time trying to use it. I tried it on a server that I know sendmail is installed on and got the same message. I also tried running strace as the root user, but still no success.

Best Answer

You could try

$ dpkg -S `which sendmail`

I believe postfix is the default MTA for Ubuntu. Its main configuration file is /etc/postfix/main.cf

Other commands that might help:

# netstat -tanpl|grep :25

# lsof -i :25