I am having a hard time setting up Postfix on my Aws Ubuntu server. I started with a clean server and installed Sentora and Laravel.
1.First I have opened port 25 on AWS Securty.
2.Than I have configured email in Laravel:
MAIL_DRIVER=smtp
MAIL_HOST=my-domain.com
MAIL_PORT=25
MAIL_USERNAME=office@my-domain.com
MAIL_PASSWORD=password
MAIL_ENCRYPTION=false
3.Than in index.php I try a simple test:
<?php
// the message
$msg = "First line of text\nSecond line of text";
// use wordwrap() if lines are longer than 70 characters
$msg = wordwrap($msg,70);
// send email
mail("someone@example.com","My subject",$msg);
?>
After 5 test emails, I end up with 2 in my inbox (yahoo), due to:
Connection could not be established with host my-domain .com [Connection timed out #110]
If I run a test on POSTFIX via terminal I get the following:
ubuntu@cpanel:~$ telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 cpanel.pe-scena.ro ESMTP
ehlo localhost
mail from: office@my-domain.com
rcpt to: vedt@yahoo.com
data
Subject: My first mail on Postfix
Hi,
Are you there?
regards,
Admin
.250-cpanel.my-domain.com
250-PIPELINING
250-SIZE 20480000
250-ETRN
250-AUTH PLAIN LOGIN
250-AUTH=PLAIN LOGIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
250 2.1.0 Ok
250 2.1.5 Ok
403 4.5.0 <DATA>: Data command rejected: Improper use of SMTP command pipelining
221 2.7.0 Error: I can break rules, too. Goodbye.
Connection closed by foreign host.