<p>Can anyone recommend software or a .NET library that will check for bounced emails and the reason for the bounce? I get bounced emails into a pop3 account that I can read then.</p>

<p>I need it to keep my user database clean from invalid email addresses and want to automate this (mark user as invalid email).</p>

[{'answer_id': 7249, 'author': 'Robert Ellison', 'author_id': 2521991, 'author_profile': 'https://Stackoverflow.com/users/2521991', 'pm_score': 2, 'selected': False, 'text': '<p>It\'s pretty easy to do with a TcpClient. Open the server:</p>\n\n<pre><code>TcpClient tcpClient = new TcpClient();\ntcpClient.Connect(POP3Server, POP3Port);\nNetworkStream stream = tcpClient.GetStream();\n</code></pre>\n\n<p>Read the welcome message:</p>\n\n<pre><code>int read = stream.Read(inBuffer, 0, inBuffer.Length);\nstring response = Encoding.ASCII.GetString(inBuffer, 0, read);\nif (response.IndexOf("+OK") != 0) throw new ...;\n</code></pre>\n\n<p>Write back to the server:</p>\n\n<pre><code>byte[] outBuffer = Encoding.ASCII.GetBytes("USER " + account + "\\r\\n");\nstream.Write(outBuffer, 0, outBuffer.Length);\n</code></pre>\n\n<p>That sends the USER command. You need to login and then you can start grabbing messages - see the POP3 <a href="http://www.faqs.org/rfcs/rfc1939.html" rel="nofollow noreferrer">RFC</a> for the full list of commands. If you\'re not looking to roll your own check out this <a href="http://www.codeproject.com/KB/IP/despop3client.aspx" rel="nofollow noreferrer">CodeProject article</a>.</p>\n'}, {'answer_id': 7486, 'author': 'jj33', 'author_id': 430, 'author_profile': 'https://Stackoverflow.com/users/430', 'pm_score': 2, 'selected': False, 'text': '<p>as <a href="https://stackoverflow.com/questions/7231/automatically-check-bounced-emails-via-pop3#7249">abfo says</a>, the POP3 protocol is super simple, getting the messages is a no brainer.  Parsing the messages to get the failures is harder, and reliably parsing out which email caused the failure and why it failed is really hard.  The problem is that bounce messages don\'t have a standard format, the default forms vary from MTA to MTA.  Then the failure reason can be tweaked by the site admin making it harder to recognize, and the site admin could modify the failure message template which makes it darn near impossible.</p>\n\n<p>See if you can find a .NET mailing list manager and if you can repurpose the bounce handling code.  Failing that, see if you can change the tool that\'s sending the messages to send each email from a unique (and reversible) enveloper sender (VERP I think it\'s called?).  That way you don\'t need to scan the body of the email, you can tell which recipient failed by examining the recipient address of the failure message.</p>\n'}, {'answer_id': 7499, 'author': 'Tanerax', 'author_id': 567, 'author_profile': 'https://Stackoverflow.com/users/567', 'pm_score': 4, 'selected': True, 'text': '<p>I have done a great deal of work handling bounce emails and there different types. If you want to be absolutely sure that the email your looking at is indeed a bounce of a specific kind I highly recommend getting a good filter. I have worked with <a href="http://www.boogietools.com/" rel="noreferrer">Boogie Tools</a> and it has worked very well. It lets you know what kind of bounce it is, Hard, Soft, Transient or if its even someone trying to unsubscribe. It has a muliple API\'s including .Net and I found it quite easy to get working. </p>\n'}, {'answer_id': 7616, 'author': 'Johannes', 'author_id': 925, 'author_profile': 'https://Stackoverflow.com/users/925', 'pm_score': 0, 'selected': False, 'text': '<p>Thanks for the answer, great!\nI did some research myself and found <a href="http://www.advancedintellect.com/product.aspx?listnanny" rel="nofollow noreferrer">ListNanny</a> - also super simple to use and tells you the type of bounce. Will write some proof of concept and see which one I like better...</p>\n'}, {'answer_id': 429476, 'author': 'lkessler', 'author_id': 30176, 'author_profile': 'https://Stackoverflow.com/users/30176', 'pm_score': 0, 'selected': False, 'text': '<p>Your question made me realize that the Wordpress Newsletter plugin I was going to use, did not have bounce management, and I\'d need something as well.</p>\n\n<p>I looked around for awhile, and I\'ve settled on the free and open-source <a href="http://www.phplist.com/" rel="nofollow noreferrer">PHPlist newsletter manager</a>.</p>\n\n<p>They describe in detail <a href="http://docs.phplist.com/PhpListConfigBounces" rel="nofollow noreferrer">their settings for handling bounces</a> and they do have an experimental <a href="http://docs.phplist.com/AdvancedBounceHandlingInfo" rel="nofollow noreferrer">advanced bounce handling feature</a> that will allow you to customize the bounce handling exactly the way you want.</p>\n\n<p>Evem if you decide not to use PHPlist, reading how they do it will be useful information for you.</p>\n'}]
['https://Stackoverflow.com/questions/7231', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/925/']