EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Set custom message for non-MIME clients

Also by EldoS: CallbackDisk
Create virtual disks backed by memory or custom location, expose disk images as disks and more.
#22124
Posted: 10/23/2012 07:40:15
by Niklas Kjellander (Standard support level)
Joined: 09/30/2008
Posts: 49

Is it possible to set a custom message for non-MIME clients where the following text appears in a multi part mail message:
Quote
This is a message with multiple parts in MIME format.
?

/Niklas Kjellander
#22126
Posted: 10/23/2012 07:48:34
by Vsevolod Ievgiienko (EldoS Corp.)

Thank you for contacting us.

Its not possible using SecureBlackbox. You can manually write MIME header, then write "This is a message with multiple parts in MIME format." and multipart message body.
#22129
Posted: 10/23/2012 07:59:11
by Niklas Kjellander (Standard support level)
Joined: 09/30/2008
Posts: 49

I'm not quite sure that I understand how you would go about to do what you just described. A sample in C# would be nice.
#22130
Posted: 10/23/2012 08:11:19
by Vsevolod Ievgiienko (EldoS Corp.)

Here is a sample message from Wikipedia:
Code
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary=frontier

This is a message with multiple parts in MIME format.

--frontier
Content-Type: text/plain

This is the body of the message.
--frontier
Content-Type: application/octet-stream
Content-Transfer-Encoding: base64

PGh0bWw+CiAgPGhlYWQ+CiAgPC9oZWFkPgogIDxib2R5PgogICAgPHA+VGhpcyBpcyB0aGUg
Ym9keSBvZiB0aGUgbWVzc2FnZS48L3A+CiAgPC9ib2R5Pgo8L2h0bWw+Cg=
--frontier--


The problem is that MIMEBlackbox doesn't allow to add a text before the 1st boundary (--frontier). You can create a message using MIMEBlackbox and then insert your text manually as its shown in the sample above.

BTW, its hard to find non-MIME clients nowadays.
#22138
Posted: 10/23/2012 10:18:49
by Niklas Kjellander (Standard support level)
Joined: 09/30/2008
Posts: 49

I tried to load the sample message into an TElMessage object using the ParseMessage method, wich seemed to work fine. Then I saved it to a file using a FileStream as argument to AssembleMessage. When I exammine the file the body text from the sample is replaced with the text mentioned earlier. Maybee I have the wrong idea about how to
Quote
insert your text manually
.

Any ideas?
#22140
Posted: 10/23/2012 13:59:21
by Vsevolod Ievgiienko (EldoS Corp.)

"insert your text manually" means that you should parse an output message manually without SecureBlackbox.
#22141
Posted: 10/23/2012 15:17:54
by Ken Ivanov (EldoS Corp.)

When it comes to CLR languages, everything in the world is possible via reflection. The non-MIME viewer warning is stored as a static constant in a SBMIME.__Global class. You can alter its value before assembling messages in the following way:
Code
            Assembly asm = Assembly.GetAssembly(typeof(SBMIME.TElMessage));
            Type[] types = null;
            try
            {
                types = asm.GetTypes();
            }
            catch (ReflectionTypeLoadException ex)
            {
                types = ex.Types;
            }
            for (int i = 0; i < types.Length; i++)
            {
                if (types[i].FullName == "SBMIME.__Global")
                {
                    FieldInfo fi = types[i].GetField("cCapMultiPart", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static);
                    if (fi != null)
                    {
                        fi.SetValue(null, Encoding.UTF8.GetBytes("My custom warning for non-MIME browsers"));
                    }
                    break;
                }
            }
#22148
Posted: 10/24/2012 03:03:25
by Niklas Kjellander (Standard support level)
Joined: 09/30/2008
Posts: 49

Would you consider to add a feature to the message/message part that makes it possible to set your own text that is not global in the application/app domain?
#22149
Posted: 10/24/2012 03:06:30
by Vsevolod Ievgiienko (EldoS Corp.)

You can add this feature to our wish-list: https://www.eldos.com/sbb/wishlist.php
Also by EldoS: CallbackFilter
A component to monitor and control disk activity, track file and directory operations (create, read, write, rename etc.), alter file data, encrypt files, create virtual files.

Reply

Statistics

Topic viewed 832 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!