0

I have the symbolic link setup for /usr/sbin/sendmail which points to my exim directory /usr/sbin/exim4/ and my php.ini pointing to /usr/sbin/sendmail. My mail isn't sending. I don't know what to do, but when I tried to reconfigure, it just shows the gui and goes straight to the next bash line with twomuchwork:~# 1;2c1;2c1;2c.

Update: I checked my iptables to make sure 25 was open. I think it might have something to do with google apps. At this point, I just want to be able to use Google apps and send mail using PHP's mail(). I have some web applications that requires the mail(). I even tried this post: How to Setup Ubuntu Mail Server with Google Apps?

Update2: I tried almost everything out there. I tried setting up exim4 as smarthost, I tried sendmail, everything works when I send a e-mail to my @gmail.com from terminal, but I still cannot get my PHP mail() to work.

Strawberry
  • 1,112
  • 4
  • 15
  • 27

3 Answers3

1

Interesting, dialog appears to be broken on your system for some reason. Try

dpkg-reconfigure -freadline exim4-config

Can you send email from the terminal (eg mail foo@example.com -s "subject goes here" then entering an email body ending with a . on a line by itself)? Is /usr/sbin/sendmail/ a typo, or do you really have a / on the end, because that shouldn't be there.

DerfK
  • 19,313
  • 2
  • 35
  • 51
0

You seem to think this problem is in some way related to PHP. IME that's very rarely the case, but you've not provided any details of how your php is configured for mail.

It works when I send it from the terminal, but not from php

Can you provide a transcript showing how you sent it from the CLI. Also the permissions for the binary. What happens when you replicate the CLI commands using popen() in php?

symcbean
  • 19,931
  • 1
  • 29
  • 49
  • For the record, I don't think this problem is related to PHP; I am saying I cannot send mail with PHP because of a reason I don't know of. I can provide details if I knew what to provide; I said I do not know what to do, and I hope to get help and direction here. With that said, I am trying to send using a foo.php using the `mail()` of PHP. Also, this is the command I used `echo "This is a test." | mail -s Testing someone@somedomain.com` from this guide: http://library.linode.com/email/exim/send-only-mta-debian-5-lenny – Strawberry Nov 01 '10 at 11:10
  • The "mail" command is **not** how PHP sends mail. However its worth checking what happens when you try to exec this from PHP. Your ini file should contain something like 'sendmail_path = /usr/sbin/sendmail -t '. You need to check that the binary is where its supposed to be and that it reads the envelope from the headers supplied in the message on stdin. – symcbean Nov 02 '10 at 10:22
0

If the machine is not supposed to receive incoming email try to install nullmailer:

# apt-get install nullmailer
# dpkg-reconfigure nullmailer

This is not a solution to your problem, especially if the machine is supposed to receive mail too. But it is an effort to walk around it.

adamo
  • 6,867
  • 3
  • 29
  • 58