PHP Doesn't send emails

I don’t know why, but it looks like postfix just isn’t going to work. This is what I get after I try to telnet to my server:

220 linode-domain-111.members.linode.com ESMTP Postfix (Ubuntu)
ehlo mydomain.net
mail from: [email protected]
rcpt to: [email protected]
data
Subject: My first mail on Postfix

Hi,
Are you there?
regards,
Admin
.250-linode-domain-111.members.linode.com 
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-AUTH PLAIN LOGIN LOGIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
250 2.1.0 Ok
451 4.3.0 <[email protected]>: Temporary lookup failure
554 5.5.1 Error: no valid recipients
221 2.7.0 Error: I can break rules, too. Goodbye.
Connection closed by foreign host.

As a result - PHP doesn’t send emails.

mailq:

$ mailq
-Queue ID- --Size-- ----Arrival Time---- -Sender/Recipient-------
67D0F11F449      216 Wed Dec 24 12:03:28  [email protected]
                                         [email protected]

7735911F446      216 Wed Dec 24 12:03:24  [email protected]
                                         [email protected]

AD0E711F4CD      774 Wed Dec 24 12:15:03  root
                                         root

3366B11F1A7      774 Wed Dec 24 12:00:02  root
                                         root

BBE9311F51E      774 Wed Dec 24 12:20:02  root
                                         root

3C9D311F3EE      774 Wed Dec 24 12:05:02  root
                                         root

EA58911F4D4      774 Wed Dec 24 12:10:01  root
                                         root

C9EFE11F4C6      774 Wed Dec 24 11:55:02  root
                                         root

0FCBC11F51B      773 Wed Dec 24 12:25:02  root
                                         root

-- 5 Kbytes in 9 Requests.

EasyEngine (ee) version: 2.2.2 and I just did a full ee system remove and ee system install.


For some reason, I’m thinking - could this have something to do with Cloudflare or Gmail ? I have all my MX records set to Google ( using Google Mail for mydomain.net ) and everything ( *.mydomain.net ) is filtered with Cloudflare, except for “linode.mydomain.com”. That means ( for example ) if you’re trying to ssh mydomain.net you’re not actually trying to ssh my server, but rather a cloudflare node. The only way to directly access my server is either via IP, Linode Domain or linode.mydomain.net

(in setup) when I was asked for FQDN I entered mydomain.net, so I’m thinking this might be the cause ( in combination with cloudflare ) for all this.

Any ideas ?

Merry Christmas :slight_smile:

Edit:

I tried this as well, so it might not be an issue with the domain names after all:

ehlo localhost
mail from: root@localhost
rcpt to: root@localhost
data
Subject: My first mail on Postfix

Hi,
Are you there?
regards,
Admin
.250-linode-domain-111.members.linode.com
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-AUTH PLAIN LOGIN LOGIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
250 2.1.0 Ok
451 4.3.0 <root@localhost>: Temporary lookup failure
554 5.5.1 Error: no valid recipients
221 2.7.0 Error: I can break rules, too. Goodbye.
Connection closed by foreign host.

bump

I still need help with this :frowning:

Come one peeps. Somebody ? Anybody ? I really need help with this, I can’t figure it out…

Did you use easyengine to install mail server? i.e. ee stack install mail command.

You can try - https://rtcamp.com/tutorials/php/test-email-sending/

Also go through this checklist - https://rtcamp.com/tutorials/mail/fqdn-reverse-dns-ptr-mx-record-checks/

Can you please check` - https://rtcamp.com/tutorials/mail/postfix-queue/ and https://rtcamp.com/tutorials/mail/postfix-debugging/

I think reason for mails getting stuck can be found in postfix log.

The logs show a map problem.

Jan 16 10:32:13 mydomain postfix/pickup[14440]: 35E82127B45: uid=0 from=<root>
Jan 16 10:32:13 mydomain postfix/cleanup[10989]: warning: mysql:/etc/postfix/mysql/virtual_alias_maps.cf is unavailable. unsupported dictionary type: mysql
Jan 16 10:32:13 mydomain postfix/cleanup[10989]: warning: mysql:/etc/postfix/mysql/virtual_alias_maps.cf lookup error for "[email protected]"
Jan 16 10:32:13 mydomain postfix/cleanup[10989]: warning: 35E82127B45: virtual_alias_maps map lookup problem for [email protected] -- message not accepted, try again later

I have installed the mail with easy-engine, and I’ve also tried reinstalling it. Nothing helped.

By the way - the problem started when I upgraded EE from 1.4.X to 2.X

Ok, some unix magic happened again.

I did:

ee stack uninstall postfix
ee stack purge postfix
ee stack install

and now sending mail works again…

I swear I did the exact same thing 3 weeks ago and nothing happened…

Hi @justnorris

Glad that it finally worked out for you.

I am closing this support topic for now. Feel free to create a new support topic if you have any queries further. :slight_smile: