Using Win Server 2003 we send once every while we send out 200k+ emails and obviously the badmail folder get filled up. Its easy to delete them but I started looking for some way to actually get some statistics back from the bad mail but I cannot find any tools?
How can I find out how many Non Deliveries/ Delayed there are and possibly a list for each. Or am I looking at this from the bottoms end?
Write my own service to monitor a file using the .NET FileSystemWatcher Class
1 Problem i encountered was that
FileSystemWatcherreports filecreations onCreate– but the Parent program can still be writting the file if you try to query it so it will thrown an exception.fileNotAccessible. (The only way to determine if a file is in use is trying to open it and catch the exception)To overcome that problem i just catch that exception and put the file name into a Queue and in a Timer of 1-5minutes i re query the
Queuefilenames- by then the file should have been written and closed by the parent program.I then parse the email content based on error code, reason, etc (bounced mails) and insert it into my DB – I get allot of out of office mails too.
I did not use any email parser DLL’s but for robust email parsing i would suggest you find something as it seems emails follow a standard.. but not very strict and they tend to vary slighlty.
Email Parser example
I do all the magic required to make my class a service, install it on your mail server and let it monitor it.