FTGate 7.4 includes the MimeKit assembly (https://github.com/jstedfast/MimeKit ) to allow more advanced parsing of messages.

An example of accessing MimeKit is as follows:


using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using FTGate.Framework;
using MimeKit;

public class MailboxExtension : MailboxBehaviour
{
    public ProcessMessageReturnType OnProcessMessage(MailMessage message)
    {
        ProcessMessageReturnType retVal = ProcessMessageReturnType.Continue;
        Log log = new Log();
        try
        {
            log.Write(LogType.Normal, "********* Message From:" + message.sender);
            log.Write(LogType.Normal, "********* Subject:" + message.Header["Subject"]);
            using (MimeMessage mime = MimeMessage.Load(message.textPath))
            {
                log.Write(LogType.Normal, "********* Mime Sender:" + mime.From);
            }
        }
        catch (Exception e)
        { 
            log.Write(LogType.Warning, e.Message);
            log.Write(LogType.Warning, e.StackTrace);
        }
        return retVal;
    }

    public bool Desynchronize()
    {
        return false;
        //return true;
    }

}