Giter Club home page Giter Club logo

mailsystem.net's Introduction

Project Description

MailSystem is a suite of .NET components that provide users with an extensive set of email tools. MailSystem provides full support for SMTP, POP3, IMAP4, NNTP, MIME, S/MIME, OpenPGP, DNS, vCard, vCalendar, Anti-Spam (Bayesian , RBL, DomainKeys), Queueing, Mail Merge and WhoIs

This project licensed under LGPL, you are free to use the compiled binaries in your personal or commercial project for free. If, for some reasons, you want to keep your changes for yourself, you must acquire a commercial license.

Common features:

  • Asynchronous operations
  • Secure connections using SSL
  • Mail signing & encryption/decryption using S/MIME & OpenPGP
  • Separate object for the Message and the clients
  • Fully Accessible Headers
  • Mail encoding customization for globalization
  • Determine if it is a mail server bounce + e-mail address parsing
  • Send from / receive Message object to file and streams

SMTP - Simple Mail Transfer Protocol

  • Direct sending of e-mail without an SMTP server
  • MX server caching (increase by 6 the performance of direct send)
  • Mail queueing systems support
  • Multiple bodies (both HTML and Text)
  • Embedded Objects such as Image, Sound and Video
  • Redundant SMTP Server List (fail over)
  • Secure Authentication

POP3 - Post Office Protocol 3

  • View Mailbox Size and Message Count
  • Download Full Message or Header Only
  • Secure Authentication

IMAP4 - Internet Message Access Protocol 4

  • Manage Mailboxes (list, create, rename, delete, move, empty, etc.)
  • Manage Messages (retrieve, copy, delete, append, etc.)
  • Download Full Message or Header Only
  • Manage flags
  • Extended search features
  • Secure Authentication
  • New message arrival notification support (IDLE command)

NNTP - Network News Transfer Protocol

  • List News groups and Articles Easily
  • Download Full Articles or only Headers
  • Secure Authentication
  • Mail merging and template
  • Load Configuration from XML or Text File
  • Field formatting
  • Bind Bodies with Data Sources (DataTable, ArrayList, Custom collections, ...)
  • Bulk Mailing from a Data Source (in addition to the multiple data bound bodies)

vCard & vCalendar

  • Contact file reading and writing
  • Calendar event reading and writing
  • Sending and receiving a meeting request

Anti-Spam

  • Block list servers support (RBL)
  • Full DomainKeys implementation
  • Learning Bayesian filter
  • Email Addresses Validation Using MX Record Caching
  • Commtouch® anti-spam technology support

DNS

  • Support for individual queries of all types
  • Get mail exchange (MX) records of a DNS server
  • Get all records from a DNS server

WhoIs

  • WhoIs server querying
  • Asynchronous mode
  • Domain name availability check
  • Custom WhoIs server list resource file support

Mail queueing application

