Search code examples
c#imappop3

How can I detect if my fetched email is bounced or not


I fetched emails from servers by using IMAP or POP3 and entered the fetched emails to database but I noticed there are a lot of bounced emails entered to the system so I searched a lot on google to check fetched email and if it's bounced email I'll not enter it to the system and I found library BounceDetectResult to detect if email is bounced or not but this library working only with message type MimeMessage so It's useful when I use IMAP but it's not work with message type OpenPop.Mime.Message so I can't use It when I use POP3

 var result= BounceDetectorMail.Detect(message);//message type MimeMessage
        if (result.IsBounce) 
        {
            em.DelivaryFailure = true;
        }

so my problem I didn't find way to detect if my retrieved message is bounced or not when I use pop3 in retrieving


Solution

  • It looks like the MailBounceDetector library that you mentioned uses my MimeKit library to detect if a message is a bounced message or not.

    The good news is that you can use that library because I also have a library that does POP3 called MailKit, so you can use that instead of OpenPOP.NET.