LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-28-2012, 03:50 PM   #1
J'Kla
LQ Newbie
 
Registered: Feb 2008
Posts: 6

Rep: Reputation: 0
Unhappy Postfix rcpt to: support for PHP mail() command


First a bit of background 2 Questions at the bottom.

I’m not a novice but I’m no expert and I’m using this as a learning exercise.

I have built myself an Ubuntu 11.10 x86_64 server and I have it running at a friends business which is useful as he’s paying for the electricity and the broadband connection. The deal is I look after his router and ancient Novell 5 network which I consider a fair swap.

I have NoFixedIP running with a handy Domain name that I get for free provided I do a little on line confirmation of need and provided I can work this out I’ll probably spring for the fully paid up account.

On the back of this I have built an Apache2 web server an FTP server with PHP and MySQL and I have set up a telnet access and I have been building a website following an copy of "Deamweaver 8 with ASP, ColdFusion and PHP by Jeffery Bardzell" I’ve got to say it was ok and was reasonable to follow.

I also have an old install of Dreamweaver 8 from when I was a student so thats sweet for the time being.

Now I come to work through it again the ASP section is out of the frame and Coldfusion died in the water when Adobe bought out Macromedia. However PHP is still valid (and very reasonably priced GNU) and as I’m working from an Ubuntu Server with Apache2 PHP seems the best option.

So I’m looking at a web page that gives the user a web page with boxes to fill in data and when the user clicks the required button the content is mailed to some embedded e-mail address in this case a webmail account on gmail I also have a yahoo accout as specified in the book section “Setting up a Web Form”.

Now the book has info on setting up for ASP and a section for setting up ColdFusion but here’s the rub and I quote “PHP users developing locally with Apache should already be configured. Go ahead and skip to the section, Writing Code to Send a Message.”

Now since the book has been written it doesn’t work out of the box as expected, and a lot of thrashing around has taken me to llok at Postfix and some experimentation.

I did find the following very useful blog.

http://lenss.nl/2009/01/making-php-m...rough-postfix/

Now I’ve worked through this and it includes a short telnet 25 negotiation example and all works well until I come to the line

rcpt to: some@working.address

When I use my functioning gmail address here I get the message

550 5.1.1 <xxxxxx.xxx@gmail.com> : Recipient address rejected: gmail.com

Note gmail account hidden to protect the guilty

This to be fair to our blogger, his article was written Jan 2009 and it’s now April 2012 and as we all know things tend to move onwards in the Linux Universe.

Now while it seems totally sensible for postfix to stop outgoing mail it also seems reasonable there should be some file somewhere where I can enter a list of permitted outgoing addresses.

There’s loads of information on setting up Postfix but it appears to be about redirecting mail within, or handling incoming mail and to be frank it's a fog of information.

I can see a reason for adding some sort of proxy so I can add some dummy e-mail address in my webpage so it’s invisible to phishing software looking for mail addresses but another text file table could hide that.

This still leaves me with the problem of letting my Mail escape from my unix box into my mail box.

I suspect there’s either some change to be made to main.cf or some entry I need to make into some other file.

Now the blog (see earlier link) has obviously managed this somehow as he’s not getting the 550 error to the rcpt to: request and despite my best efforts to find a solution to what must be a simple solution I’m getting nowhere.

As it stands my options are to appeal for an answer here or failing that beat my head against the wall for a few weeks learning how to set up postfix so I can eliminate all of the rubbish to do with incoming mail (which I don’t want at this time) to find the gem that will allow my webpage to post.

Questions:
Where and what do I add in the way of info that will allow rcpt to: to send to my gmail.com account?

Failing that does anybody know a simple tutorial (idiot guide where I am the idiot) on setting up a Postfix mail system on an Ubuntu server, considering that this no longer works out of the box, and the afore mentioned idiot has no clue in setting up a mail account beyond registering for webmail?

Last edited by J'Kla; 04-28-2012 at 03:53 PM.
 
Old 04-28-2012, 04:16 PM   #2
descendant_command
Senior Member
 
Registered: Mar 2012
Posts: 1,876

Rep: Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643
Because (presumably) you telnet connection is coming from a non-local (to the server) address, relaying is denied (without authentication).

See http://www.postfix.org/SMTPD_ACCESS_README.html

It should be as simple as telling your php script to use the smtp server on localhost and ensuring that 'permit_mynetworks' is set in postfix's main.cf
 
Old 04-28-2012, 07:07 PM   #3
J'Kla
LQ Newbie
 
Registered: Feb 2008
Posts: 6

Original Poster
Rep: Reputation: 0
No I'm logged ito the server using Putty as root effectivly a remote dumb terminal, and after going back to that blogg entry I found it said remove sendmail well it took a while but I eventually found apt-get -remove sendmail* the asterisk was the key then a removal purge and reinstall of postfix and the telnet allows a gmail send but the mail command no longer works and even though the telnet accepts the rcpt to: address that links to my gmail account ok it does run into the spam filter and I need to go follow through on the PHP but I'm happy with this.

Seems It was a missing star from the sendmail unistall.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Postfix 2.5.5 sending mail error: Domain not found (in reply to RCPT TO command) edderkop Linux - Server 2 07-05-2011 02:26 PM
Postfix NOQUEUE: reject: RCPT error NX-01 Linux - Server 7 05-28-2009 11:43 PM
Debian etch - Unable to send mail from command line or from php mail command lqforumuser Linux - Newbie 1 03-01-2009 06:56 AM
Postfix RCPT TO and TO headers mastmind0 Linux - Server 11 09-18-2006 07:20 AM
Mail problems 503 5.0.0 Need RCPT (recipient) Hylke Hogewind Linux - Software 3 04-03-2003 07:50 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:37 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration