Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

i've got some questions about how it works:

so ubuntu server comes with postfix installed.

if i want my php script to send a mail to lets say peter@gmail.com, how does it work?

do i have to specify any ip to another MTA (my ISP's MTA?) in postfix's configuration file?

and if someone sends back, will it get to my ip? is it postfix that receives it? or has it to do with fetchmail?

share|improve this question

2 Answers 2

up vote 1 down vote accepted

You'll need to set up relaying if you want mail sent to your server to be sent out. Your server will receive mail if it is the MX entry for the domain, or if mail is forwarded directly to it. Otherwise, it will not receive mail from outside.

share|improve this answer
    
are there any ebooks/tutorials explaining how it all works cause i have no clue. i know ubuntu server and php but nothing about how smtp server and fetchmail interacts with ubuntu. is michael@mydomain.com related to an account in ubuntu (that is to say the user michael exists in /etc/passwd?. so i have to relay (specify another ip) in the postfix configuration you say, what ip? my ISP's smtp server ip? i've got a domain, how do i set up a mail server. if someone sends me a mail i want to be able to receive it. cause im using a vps, and have to set up everything manual. any tutorials/ebooks? –  ajsie Apr 5 '10 at 3:30
    
I'd recommend something from ORA. I have their sendmail book and it's one of the best I've seen. (Yes, I know sendmail sucks, but I haven't yet gotten around to writing anything better.) oreilly.com/catalog/9780596002121 –  Ignacio Vazquez-Abrams Apr 5 '10 at 3:34

The postfix documentation really is quite good. Also see their FAQs and HOWTOs page.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.