0

I'm currently attempting (and failing) to set up an SMTP mail server on my Ubuntu server so I can recieve emails from the contact page of my php based website. I was planning to send these emails using phps built in mail() function.

However, no matter what I try the email either never sends with no errors (in the case of using sendmail) or causes a client-side timeout (in the case of using postfix). If anyone can help me it'd be greatly appreciated!

I'm rather new to using SMTP related stuff so I don't really know what log files to attach so please ask me for them if needed. Thanks.

Edit: port 25 is forwarded

6
  • Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Commented Aug 11 at 18:33
  • 1
    is the mail server on your Ubuntu box supposed to deliver the email locally or to a remote service such as Gmail? is your php website on the same machine? is it in a container? if you install a mail client such as mailx can you send mail in the way you expect? Commented Aug 11 at 22:26
  • 1. Another question: does your domain have an MX record pointing at the hostname or IP address of the machine you want to use as a mail server - if not, you'll never get any replies. 2. Since you're new to SMTP: avoid sendmail. There's no good reason to use it unless you've already been using it for 30+ years. Use something modern and much easier to configure and work with. Postfix is good. Exim is good too, although since it's basically a modernised and updated fork of smail it's almost as old as sendmail. Commented Aug 12 at 2:24
  • 1
    3. if your php contact email script doesn't have the recipient address hard-coded into the script itself (or a config file for that script), then spammers WILL find it and abuse it and your mail server will be blacklisted almost instantly. i.e. don't take the recipient address from the web form, even in a "hidden" field, that's only hidden to anyone who doesn't bother to look at the HTML source of the contact page (i.e. not hidden at all). Commented Aug 12 at 2:25
  • I have also struggled with postfix. Please look at this question and answer, the references quoted may also help you. superuser.com/q/1877944 Commented Aug 12 at 15:43

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.