can't get php mail() working on Ubuntu desktop version with sendmail and postfix

do you really need a full mta installed? i never use sendmail and only have 1 postfix install for all my servers. in all others i use ssmtp. much simpler to configure and more efficient to use, if your server doesn't need to receive emails.


try to "strace" sendmail to understand why it blocks.

try also to configure it to use a smart host (e.g. your internal network mail relay server, ask sysadmins):

yum|apt-get install sendmail-cf

vim /etc/mail/sendmail.mc 

define(`SMART_HOST',`smtpserver.tld')

or

define(`SMART_HOST',`localhost')    <-- to enforce sendmail to use your postfix

note that in this strange syntax

dnl define(`SMART_HOST',`smtpserver.tld')

is a commented line!!! so get rid of dnl if you found on the smart_host default line

build the conf

m4 sendmail.mc > sendmail.cf

service sendmail restart

test it:

sendmail -s "Test" [email protected]