In addition to the library, the suite provides the developer with a full featured mail queueing system called ActiveUp.Q that is completed integrated with the solution. This advanced queueing solution includes but is not limited to:

  • Standard or scheduled queueing of complex e-mails
  • Multiple pickup directory support (ideal for ISP's)
  • Automatic Thread load-balancing
  • Powerful service managing to monitor the running and scheduled tasks
  • Fault-tolerant and auto-recovery
  • Execute a GET or POST query on any HTTP web site or intranet
  • Triggers include Daily, Weekly, Monthly or a specific day, week and month of year
  • Multiple XML task list configuration file support

Powered by ndepend

Who's using this

MailSystem is in production use at: Jitbit Helpdesk, SiteCore.net

Last trunk build status

Last trunk build status

mailsystem.net's People

Contributors

linobarreca avatar logikonline avatar pmengal avatar reinaldocoelho avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mailsystem.net's Issues

Connection with Office365

Hi

I am having trouble connecting to Office 365 server with StartTls.

The connection if started with ConnectSsl causes a Handshake error:

System.IO.IOException was unhandled by user code
HResult=-2146232800
Message=The handshake failed due to an unexpected packet format.
Source=System

If initiated with method SmtpClient.Connect, when calling method Authenticate causes this error:

Command "auth login" failed : 504 5.7.4 Unrecognized authentication type [SC1P15201CA0044.LAMP152.PROD.OUTLOOK.COM]

I got the connection using the following test code:

        public string ConnectStartTls (string host, int port, string localDomain)
        {
            OnConnecting ();
            base.Connect (host, port);
            string response = ReadLine ();
            Helo (localDomain);
            Command ("STARTTLS", 220);
            _sslStream = new SslStream (Stream);
            _sslStream.AuthenticateAsClient (host);
            Ehlo (localDomain);
            OnConnected (new ConnectedEventArgs (response));
            return response;
        }

Is this a real problem or is there a way to make StartTls connections in Office365 server?

UnknownDispositionMimeParts properties blank

Issue

I have an email messages with an attachment. The properties "FileName" and "ContentType" of the UnknownDispositionMimeParts are blank, even though the "OriginalMessage" property shows all those attachment details.

What would be the cause for this? Is there a fix?

Example

Details from the "OriginalMessage" property shows correct attachment details:

Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;
name="Daily Inventory Report - Automated.xlsx"
Content-Description: Daily Inventory Report - Automated.xlsx
Content-Disposition: attachment;
filename="Daily Inventory Report - Automated.xlsx"; size=118709;
creation-date="Thu, 14 Nov 2019 15:15:59 GMT";
modification-date="Thu, 14 Nov 2019 15:15:59 GMT"
Content-Transfer-Encoding: base64

S/MIME signing - wrong hash

Hi, I'm new to s/mime and need to digitally sign email with xml attachment, but unfortunately this email has a wrong hash value. I digged into the code of the library and found that it creates a sign for base64-encoded body part, is it correct or the signature should be computed for xml attachment content?

Also here is some more issues:

  1. Lots of headers/parameters are owerritten by library: for ex. ContentType parameters, some headers (like X-Mailer) and many others
  2. It creates an empty boundary for Content-Type: text/plain, though I haven't any text except attachment
  3. What is the difference between SmimeEnvelopeAndSignBy() and SmimeAttachSignatureBy()

OAuth - IMAP - Office365

With Microsoft's decision that all O365 lose Basic Authentication in October 2022, will there be an update to MailSystem.NET for OAuth2 connection?

If this is already done, I apologize as I was unable to find the options related to that.

Unable to login to gmail, "Web login required"

Is there a workaround for logging into Gmail with the Imap4Client when you encounter a "weblogin required" error?

I have already enabled "Allow unsecure apps" for the Gmail account in question, and that got it working on my local machine - but after deploying the code to a server, I get the error again - and this time, I can't seem to get it working again. I tried visiting the url provided by google, as I thought that might be some sort of authentication method. I log in using my password, and all seems OK - but connecting with the Imap4Client still fails.

Below is the stacktrace and msgs for


Unhandled Exception: ActiveUp.Net.Mail.Imap4Exception: Command "login [email protected] mypassword" failed : * NO [WEBALERT https://accounts.google.com/signin/continue?sarp=1&scc=1&plt=AKgnsbttoGtD4OMtfxi7uAy8s84fzfawSNIPPED] Web login required.
170226012817375 NO [ALERT] Please log in via your web browser: https://support.google.com/mail/accounts/answer/78754 (Failure)

    at ActiveUp.Net.Mail.Imap4Client.Command(String command, String stamp, CommandOptions options)
    at ActiveUp.Net.Mail.Imap4Client.Command(String command, CommandOptions options)
    at ActiveUp.Net.Mail.Imap4Client.Login(String username, String password)

Sync

I've synced the repo. Please verify it was cloned without loosing anything.

Emails with Content-Type = text don´t import body.

Emails parsed with header content Content-Type equal "text", without subtype don´t process body and result in blank body.

The emails normally come with Content-Type equal "text/plain" including the "plain" subtype on this identification.

Not getting notification from Office365

I have mentioned the code below which is working fine for Gmail but not giving any notification in case of outlook account.

     private void StartIdleProcess(object sender, DoWorkEventArgs e)
         {
         // Get the BackgroundWorker that raised this event.
         //BackgroundWorker worker = sender as BackgroundWorker;

         try
         {
             if (imap != null && imap.IsConnected)
             {
                 imap.StopIdle();
                 imap.Disconnect();
             }

             var handShake = new ActiveUp.Net.Security.SslHandShake("imap-mail.outlook.com", System.Security.Authentication.SslProtocols.Default);
             handShake.ServerCertificateValidationCallback = delegate { return true; };

             imap = new Imap4Client();
             imap.NewMessageReceived += new NewMessageReceivedEventHandler(NewMessageReceived);
          
             imap.ConnectSsl("imap-mail.outlook.com", 993);
             var res = imap.Login(@OutlookID, @Password);
             imap.SelectMailbox("inbox");
             imap.StartIdle();
             _log.Info("Connected");
         }
         catch (Exception ex)
         {
         }
     }

     public static void NewMessageReceived(object source, NewMessageReceivedEventArgs e)
     {
         //thisForm.AddLogEntry("New message received :" + e.MessageCount);
         _log.Info("Message Received");
         //imap4.StopIdle();
     }

After sometime it is giving "Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host." this exception.

Unable to delete messages from the inbox

Hi.
I'm trying to delete all messages from the Inbox mailbox using the package.
Here's the code:

     private void RegisterRepository()
     {
            iocContainer.RegisterInstance<IMailRepository>(new MailRepository("imap.gmail.com", 993, true,
            @"[email protected]", "password"));            
     }

    public interface IMailRepository
    {
        IEnumerable<Message> GetAllMails(string mailBox);
        IEnumerable<Message> GetUnreadMails(string mailBox);
        Message GetLastUnread(string mailBox);
        Message GetLast(string mailBox);
        void ClearMails(string mailBox);
    }

    public class MailRepository : IMailRepository
    {        
        public MailRepository(string mailServer, int port, bool ssl, string login, string password)
        {
            if (ssl)
            {
                Client.ConnectSsl(mailServer, port);
            }
            else
            {
                Client.Connect(mailServer, port);
            }                
            Client.Login(login, password);
        }

        public IEnumerable<Message> GetAllMails(string mailBox)
        {
            return GetMails(mailBox, "ALL").Cast<Message>();
        }

        public IEnumerable<Message> GetUnreadMails(string mailBox)
        {
            return GetMails(mailBox, "UNSEEN").Cast<Message>();
        }

        public Message GetLastUnread(string mailBox)
        {
            var mails = Client.SelectMailbox(mailBox);
            var ids = mails.Search(                                
                "UNSEEN"
                );
            return ids.Length == 0 ? null : mails.Fetch.MessageObject(ids.Last());
        }

        public Message GetLast(string mailBox)
        {
            var mails = Client.SelectMailbox(mailBox);
            var ids = mails.Search(
                "ALL"                
                );
            return ids.Length == 0 ? null : mails.Fetch.MessageObject(ids.Last());
        }

        public void ClearMails(string mailBox)
        {
            var mails = Client.SelectMailbox(mailBox);
            var ids = mails.Search("UNDELETED");
            foreach (var id in ids)
            {
                mails.DeleteMessage(id, expunge:true);
            }            
        }

        private Imap4Client _client;
        protected Imap4Client Client => _client ?? (_client = new Imap4Client());

        private MessageCollection GetMails(string mailBox, string searchPhrase)
        {
            Mailbox mails = Client.SelectMailbox(mailBox);
            MessageCollection messages = mails.SearchParse(searchPhrase);
            return messages;
        }
    }

The GetMails works as expected but the ClearEmails does not remove the emails from the inbox.
@reinaldocoelho

"Index and length must refer to a location within the string" when using SINCE 24-Apr-2019

Suddenly I have this exception after few days of app working fine

{System.ArgumentOutOfRangeException: Index and length must refer to a location within the string.
Parameter name: length
   at System.String.Substring(Int32 startIndex, Int32 length)
   at ActiveUp.Net.Mail.Fetch.ExtractMessageFromReponse(String response)
   at ActiveUp.Net.Mail.Fetch.MessageString(Int32 messageOrdinal)
   at ActiveUp.Net.Mail.Mailbox.SearchParse(String query)
...
}

Object reference not set error when retrieving IMAP data.

Hi,

I'm using the MailSystem.Net library for a Bounced Email tracking system that I'm working on.
Firstly, I initiate an IMAP connection to GMAIL servers with ConnectSsl() using port 993.

It runs well but after a few hours, this error occurs:

"Error:Object reference not set to an instance of an object., Stack Trace: at ActiveUp.Net.Mail.Imap4Client.Command(String command, String stamp, CommandOptions options)
at ActiveUp.Net.Mail.Imap4Client.Command(String command, CommandOptions options)
at ActiveUp.Net.Mail.Imap4Client.GetMailboxes(String reference, String mailboxName)
at ActiveUp.Net.Mail.Imap4Client.SelectMailbox(String mailboxName)"

when I try to retrieve the email data from the GMAIL mail servers with this method -
m_imapClient.SelectMailbox("NAMEOFFOLDER"). Any help would be great, thanks.

Regards,

Adhy

IMAP4 - Not able to fetch calendar/tasks/contacts mailboxes messages using IMAP4 from exchange server.

I am able to fetch all mails from Inbox and their subfolders and Sent mails as well. But when I try to fetch messages from contact/calendar/tasks mailboxes folder it is somehow not working. It displays me below messages.

"The server couldn't retrieve the following message:"

Is there any workaround for it? I am aware that the IMAP4 protocol does not allow me to read these mail messages, but I need to make it if feasible.

Difference between MailSystem.NET and other IMAP libs?

Hi,

I was wondering what the difference between these projects were (aenetmail, MailKit, S22.Imap, MailSystem.NET, etc) and whether maybe it would be a good idea for all of these projects to work together instead of reinventing the wheel over and over again?

I'm trying to make a decision on which one to use. At first glance, it would appear that MailKit might be the way to go (it has 1012 stars) while aenetmail has 269, S22.Imap has 117 and MailSystem.NET has 17, but I've learned the hard way that more popularity doesn't mean "best".

I plan to post this same question on each of these projects with the hope of getting thoughts of the both the developers and the users (have users used the other libraries? how did they compare? why did you choose the one you settled on?)

Any feedback would be hugely helpful in saving me a lot of time and effort!

Meeting Request via SMTP

Do we have any sample code in c# for following feature?

vCard & vCalendar
Contact file reading and writing
Calendar event reading and writing
Sending and receiving a meeting request

Code Examples

I can't find any examples of how to use this library. Is there some place for that?

Is there a homepage or is it just this github page?;)

How to get spam email?

Hello everyone,
Can some one help me read spam mail using MailSystem.NET, please?

Thanks all,

BCC Visible when sending

I create a message with no To and only BCC - but the BCC is visible in all messages under Gmail. Is there something that need to happen to suppress this?

regards,
Dave

[Error] System.ArgumentOutOfRangeException: Index and length must refer to a location within the string.

Hi,

I have this issue couple times. I have two window services running in different machines and connect to different email accounts (MS Exchange server 2013).
Structure are as follows:


email account A :
(1) receive emails and redirect a copy to email account B
(2) A window service will read emails and do what I code.

email account B: a service will read emails which redirect from email account A

*Both services runs same code, the difference are just point to different email account. (account A and account B)

But I received error as follows at account A's window service

Error: System.ArgumentOutOfRangeException: Index and length must refer to a location within the string.
Parameter name: length
at System.String.Substring(Int32 startIndex, Int32 length)
at ActiveUp.Net.Mail.Fetch.ExtractMessageFromReponse(String response)
at ActiveUp.Net.Mail.Fetch.MessageString(Int32 messageOrdinal)
at ActiveUp.Net.Mail.Fetch.MessageObject(Int32 messageOrdinal)

I debug and find out that "ActiveUp.Net.Mail.Fetch.MessageObject" will fail but ActiveUp.Net.Mail.Fetch.HeaderObject(UnSeenMessage) can pass. I have run at least several months for over thousands of emails, only those certain email will fail ,but it works fine to those redirect emails.

Please advise.

Checking if an email address exists

Hi!
I want to check an email Address actually Exist or not.
I tried this function but it return false every time even my own Email Address .

ActiveUp.Net.Mail.SmtpClient aa = new ActiveUp.Net.Mail.SmtpClient();
bool isEmailExist=aa.Verify("[email protected]");

imap4 exception - NO the specified message set is inavlid

For some odd reason the moveMessage method fails, it only moves a couple of emails and fails to finish the job.

I have been fighting this issue for over 2 weeks, and this is an important feature of my application.
I tried this method with both gmail and outlook, but it still fails.

` public void EnsureMessagesCanBeMoved()
{
var _selectedMailBox = "Inbox";
var _targetMailBox = "Processed";
Mailbox finalMailbox;

        using (var client = new Imap4Client())
        {
            client.ConnectSsl("imap.gmail.com", 993);
            client.Login("secret", "secret");

            Mailbox mails = client.SelectMailbox(_selectedMailBox);
            var mailMessages = mails.Search("ALL");

            foreach(var x in mailMessages)
            {
                mails.MoveMessage(x, _targetMailBox);
            }

            finalMailbox = client.SelectMailbox("Processed");
            client.Disconnect();
        }

        Assert.AreEqual(15, finalMailbox.MessageCount);
    }

`

This test fails.

Stackoverflowexception

While trying to fetch mails from an inbox, I got a stackoverflowexception.
By using memorydump and dotpeek on your dlls, I found the following:
public static Address ParseAddress(string input)
{
Address address = new Address();
input = input.TrimEnd(';');
try
{
if (input.IndexOf("<") == -1)
{
address.Email = Parser.RemoveWhiteSpaces(input);
}
else
{
if (input.IndexOf(""") >= 0)
{
string oldValue = Regex.Match(input, ""."").Value;
address.Email = input.Replace(oldValue, "").Trim().TrimStart('<').TrimEnd('>');
address.Name = oldValue;
if (address.Email == "" && address.Name != "")
{
address.Email = address.Name;
address.Name = "";
}
}
else
{
address.Email = Regex.Match(input, "<(.|[.])
>").Value.TrimStart('<').TrimEnd('>');
address.Name = input.Replace("<" + address.Email + ">", "");
}
address.Email = Parser.Clean(Parser.RemoveWhiteSpaces(address.Email)).Replace(""", "");
if (address.Name.IndexOf(""") == -1)
address.Name = Parser.Clean(address.Name);
address.Name = address.Name.Trim(' ', '"');
}
return address;
}
catch
{
return new Address(input);
}
}

The input is the mail, which results in the error. The input is: "" [email protected]". This looks wrong yes, but this is not the problem.
The oldValue will now not have a length, and the try will fail. We therefor gets to catch, which calls the Address method again, with the same input. This will continue until stackoverflow has been reached.
So can you fix this, so it doesn't run in circles indefinitely, but handles the error?

Exception on parse e-mails cause Blank result.

Hi all.

When MailSystem.NET parses an EML file, if the file has problems or is corrupted by some problem, the result is a blank data.

I do not remember do that on purpose in my changes.

Anyone remember why the lib uses this approach to solve Exception?

I think to make Parse object import all possible data and indicate in a flag or some like that if some errors occurs during parse.

You guys have some suggestion or objection?

Thanks

Exception parsing VCAL-TODO

Hello,
got this exception when trying to parse a vcal file which only contain a TODO:
System.ArgumentOutOfRangeException:
bei System.String.Substring(Int32 startIndex, Int32 length)
bei ActiveUp.Net.Groupware.vCalendar.Parser.GetEvents(String data)

You are missing following line of code wich checks if a VEVENT is there, insert following at GetEvent (just like you have on the GETTODO() funktion

if (data.IndexOf("BEGIN:VEVENT") > -1)

thanks!

System.NullReferenceException: 'Object reference not set to an instance of an object.' in Message.cs when attempting to save email to HDD.

This piece of code (line 1067-1073) in Header.cs throws an System.NullReferenceException: 'Object reference not set to an instance of an object.' exception

UsenetXrefList xref = new UsenetXrefList();
xref.Host = HeaderFields["xref"].Split(' ')[0];
string[] splitted = HeaderFields["xref"].Split(' ');
for (int i = 1; i < splitted.Length; i++)
if (splitted[i].IndexOf(":") != -1)
xref.Groups.Add(splitted[i].Split(':')[0], splitted[i].Split(':')[1]);
return xref;

This happens because the xref key does not exist.

Whats the purpose of the xref header? And why does it not exist?
Context: I am downloading an email through imap from an hmail server.

error parsing MS Exchange bodystructure response

actual response from server
* 3 FETCH (BODYSTRUCTURE (("text" "html" ("charset" "utf-8") NIL NIL "base64" 0 0 NIL NIL NIL NIL)("application" "octet-stream" ("name" "tmp_price.zip") NIL NIL "base64" 3281042 NIL ("attachment" ("filename" "tmp_price.zip")) NIL NIL) "mixed" ("boundary" "0a13d07f7e95b55bf35a04629d68ee9e") NIL NIL)) 170404084703420 OK FETCH completed.

it crashes in BodyStructure
response doenst contain "bodystructure" (lowercase) and " UID"

variables not either undeclared or was never assigned

Dear owner,
When I open the ActiveUp.Mailsystem.DesktopClient i get several warnings about variables that might be undeclared or never assigned.
also as you can see in the picture it speels about activeUP.Whols,verdion=5.03454.364, culture = neutral, publickeyToken = (the token that is written there) processorArchitecture = MSIL could not be resolved because it was built against the ".NETFramework, Verdion=v4.0" framework

please help me out...
messages

POP3 ConnectSsl

Im using in my project version v4.0.30319 (from May 2016) and i dont have any problem. When i updated project using nuget then function connectssl throw then i use wrong int32 value. I think its about port but this value is "995 and works in may 2016 version.

Attachments get lost when fetching signed mails

When i try to fetch a signed mail via the Pop3Client or Imap4Client, i won't get any attachments. Getting the attachments from the same mail, without signing works as expected.

Is there a solution for this problem or is this a known issue? Any help would be greatly appreciated!

IMAP4 Methods Example to check if a folder exists in email server, and check if a message object is read or unread?

Hello Reinaldo Coelho Sartorelli,

I want examples of the following methods if they exist within the IMAP library.

  1. Check to see if a mailbox exists on email server
    ifFolderExists = true; //then do not create it (otherwise create it)
    I have the method for create mailbox, but I want to check if a mailbox exists on the server before I create it.

  2. Is there a bool method that can check if a messageObject is read or unread?
    bool = message.isRead; //return true or false
    I move messages according to whether if it is read or not, and I use for unit testing purpose.

Thanks.

Unable to download embeddedObjects from an email message.

//I need to be able to download the embedded images from the mail messages`

        public void downlodInlineAttachments()
       {
        Imap4Client imap = new Imap4Client();
        List<Message> unreadAttachments = new List<Message>();
        
        //Authentication
        imap.ConnectSsl(Credential.outlookImapHost, Credential.outlookImapPort);
        imap.Login(Credential.outlookUserName, Credential.outlookPassword);

        Mailbox inbox = imap.SelectMailbox("inbox");
        int[] unread = inbox.Search("unseen");
        Console.WriteLine("Unread Messgaes: " + unread.Length);

        if (unread.Length > 0)
        {
            //fetch each unread message and insert into the Message List
            for (int i = 0; i < unread.Length; i++)
            {
                Message unreadMessage = inbox.Fetch.MessageObject(unread[i]);
                Message m = inbox.Fetch.MessageObject(unread[i]);
                unreadAttachments.Add(unreadMessage);
            }

            //Iterate through a list of Messages and download the embedded objects locally
            //Can help with the syntax? It gives error
            foreach (MimePart embedded in _message.EmbeddedObjects)
            {
                var filename = embedded.ContentName;
                var binary = embedded.BinaryContent,
                File.WriteAllBytes(filename, binary);
            }
        }
        else
        {
            Console.WriteLine("Unread Messages Not Found");
        }
     }

trunk folder

Reinaldo, we could probably remove trunk folder all together?

Time-Parsing in vcard/vcal

Keep getting erros parsing some time values - seems that there are some different time formats.
Praser.cs ParseDate():
I´ve added a else if for length=15, fixing my problem:

else if (input.Length == 15)
{
input = input.Insert(4, "-");
input = input.Insert(7, "-");
input = input.Insert(13, ":");
input = input.Insert(16, ":");
}

Disconnection Error

Hi,

When I try to Disconnect an already connected IMAP connection (GMAIL) with port 993, using the Disconnect() method, this error occurs:
"Unexpected end of stream"

Does anyone know what the cause is and/or if there is a workaround to this issue?

Regards,

Adhy

SelectMailbox function may hang

I am writing an application that processes user emails. O start the application connects to Gmail and then once per minute checks for new emails.
After approximately 12 - 20 hours the application stops processing new emails. Using logs I found, that line Mailbox mailBox = _gmailClient.SelectMailbox("inbox"); is the last one executed in this code.
Because the code is not in try / catch block I know that this is not a crash.

Please, advise.
Thank you.

Below is a part of code that retrieves new emails, where _gmailClient is Imap4Client() connected to Gmail using ConnectSsl("imap.gmail.com", 993)

OutputLog($"RetrieveAndProcessNewEmails - In locked code.");
if (!_gmailClient.IsConnected)
{
    OutputLog($"IMap client is not connected. Reconnecting...");
    if (!(ConnectIMap4Client("imap.gmail.com", 993, true) && LoginIMap4Client("email", "pass")))
        return;
}
OutputLog($"RetrieveAndProcessNewEmails - connected to GMail");
Mailbox mailBox = _gmailClient.SelectMailbox("inbox");
if (mailBox == null)
{
    OutputLog("Mailbox is null! Processing incoming emails is disabled");
    return;
}
OutputLog($"RetrieveAndProcessNewEmails - mailbox found: {MailBox2String(mailBox)}");
messages = mailBox.SearchParse("UNSEEN");
if (messages.Count == 0)
{
    OutputLog($"Currently there is no new messages...");
    return;
}
else
    OutputLog($"New {messages.Count} found.");

vTodo parsing is completely missing

Parsing of vTodo´s is completely missing:
vTodo todo = new vTodo(); todo.Summary = data; return todo;

You completely lack support of saving ToDo´s, I would recommend to deactivate the whole vCalendar class until it´s useable?

Checking gmail INBOX gives exception

I have read the notes that are written in the Gmail documentation. It reads that you should check the inbox every 10 minutes.
I have set a timer at that time. But since I am checking two emails when I switch I get the following error:

Exception: Unable to write data to the transport connection: An established connection was aborted by the software in your host machine. StackTrace: System.IO.IOException: Unable to write data to the transport connection: An established connection was aborted by the software in your host machine. ---> System.Net.Sockets.SocketException: An established connection was aborted by the software in your host machine at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size) --- End of inner exception stack trace --- at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size) at System.Net.Security._SslStream.StartWriting(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest) at System.Net.Security._SslStream.ProcessWrite(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslStream.Write(Byte[] buffer, Int32 offset, Int32 count) at ActiveUp.Net.Mail.Imap4Client.CommandBinary(String command, String stamp, CommandOptions options) at ActiveUp.Net.Mail.Imap4Client.Command(String command, String stamp, Encoding encoding, CommandOptions options) at ActiveUp.Net.Mail.Imap4Client.Command(String command, String stamp, CommandOptions options) at ActiveUp.Net.Mail.Imap4Client.Command(String command, CommandOptions options) at ActiveUp.Net.Mail.Imap4Client.GetMailboxes(String reference, String mailboxName) at ActiveUp.Net.Mail.Imap4Client.SelectMailbox(String mailboxName)

I was searching for a solution on the internet but no success. And that is why I am writing here to help.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.