I am trying to get my server to be able to send email from PHP. Currently it is using send mail, but whenever I try to send mail to a gmail address I get this sort of response:
--o54Mqd5s008981.1275691959/ServerName
Content-Type: message/delivery-status
Reporting-MTA: dns; ServerName
Received-From-MTA: DNS; localhost
Arrival-Date: Fri, 4 Jun 2010 22:52:38 GMT
Final-Recipient: RFC822; [email protected]
Action: failed
Status: 5.7.1
Remote-MTA: DNS; gmail-smtp-in.l.google.com
Diagnostic-Code: SMTP; 550-5.7.1 [xxx.xxx.xxx.xxx] The IP you're using to send mail is not authorized
Last-Attempt-Date: Fri, 4 Jun 2010 22:52:39 GMT
How can I set this up to relay through a google account that I own? Is sendmail the best thing to use, or should I switch to Postfix or something? This is on an Ubuntu Server 9.10
Your server address may be listed as a dynamic address, which should never be sending email into the Internet directly. The standards provide of a layer of trust and require static addresses with correct rDNS configuration. Almost all the spam I get comes from dynamic addresses.
You should setup your server to send outgoing emails via your ISPs SMTP server. You can use Gmail as your relay, but you will need to enable SMTP services on your Gmail account. Then you will need to configure Postfix to authenticate when connection to Gmail.
If I remember correctly, you can't relay through gmail, even using your own credentials.