• 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 - 5642 Views
Tags | internet, smtp

You Might Also Like

Nginx Not Showing Client IP and Varnish Not Forwarding Client IP

October 2, 2012

Gyp the Cat dot Com First Birthday

September 30, 2011

How to Block Internet Access with Group Policy (GPO)

July 9, 2017

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

  • 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
  • Steam & Valve IP Ranges

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
  • ISEB Business Analysis (BA) Revision Notes
    ISEB Business Analysis (BA) Revision Notes
  • How to Add Different Disclaimers using alterMIME and Postfix based on Domain
    How to Add Different Disclaimers using alterMIME and Postfix based on Domain
  • Bonding Interfaces on Ubuntu 12.04LTS
    Bonding Interfaces on Ubuntu 12.04LTS
  • How to fix Mail Loops Back to Myself
    How to fix Mail Loops Back to Myself
  • Installing Nginx (LEMP) on Ubuntu 11.10
    Installing Nginx (LEMP) on Ubuntu 11.10
  • Why Does Lightening McQueen Stick His Tongue Out?
    Why Does Lightening McQueen Stick His Tongue Out?
  • Using SSH as a SOCKS VPN on Mac OS
    Using SSH as a SOCKS VPN on Mac OS
  • Strongswan IPSec (Including Cryptomap) to Microsoft Azure Virtual Network Gateway
    Strongswan IPSec (Including Cryptomap) to Microsoft Azure Virtual Network Gateway

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