• Home
  • The Song
  • The Avatar
  • The Cat
  • Contact the Cat

Gyp the Cat dot Com

Computers

How to fix Mail Loops Back to Myself

Everytime I’ve come across Postfix, Qmail or Exim (or some derivative thereof) complaining that “Mail Loops Back to Myself” it’s always been the same thing.

If the next hop of an SMTP conversation the next relay step responds with the same mailname or hostname as the initial server it thinks it’s talking to itself.

In my humble opinion a better (and clearer) mail message would be “I appear to be sending email to myself and that will cause a loop, so instead I’m sending you the email back before I break myself”.

The example I’ve come across recently was like this (and highlighted with hindsight):

  1. Firewall had a rule that traffic from WAN (internet) to it’s IP address on port 25 got redirected to the internal IP of the Exchange server.
  2. Someone had (correctly I might add), added the FQDN of the WAN side IP address as the mailname for the Exchange box, something like mail.companya.com.
  3. At a later date the company had bought an email filtering appliance, and set up a rule on it to forward mail to the IP of the Exchange server and changed the firewall rule to send to the email filtering appliance as opposed to the Exchange server.
  4. The email filter then had the FQDN of the WAN side IP address as the mailname for the SMTP server.
  5. No mail could be delievered inbound or outbound and the famous “Mail Loops Back to Myself” message came up when attempting to send mail to companya.com.

The problem?  Well both the Exchange server and the email filtering appliance both greeted each other with mail.companya.com, so there thought they were the same server.

The solution?  Changing the hostname of the Exchange server fixed the problem instantly.

Related

Written by gyp - October 13, 2010 - 6747 Views
Tags | internet, smtp

You Might Also Like

Installing Nginx (LEMP) on Ubuntu 11.10

April 29, 2012

How to Log BIND Queries on Ubuntu 12.10

September 14, 2012

Securing WordPress from Brute Force Attacks by Country Blocking on Nginx

July 11, 2015

No Comment

Please Post Your Comments & Reviews
Cancel reply

Your email address will not be published. Required fields are marked *

Previous Post
Next Post

Latest Posts

  • Kusto Geolocation IP Lookup
  • Monitoring Tor Usage in Azure Sentinel, ASC, MDATP and ALA
  • HTTP to HTTPS Redirect on Azure CDN
  • Strongswan IPSec (Including Cryptomap) to Microsoft Azure Virtual Network Gateway
  • Black Ops 3 NAT Type Strict & PS4 NAT Type 3 with pfSense Fixed!
  • Sorry for the lack of posts
  • How to Block Internet Access with Group Policy (GPO)
  • Enforcing Microsoft Office 365 and Azure Tennancy with McAfee Web Gateway (MWG)
  • Scanning Subnet for Issuing Certificate Authority with OpenSSL
  • How to Configure Windows 2012 NPS for Radius Authentication with Ubiquiti Unifi

Top Posts & Pages

  • How to Block Internet Access with Group Policy (GPO)
    How to Block Internet Access with Group Policy (GPO)
  • How to Configure Windows 2012 NPS for Radius Authentication with Ubiquiti Unifi
    How to Configure Windows 2012 NPS for Radius Authentication with Ubiquiti Unifi
  • Kusto Geolocation IP Lookup
    Kusto Geolocation IP Lookup
  • Tinyproxy A Quick and Easy Proxy Server on Ubuntu
    Tinyproxy A Quick and Easy Proxy Server on Ubuntu
  • Monitoring Tor Usage in Azure Sentinel, ASC, MDATP and ALA
    Monitoring Tor Usage in Azure Sentinel, ASC, MDATP and ALA
  • How to DNSPerf on Ubuntu 14.04 with Installation and Quick Start
    How to DNSPerf on Ubuntu 14.04 with Installation and Quick Start
  • How to Add Different Disclaimers using alterMIME and Postfix based on Domain
    How to Add Different Disclaimers using alterMIME and Postfix based on Domain
  • Blocking Countries on Nginx without the GeoIP Module
    Blocking Countries on Nginx without the GeoIP Module
  • How to Enable Squid Anonymous Stealth Mode
    How to Enable Squid Anonymous Stealth Mode
  • Configuring Suite B, VPN-A and VPN-B in IPSec with Strongswan
    Configuring Suite B, VPN-A and VPN-B in IPSec with Strongswan

Tags

apache2 azure azure log analytics blops business centos cheating cissp cloudflare cryptography dns game google gyp internet iphone ipsec isc linux mac marketing microsoft mw2 mx mysql nginx pfsense postfix proxy ps3 qualification radius revision security seo smtp socks squid ssh strongswan tinyproxy ubuntu windows 2012 wordpress xdecrypt.com
Gyp the Cat dot Com

Some rights retained Gyp the Cat Dot Com