Mailboxreader stops working if an email contains an image

Topics: General
Aug 14, 2012 at 7:36 AM

Bugnet stops receiving emails if a bugreport in the mailbox contains an image. If I delete the mail in the mailbox, bugnet start receiving mails again.

I am running version 1.1.213.0 and log4net isn't still working, so I can't get more information. The debug output from log4net only shows:

log4net: DefaultRepositorySelector: Creating repository for assembly [BugNET.HttpModules.Authentication, Version=1.1.213.0, Culture=neutral, PublicKeyToken=null]log4net: DefaultRepositorySelector: Assembly [BugNET.HttpModules.Authentication, Version=1.1.213.0, Culture=neutral, PublicKeyToken=null] Loaded From [C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\df6a16e4\1389cbdb\assembly\dl3\5c51ff0e\00b11370_8378cd01\BugNET.HttpModules.Authentication.dll]log4net: DefaultRepositorySelector: Assembly [BugNET.HttpModules.Authentication, Version=1.1.213.0, Culture=neutral, PublicKeyToken=null] does not have a RepositoryAttribute specified.log4net: DefaultRepositorySelector: Assembly [BugNET.HttpModules.Authentication, Version=1.1.213.0, Culture=neutral, PublicKeyToken=null] using repository [log4net-default-repository] and repository type [log4net.Repository.Hierarchy.Hierarchy]log4net: DefaultRepositorySelector: repository [log4net-default-repository] already exists, using repository type [log4net.Repository.Hierarchy.Hierarchy]log4net: DefaultRepositorySelector: Creating repository for assembly [BugNET.Providers.SqlDataProvider, Version=1.1.213.0, Culture=neutral, PublicKeyToken=null]log4net: DefaultRepositorySelector: Assembly [BugNET.Providers.SqlDataProvider, Version=1.1.213.0, Culture=neutral, PublicKeyToken=null] Loaded From [C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\df6a16e4\1389cbdb\assembly\dl3\a699555d\000b7672_8378cd01\BugNET.Providers.SqlDataProvider.dll]log4net: DefaultRepositorySelector: Assembly [BugNET.Providers.SqlDataProvider, Version=1.1.213.0, Culture=neutral, PublicKeyToken=null] does not have a RepositoryAttribute specified.log4net: DefaultRepositorySelector: Assembly [BugNET.Providers.SqlDataProvider, Version=1.1.213.0, Culture=neutral, PublicKeyToken=null] using repository [log4net-default-repository] and repository type [log4net.Repository.Hierarchy.Hierarchy]log4net: DefaultRepositorySelector: repository [log4net-default-repository] already exists, using repository type [log4net.Repository.Hierarchy.Hierarchy]log4net: DefaultRepositorySelector: Creating repository for assembly [BugNET.MailboxReader, Version=1.1.213.0, Culture=neutral, PublicKeyToken=null]log4net: DefaultRepositorySelector: Assembly [BugNET.MailboxReader, Version=1.1.213.0, Culture=neutral, PublicKeyToken=null] Loaded From [C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\df6a16e4\1389cbdb\assembly\dl3\263b988a\00de4471_8378cd01\BugNET.MailboxReader.dll]log4net: DefaultRepositorySelector: Assembly [BugNET.MailboxReader, Version=1.1.213.0, Culture=neutral, PublicKeyToken=null] does not have a RepositoryAttribute specified.log4net: DefaultRepositorySelector: Assembly [BugNET.MailboxReader, Version=1.1.213.0, Culture=neutral, PublicKeyToken=null] using repository [log4net-default-repository] and repository type [log4net.Repository.Hierarchy.Hierarchy]log4net: DefaultRepositorySelector: repository [log4net-default-repository] already exists, using repository type [log4net.Repository.Hierarchy.Hierarchy]log4net: Hierarchy: Shutdown called on Hierarchy [log4net-default-repository]

Developer
Aug 19, 2012 at 2:04 AM

Is the image an attachment or is the image in-line (in the body) of the email?

Aug 19, 2012 at 1:59 PM

The image is inline in the text of the mailbody.

Developer
Aug 19, 2012 at 5:01 PM
Edited Aug 19, 2012 at 5:17 PM

Thanks for your reply.  I have confirmed that this is an issue with the current release.

I am currently re-writing the mailbox reader to make it more stable and enhance it with regards to the following listed below:

  • Gracefully handle exceptions better so the module won’t crash unless it’s a serious issue that cannot be recovered from the next run of the POP3 poll.
  • Refactor/clean up the POP3 client a bit. I have found some code that could trigger unwanted exceptions [System.Diagnostics.Debugger.Break()] in various places. These should not cause to application to crash when the code condition is met. I have changed the code to make sure to check if the debugger is actually attached first.
  • Implement better logging, the POP3 client that is used has an internal event system that raises exception, warning and trace events; I will be leveraging this and hooking it up to the current log4net logging so it will raise warnings when they happen. Warnings from the POP3 client are usually when the client is expecting a certain behavior from the server (per the RFC) but encounters something different. This might help with debugging connection/email issues with different email servers (I have yet to see an actual warning so YMMV with this feature).
  • You will be able to assign a xslt template file to create the issue details. The data that is passed into the template are the email details (from, to, date, content, and attachment names), the project information, the mailbox information and the issue information (after save). This so you can format the details and include info into the issue details from the email.  Since the template file is assigned via the database (using the old [Pop3BodyTemplate] host setting for the file location) you can make your own assigned version and not have to worry about updates to BugNET overwriting it.  If you do not assign a template location it will use the old template format (curently used).
  • Make sure that multi-part emails are handled better. I have found with testing that under certain conditions the body of the email is not being pulled from multi-part emails properly, it seems to be with how the POP3 client handles plain/text emails being forwarded and the server sending them.

For now I would just like to get the module more stable with with better logging. I realize that there are some enhancements that would/should be made:

  • If the mailbox reader is disabled (after x number of consecutive errors) an email should be sent out to someone (all super users and or the [ErrorLoggingEmailAddress] host setting).  Also how to recover from this (other than just recycling the application).
  • Email notification support when an issue is created via the mailbox reader (seems to be a popular one).

As for when this will be done the biggest hurdle is the email body part, testing that requires a lot of time due to the amount of possible scenarios/conditions the majority of the work is done and that is what I am focused on now.

This is a pic of what the default template writes to the details, the FINAL text would be the email body content.

issue details

- William

Aug 20, 2012 at 5:18 PM

Thanks for the quick replay :) I'll wait or let me know if I can help testing.

Developer
Aug 21, 2012 at 2:21 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.