The administration and maintenance of Microsoft Exchange Server to ensure secure, reliable, and efficient email and collaboration services across an organization.
Based on your description, I understand you are running an Exchange Server 2016 environment where an internal application sends automated emails via a custom receive connector. However, some messages fail on the first attempt and require multiple retries to send successfully. Your Exchange SMTP receive logs specifically reveal the following events:
-
Tarpit for '0.00:00:05' due to 'IP discredited' -
Remote(SocketError)
The specific limit responsible for this behavior is the TarpitInterval on your Receive Connector, not MessageRateLimit or connection throttling rules. In Exchange Server, tarpitting is an anti-abuse mechanism that intentionally introduces a delay in processing SMTP responses for unauthenticated connections that trigger protocol errors or rejections (such as trying to send to non-existent internal mailboxes or attempting to relay to external domains without permission).
Every time your application hits a protocol restriction, Exchange adds "bad points" to that source IP. Once a threshold is breached, Exchange flags the IP as "discredited" and penalizes it with a 5-second artificial delay (the default TarpitInterval). Because many internal applications are not built to gracefully wait out a delayed socket response, your application times out mid-execution, throwing a Remote(SocketError) and forcing a retry.
-If this is a dedicated connector handling trusted internal traffic, you can disable the artificial delays.
Open the Exchange Management Shell (EMS) and run the following commands:
# 1. Identify your exact connector (verify using the 'connector-id' field in your SMTP log)Get-ReceiveConnector | Format-Table Name, TarpitInterval, RemoteIPRanges, Enabled
Warning: Only disable this feature on connectors strictly bound to trusted internal servers via the RemoteIPRanges attribute. Never disable tarpitting on Internet-facing or default anonymous public connectors.
-Disabling the tarpit stops the 5-second delay, but it doesn't fix whatever error originally caused Exchange to discredit the IP. To fix this permanently, review your connector's properties:
$conn = Get-ReceiveConnector | Where-Object {$_.Name -like "*YourApp*"} # Adjust filter$conn | Format-List Name, Enabled, TransportRole, Bindings, RemoteIPRanges, AuthMechanism, PermissionGroups, TarpitInterval
Ensure your application server's IP is explicitly defined in RemoteIPRanges. If your application needs to relay mail anonymously to external domains, ensure you have explicitly granted relay permissions to the anonymous logon group on that specific connector:
Get-ReceiveConnector "YourCustomConnectorName" | Add-ADPermission `
-If your application supports it, the most secure and modern configuration is to switch from an Anonymous SMTP Relay to Authenticated SMTP Submission:
- Configure the application to connect via Port 587 using STARTTLS.
- Pass dedicated service account credentials via SMTP AUTH.
Authenticated users bypass anonymous reputation tracking entirely, shielding your app from being marked as an "IP discredited" source.
When tuning, do not adjust these parameters first, as they handle separate volume throttling thresholds and are not the cause of an "IP discredited" log event:
-
MaxInboundConnection/MaxInboundConnectionPerSource -
MessageRateLimit/MessageRateSource
Please refer to the official documentations for further deep dives into message handling mechanics.
Receive connectors | Microsoft Learn
https://learn.microsoft.com/en-us/Exchange/mail-flow/message-rate-limits
I hope this information help.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click ""Comment"".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.