OS: Debian GNU/Linux 12 (bookworm) aarch64
Postfix mail_version: 3.7.11
Cloudflare DNS Configuration:
Cloudflare DNS Configuration
A Record:
<mydomain.com>. IN A <my ip address>
MX Record:
<mydomain.com>. IN MX 10 mail.<mydomain.com>.
Postfix Configuration (/etc/postfix/main.cf):
myhostname = mail.<mydomain.com>.
mydomain = <mydomain.com>
myorigin = $mydomain
inet_interfaces = all
inet_protocols = all
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
mynetworks = 127.0.0.0/8, [::1]/128, <my ip address>/32
home_mailbox = Maildir/
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no
append_dot_mydomain = no
readme_directory = no
smtp_use_tls = yes
smtp_tls_security_level = may
smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls = yes
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
command to send email using SMTP:
echo "This is the body of the email." | mailx -s "Subject of the Email" -a "FROM:[email protected]" <[email protected]>
mailq log:
B086D830AD 345 Fri Aug 2 00:44:37 [email protected]
(connect to alt4.gmail-smtp-in.l.google.com[74.125.200.27]:25: Connection timed out)
<[email protected]>
Current Issues:
Connection Timed Out: When attempting to connect to external SMTP servers (e.g., Gmail), I receive a “Connection timed out” error.
Relay Access Denied: When sending an email to any external address (e.g., Gmail), I get a “454 4.7.1 Relay access denied” error.
Logs:
Question: how can I fix this issue so I can send emails to [email protected] useing my SMTP server?
Any help or insights would be greatly appreciated!
Troubleshooting Steps Taken:
Verified no local firewall rules are blocking outgoing SMTP connections.
Checked DNS resolution with nslookup and dig.
Verified network routing to ensure a default route exists.
Ensured no IP blacklisting by using tools like MXToolbox.
Tested connectivity with telnet smtp.gmail.com 25 (no response).
Additional Information:
The IP address is currently blacklisted on Barracuda and RATS Dyna.
There is no external relay configured.