POP3 Connector chokes on messages with invalid header
Problem
If you are using the POP3 Connector on Windows SBS 2008, you may encounter this error in the event log
One or more (5) e-mail messages in the POP3 mailbox account ‘<email address>’ on the POP3 server ‘<server name>’ have invalid header fields. Because of this, the messages cannot be delivered to the Exchange Server mailbox ‘<mailbox>’ in Windows Small Business Server. The messages are still on the POP3 server. To resolve this issue, connect to the POP3 mailbox account, and then manually retrieve or delete the messages.
By default the POP3 connector will stop processing new messages after 5 protocol errors so once this happens, you will not receive any email.
Solution
The quickest and easiest thing to do is to increase the MaxProtocolErrors from 5 to something bigger like 999. You can do this with the following command:
Set-ReceiveConnector -identity ($Env:computername + “\Windows SBS Fax Sharepoint Receive ” + $Env:computername) -MaxProtocolErrors 999
This will allow the remaining messages to be downloaded, but the messages with invalid headers will still not be downloaded. Once you accumulate 999 messages with invalid headers, the problem will still occur.
To fix this you either have to login to your ISP’s mail server and delete the messages manually or figure out why the messages have bad headers. In my case, the problem was that the messages had an invalid Return-Path: header that looked like this:
Return-Path: <MAILER-DAEMON>
I noticed that most of the messages were automated responses such as “out-of-office” replies. The problem is the MAILER-DAEMON is not a valid email address format. Valid email addresses must have an @ sign in them. The workaround I found was to tell Exchange to append the local domain name. Here is the command for that:
Set-ReceiveConnector -Identity ($Env:computername + “\Windows SBS Fax Sharepoint Receive ” + $Env:computername) -DefaultDomain $Env:UserDNSDomain
Once I did that, the POP3 connector was able to download the messages with invalid headers and the errors in the event log went away.
Other resources:
http://www.tech-archive.net/Archive/Windows/microsoft.public.windows.server.sbs/2009-03/msg00163.html
http://www.tech-archive.net/Archive/Windows/microsoft.public.windows.server.sbs/2011-09/msg00014.html
https://blogs.technet.microsoft.com/sbs/2009/07/01/sbs-2008-introducing-the-pop3-connector/
😀
THANK YOU very much for this final and brilliant solution !!
Since we jumped from the ever-working SBS2003 up to the SBS2011 = Exchange 2010sp1, from time to time we had this very issue that random users did not receive any external emails (POPers) anymore – to delete bad emails on the ISP’s webmailer manualy – the by MS proposed solution 👿 ) was realy not a professional solution, not even a good workaround.
The “go from (5) to (999) is a childish thing too; YOUR thing to fix the header is the right thing and worked immediately on a blocked user – I even must not manualy delete his (5) bad email but only apply Your soluten and bang, all the 87 blockes emails rushed into his Outlook again!! Thumbs up and Thanks to You – Blame to Microsoft to carry over this idiotic errors since Exch 2007!!!
Greets Frank
Thanks for your solution, but since I set this up, some (let’s say 75%) of the messages that are received with ConnectorID “SBSWindows SBS Fax Sharepoint Receive SBS” are not delivered to the recipient. I can see this in the Message Tracking log.
Do you have any idea where I can find those messages?
Using SBS 2011.
Thnx in advance
I have try running these commands and keep getting errors.
Cannot process argument transformation on parameter ‘Identity’. Cannot convert value “SBSWindows SBS Fax Sharepoint Re
ceive SBS ” to type “Microsoft.Exchange.Configuration.Tasks.ReceiveConnectorIdParameter”. Error: “‘SBSWindows SBS Fax
Sharepoint Receive SBS ‘ is not a valid value for the identity.
Parameter name: Identity”
+ CategoryInfo : InvalidData: (:) [Set-ReceiveConnector], ParameterBindin…mationException
+ FullyQualifiedErrorId : ParameterArgumentTransformationError,Set-ReceiveConnector
Have any idea what I am doing wrong SBS 2011
Any solution for the problem that Kevin told?
You GENIUS!!!
Had this problem for months on a client server, your solution regards appending the local domain name works a treat! Thank you! 🙂
not sure if you will see or answer this. the script does not work because my server name contains a hyphen: the-server, for example. the script sees the hypen and thinks it is denoting a parameter. I’ve tried quotes and parentheses around the name but that doesn’t work… any idea how to work around the name?
Worked great for me, thanks.
Bravo!
Nice fix. I have had this problem for years and just decided to do something about it.works perfectly. Well done
Better late than never. My solution was a little bit different. The DefaultDomain value was blank, so I ran:
set-receiveconnector “Windows SBS Fax Sharepoint Receive” -defaultdomain mydomain.com
and the problem was solved.
To verify the value of DefultDomain, I used:
Get-ReceiveConnector “Windows SBS Fax Sharepoint Receive” | Format-List
Thanks for the hint.