Forums & Blog

A SmarterTools-sponsored community.
Welcome to Forums & Blog Sign in | Join | Help
in Search

Imail conversion, Display Name shows as "System.Byte"

Last post 11-05-2009 8:57 PM by AutumnSara. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 06-04-2009 9:35 AM

    Imail conversion, Display Name shows as "System.Byte"

    Hello -

    Has anyone else had this trouble?  When I run the conversion utility from 10.01 Imail system to SmarterMail, all the mail and settings carry over fine except for anyone who has the "Name" with multiple words, such as first name + last name.  The result is the "Display Name" in SmarterMail shows up as "System.Byte".

    The Imail registry is clean, the convert.exe has been run, and the conversion utility shows no errors in test mode or in the actual conversion.  I've run the conversion to store things in local temp folders, directly to the SmarterMail server, and any other options in the conversion utility I hadn't messed with before, and it always produces this result.

    When I run this, both Imail services are stopped, and I've tried with SmarterMail both running and not, neither seem to make a difference.

    Ideas?

  • 07-27-2009 1:30 PM In reply to

    Re: Imail conversion, Display Name shows as "System.Byte"

    I know it's been a while... I hope this is still helpful to you.  I am converting a ton of domains and this issue is really irritating.  So today, I hunkered down and put some brain cells on fixing it.

    The main issue is that the conversion utility assumes that the "FullName" key that it grabs from the registry will be in a string format.  Apparently, this is not always true.  I don't know if it's with newer versions of IMail or what, but somewhere along the line, they started using binary keys to represent "FullName," so I had to tweak the code to check the type returned and convert a binary value to a string.

    Here's the code that I added to Utility.cs around line 1173, if anyone is interested (or if someone wants to add it to the unofficially "official" distribution):

    // Read FullName value into an object
    object objFullName = userKey.GetValue("FullName", "");

    // Check to see if the value is a string
    if (objFullName.GetType().ToString() == "System.String")
    {
        // If it is, call SetFirstAndLastNames
        mb.SetFirstAndLastNames(objFullName.ToString());
    }
    else
    {
        // Otherwise, it's a binary value, and we have to cast it to a byte array and convert it to a string
        byte[ bFullName = (byte[)userKey.GetValue("FullName", "");

        // This part trims off the last byte, which is always "00" for some reason
        byte[ bFullName2 = new byte[bFullName.Length - 1];
        for (int i = 0; i < bFullName.Length - 1; i++)
        {
            bFullName2Idea = bFullNameIdea;
        }
        mb.SetFirstAndLastNames(System.Text.Encoding.ASCII.GetString(bFullName2));
    }

    Here's the link to the .dll file (zipped up).  Just unzip it and overwrite the existing MailDomainConversionUtilities.dll file, and it should work.

    http://antidumb.com/dump/MailDomainConversionUtilities.dll.zip

    Note: This was a quick and dirty hack.  It seems to work just fine, but don't hold me liable if it breaks something Stick out tongue

  • 11-05-2009 8:57 PM In reply to

    Re: Imail conversion, Display Name shows as "System.Byte"

    Normal 0 false false false MicrosoftInternetExplorer4 <!-- /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:""; margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman";} @page Section1 {size:8.5in 11.0in; margin:1.0in 1.25in 1.0in 1.25in; mso-header-margin:.5in; mso-footer-margin:.5in; mso-paper-source:0;} div.Section1 {page:Section1;} --> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;}

    In my opinion you will never get one Imail system that will serve all your needs, they all have pros and cons, so I prefer to make a decision on a per site basis, depending on the functionality the site needs, skill level of the data  etc.

Page 1 of 1 (3 items)