sendmail help
14 Replies
@TheZach:
Well what other options are available?
If you're using the Debian disk image from Linode, you probably already have exim4 installed.
Or you can install postfix, currently the most popular MTA.
apt-get install postfix
And if I have exim4 how would I tell? And if so how would I incorporate it into my PHP?
In order to tell if exim4 (or postfix, or anything else) is installed, try
apt-get install exim4
If it tells you that exim4 is already installed, then it is. If not, the command above will automatically install it for you. Same goes for sendmail/postfix/etc. Just replace the last word with the name of the program you want to install.
What do you mean, incorporating mail into PHP? If you mean sending welcome emails, password reminders, etc. from your blog/forum software, all you need to do is to install the MTA, and PHP takes care of the rest. There's no need to manually put the two together. On Debian, these things just work out of the box.
If you do install an MTA on your server, and you're only going to use it for sending emails from PHP, you must make sure that your port 25 is unreachable from the outside. Otherwise, bad people could send spam using your server!
The simple fix is to create a symbolic link.
Then you won't need to update the php.ini. I'm guessing on the exim binary path as I don't use exim.
@Deviation:
Did you update
sendmail_path in your php.ini? it points to /usr/sbin/sendmail by default.The simple fix is to create a symbolic link.
ln -s /usr/sbin/sendmail /usr/sbin/exim Then you won't need to update the php.ini. I'm guessing on the exim binary path as I don't use exim.
exim4 already has '/usr/sbin/sendmail' - all MTA packages install it for compatibility reasons.
> I installed exim4 and PHP still wont send emails
Heard of a log report? What errors, etc. You may need to enable debugging in your PHP script.
2009-01-07 09:01:22 1LKYyI-0007b9-Te <= www-data@TheZach.net U=www-data P=local S=1346 id=05a98ca99f5fc7b4c93ba89d2d29d9df@www.aspieweb.net
2009-01-07 09:01:23 1LKYyI-0007b9-Te ** zach@thezach.net: Unrouteable address
2009-01-07 09:01:23 1LKYyJ-0007bB-2q <= <> R=1LKYyI-0007b9-Te U=Debian-exim P=local S=2175
2009-01-07 09:01:23 1LKYyI-0007b9-Te Completed
2009-01-07 09:01:23 1LKYyJ-0007bB-2q => www-data <www-data@thezach.net>R=local_user T=mail_spool
2009-01-07 09:01:23 1LKYyJ-0007bB-2q Completed</www-data@thezach.net>
1. The public DNS records for thezach.net shows that the one and only MX record for your domain thezach.net is smtp.digitalexample.net. Is this the email hosting company that you're using? If so, is smtp.digitalexample.net the correct MX record to be using?
2. Does your server think that its hostname is thezach.net? The first line of your log suggests that it does. In that case, exim will think that
Basically trying to forward email to his exchange servers.
The latest error:
2009-01-07 12:42:29 1LKcQH-0000Sc-7I <= www-data@server1.thezach.net U=www-data P=local S=574 id=589d4dd94ba4dea81bc209cb3634778d@www.aspieweb.net
2009-01-07 12:42:29 1LKcQH-0000Sc-7I smtp.digitalexample.com [69.51.128.242] Connection refused
2009-01-07 12:42:29 1LKcQH-0000Sc-7I ** zach@thezach.net R=dnslookup T=remote_smtp: SMTP error from remote mail server after HELO 127.0.0.1 localhost: host smtp.digitalexample.com [69.51.128.243]: 501 5.5.4$
2009-01-07 12:42:29 1LKcQH-0000Sf-Us <= <> R=1LKcQH-0000Sc-7I U=Debian-exim P=local S=1546
2009-01-07 12:42:30 1LKcQH-0000Sc-7I Completed
2009-01-07 12:42:30 1LKcQH-0000Sf-Us ** www-data@server1.thezach.net: Unrouteable address
2009-01-07 12:42:30 1LKcQH-0000Sf-Us Frozen (delivery error message)
$ dig server1.digitalexample.com
; <<>> DiG 9.3.4-P1.1 <<>> server1.digitalexample.com
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 61332
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0
;; QUESTION SECTION:
;server1.digitalexample.com. IN A
;; AUTHORITY SECTION:
digitalexample.com. 3600 IN SOA cluster1node1.internal.digitalex
ample.com. adevries.digitalexample.com. 2006122165 900 600 3600 3600
;; Query time: 369 msec
;; SERVER: 207.192.69.5#53(207.192.69.5)
;; WHEN: Wed Jan 7 19:40:44 2009
;; MSG SIZE rcvd: 112
i.e. the host can't be resolved