SMTP Mystery

I am at my wit’s end and could use some help.

I’ve inherited some FreePBX systems(14, 15, & 16) that are able to send email… somehow…

/var/log/maillog suggests it’s beeing sent via postfix but I cannot find the postfix config file.

Here’s output from /var/log/maillog:

Jan 12 23:32:54 sub.dom.mydomain.com postfix/smtpd[25894]: connect from sub.dom.mydomain.com[::1]
Jan 12 23:32:55 sub.dom.mydomain.com postfix/smtpd[25894]: 0C1ABBF7A0: client=sub.dom.mydomain.com[::1]
Jan 12 23:32:55 sub.dom.mydomain.com postfix/cleanup[25897]: 0C1ABBF7A0: message-id=<[email protected]>
Jan 12 23:32:55 sub.dom.mydomain.com postfix/smtpd[25894]: disconnect from sub.dom.mydomain.com[::1]
Jan 12 23:32:55 sub.dom.mydomain.com postfix/qmgr[1097]: 0C1ABBF7A0: from=<[email protected]>, size=87927, nrcpt=1 (queue active)
Jan 12 23:32:55 sub.dom.mydomain.com postfix/smtp[25898]: 0C1ABBF7A0: to=<[email protected]>, relay=aspmx.l.google.com[142.250.114.26]:25, delay=0.55, delays=0.08/0.06/0.08/0.34, dsn=2.0.0, status=sent (250 2.0.0 OK  1736746375 46e09a7af769-7231864a298si6252728a34.180 - gsmtp)
Jan 12 23:32:55 sub.dom.mydomain.com postfix/qmgr[1097]: 0C1ABBF7A0: removed

I’ve searched for any gmail configuration in every single file in /etc/postfix (started with main.cf) as well as:

/usr/libexec/postfix

/var/spool/postfix

/var/lib/postfix

Is there another directory somewhere that I would find the configuration? I have scoured the internet to the best of my ability and am here as a last resort. I would deeply appreciate any and all help anyone has to offer

What does the shell command “dig MX mydomain.com” return?

; <<>> DiG 9.18.26 <<>> MX mydomain.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 3172
;; flags: qr rd ra; QUERY: 1, ANSWER: 5, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;mydomain.com.                     IN      MX

;; ANSWER SECTION:
mydomain.com.              300     IN      MX      1 aspmx.l.google.com.
mydomain.com.              300     IN      MX      10 alt3.aspmx.l.google.com.
mydomain.com.              300     IN      MX      10 alt4.aspmx.l.google.com.
mydomain.com.              300     IN      MX      5 alt1.aspmx.l.google.com.
mydomain.com.              300     IN      MX      5 alt2.aspmx.l.google.com.

;; Query time: 10 msec
;; SERVER: 1.1.1.1#53(1.1.1.1) (UDP)
;; WHEN: Mon Jan 13 09:17:02 CST 2025
;; MSG SIZE  rcvd: 153

On the output I posted initially I did not indicate the hostname of the machine has subdomains( I will edit original post)

Here is the output from dig MX sub.dom.mydomain.com

; <<>> DiG 9.18.26 <<>> sub.dom.mydomain.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 142
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;sub.dom.mydomain.com.         IN      A

;; ANSWER SECTION:
sub.dom.mydomain.com.  300     IN      A       69.164.204.243

;; Query time: 10 msec
;; SERVER: 1.1.1.1#53(1.1.1.1) (UDP)
;; WHEN: Mon Jan 13 09:24:38 CST 2025
;; MSG SIZE  rcvd: 66

The server having a subdomain doesn’t really come into play here as far as your logs. It looks as if the server is setup to deliver mail directly over the Internet (i.e. no SMTP relay) and your domain in question is hosted by Google. So it’s going to send mail to Google to try to deliver it to the email account, which is hosted at Google.

Wouldn’t there be a configuration setting somewhere to instruct it to send the mail to google? The only setting I’ve been able to find is the From Address in the GUI at Admin → System Admin → Notification settings

The system is setup to send mail directly from the system to the destinations. It’s how SMTP works by default. So when it is sending email to [email protected] it’s going to lookup the MX records for mydomain.com, those resolve to Google’s SMTP servers. So it will now attempt to deliver the email to the destination servers. Which it is doing.

If you were to move the email hosting of the domain from Google to another provider or your own system, the mail logs would show it being sent to the new destination once the MX records were updated.

It doesn’t matter if it is Postfix, Exim, Sendmail, etc. the default is direct communication unless you configure the SMTP agent to use SMTP Reply. This system is using the default configuration of direct sending/communication.

Should be SMTP Relay

Sure…it would be the better option.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.