Ejemplo n.º 1
1
        public void OnRetrieveNewMessage(MailQueueItem account,
            ActiveUp.Net.Mail.Message message,
            int folder_id,
            string uidl,
            string md5_hash,
            bool has_parse_error,
            bool unread,
            int[] tags_ids)
        {
            MailMessageItem message_item;
            if (_mailBoxManager.MailReceive(account.Account, message, folder_id, uidl, md5_hash, has_parse_error, unread, tags_ids, out message_item) < 1)
                throw new Exception("MailReceive() returned id < 1;");

            if (message_item == null) return;

            foreach (var handler in _messageHandlers)
            {
                try
                {
                    handler.HandleRetrievedMessage(account.Account, message, message_item, folder_id, uidl, md5_hash, unread, tags_ids);
                }
                catch (Exception ex)
                {
                    _log.Error(ex, "MailItemManager::OnRetrieveNewMessage");
                }
            }
        }
Ejemplo n.º 2
0
        internal NewsGroup(string name, int firstArticle, int lastArticle, bool postingAllowed, ActiveUp.Net.Mail.NntpClient nntp)
		{
			this._name = name;
			this._firstArticle = firstArticle;
			this._lastArticle = lastArticle;
			this._postingAllowed = postingAllowed;
			this._nntp = nntp;
        }
Ejemplo n.º 3
0
 public void OnRetrieveNewMessage(MailQueueItem account,
     ActiveUp.Net.Mail.Message message,
     int folder_id,
     string uidl,
     string md5_hash,
     bool unread,
     int[] tags_ids)
 {
     if (mailBoxManager.MailReceive(account.Account, message, folder_id, uidl, md5_hash, unread, tags_ids) < 1)
         throw new Exception("MailReceive() returned id < 1;");
 }
Ejemplo n.º 4
0
 private void PutChild(ActiveUp.Net.Mail.Mailbox box)
 {
     foreach (ActiveUp.Net.Mail.Mailbox mailbox in box.SubMailboxes)
     {
         if (mailbox.Name.Replace(box.Name + "/\uFFFD", "\uFFFD").IndexOf("/\uFFFD") == -1)
         {
             ActiveUp.WebControls.TreeNode treeNode = tree.FindNode(box.Name).AddNode(mailbox.Name, "<span class=\"foldername\">\uFFFD" + mailbox.ShortName + "</span>\uFFFD", System.String.Empty);
             treeNode.Click += new System.EventHandler(Navigate);
             PutChild(mailbox);
         }
     }
 }
Ejemplo n.º 5
0
        private string FormatAddress(ActiveUp.Net.Mail.Address address)
        {
            string result = string.Empty;

            if (address.Name.TrimEnd() != string.Empty)
            {
                result = string.Format("{0} ({1})",address.Name,address.Email);
            }
            else
            {
                result = address.Email;
            }

            return result;
        }
Ejemplo n.º 6
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="header">The Header to be added in the collection.</param>
 public void Add(ActiveUp.Net.Mail.Header header)
 {
     this.List.Add(header);
 }
Ejemplo n.º 7
0
		/// <summary>
		/// Adds a Message object to the collection. Can be useful to use the GetBindableTable() method with message from different sources.
		/// </summary>
		/// <param name="msg"></param>
		public void Add(ActiveUp.Net.Mail.Message msg)
		{
			this.List.Add(msg);
		}
Ejemplo n.º 8
0
 /// <summary>
 /// Authenticates using the given SASL mechanism.
 /// </summary>
 /// <param name="username">Username to authenticate as.</param>
 /// <param name="password">Password.</param>
 /// <param name="mechanism">SASL mechanism to be used.</param>
 /// <returns>The server's response.</returns>
 /// <example>
 /// <code>
 /// C#
 /// 
 /// Imap4Client imap = new Imap4Client();
 /// imap.Connect("mail.myhost.com");
 /// imap.Authenticate("user","pass",SASLMechanism.CramMd5);
 /// imap.Disconnect();
 /// 
 /// VB.NET
 /// 
 /// Dim imap As New Imap4Client
 /// imap.Connect("mail.myhost.com")
 /// imap.Authenticate("user","pass",SASLMechanism.CramMd5)
 /// imap.Disconnect()
 /// 
 /// JScript.NET
 /// 
 /// var imap:Imap4Client = new Imap4Client();
 /// imap.Connect("mail.myhost.com");
 /// imap.Authenticate("user","pass",SASLMechanism.CramMd5);
 /// imap.Disconnect();
 /// </code>
 /// </example>
 public override string Authenticate(string username, string password, ActiveUp.Net.Mail.SaslMechanism mechanism)
 {
     switch (mechanism)
     {
         case ActiveUp.Net.Mail.SaslMechanism.CramMd5:
             return this._CramMd5(username, password);
         case ActiveUp.Net.Mail.SaslMechanism.Login:
             return this._Login(username, password);
     }
     return string.Empty;
 }
Ejemplo n.º 9
0
 public string ConnectSsl(System.Net.IPAddress[] addresses, int port,
                          ActiveUp.Net.Security.SslHandShake sslHandShake)
 {
     this.OnConnecting();
     base.Connect(addresses, port);
     this.DoSslHandShake(sslHandShake);
     string response = this.ReadLine();
     this.ServerCapabilities = this.Command("capability");
     this.OnConnected(new ActiveUp.Net.Mail.ConnectedEventArgs(response));
     return response;
 }
Ejemplo n.º 10
0
 public IAsyncResult BeginConnectSsl(string host, ActiveUp.Net.Security.SslHandShake sslHandShake,
                                     AsyncCallback callback)
 {
     return this.BeginConnectSsl(host, 993, sslHandShake, callback);
 }
Ejemplo n.º 11
0
 internal void OnNewMessageReceived(ActiveUp.Net.Mail.NewMessageReceivedEventArgs e)
 {
     if (NewMessageReceived != null) NewMessageReceived(this, e);
     ActiveUp.Net.Mail.Logger.AddEntry("New message received : " + e.MessageCount + "...", 2);
 }
Ejemplo n.º 12
0
 public string ConnectSsl(System.Net.IPAddress addr, int port, ActiveUp.Net.Security.SslHandShake sslHandShake)
 {
     this.OnConnecting();
     base.Connect(addr, port);
     this.DoSslHandShake(sslHandShake);
     string response = this.ReadLine();
     this.OnConnected(new ActiveUp.Net.Mail.ConnectedEventArgs(response));
     return response;
 }
Ejemplo n.º 13
0
 private void DoSslHandShake(ActiveUp.Net.Security.SslHandShake sslHandShake)
 {
     this._sslStream = new System.Net.Security.SslStream(base.GetStream(), false, sslHandShake.ServerCertificateValidationCallback, sslHandShake.ClientCertificateSelectionCallback);
     this._sslStream.AuthenticateAsClient(sslHandShake.HostName, sslHandShake.ClientCertificates, sslHandShake.SslProtocol, sslHandShake.CheckRevocation);
 }
Ejemplo n.º 14
0
		internal void OnHeaderRetrieving(ActiveUp.Net.Mail.HeaderRetrievingEventArgs e)
		{
			if(HeaderRetrieving!=null) HeaderRetrieving(this,e);
			ActiveUp.Net.Mail.Logger.AddEntry("Retrieving Header at index "+e.MessageIndex+" out of "+e.TotalCount+"...",2);
		}
Ejemplo n.º 15
0
 public string ConnectSsl(string host, int port, ActiveUp.Net.Security.SslHandShake sslHandShake)
 {
     this.host = host;
     this.OnConnecting();
     base.Connect(host, port);
     this.DoSslHandShake(sslHandShake);
     string response = this.ReadLine();
     this.OnConnected(new ActiveUp.Net.Mail.ConnectedEventArgs(response));
     return response;
 }
Ejemplo n.º 16
0
 internal void OnConnected(ActiveUp.Net.Mail.ConnectedEventArgs e)
 {
     if (Connected != null) Connected(this, e);
     ActiveUp.Net.Mail.Logger.AddEntry("Connected. Server replied : " + e.ServerResponse + ".", 2);
 }
Ejemplo n.º 17
0
 internal void OnMessageSent(ActiveUp.Net.Mail.MessageSentEventArgs e)
 {
     if (MessageSent != null) MessageSent(this, e);
     ActiveUp.Net.Mail.Logger.AddEntry("Sent message with subject : " + e.Message.Subject + "...", 2);
 }
Ejemplo n.º 18
0
 internal void OnAuthenticated(ActiveUp.Net.Mail.AuthenticatedEventArgs e)
 {
     if (Authenticated != null) Authenticated(this, e);
     ActiveUp.Net.Mail.Logger.AddEntry("Authenticated as " + e.Username + " on " + e.Host + ".", 2);
 }
Ejemplo n.º 19
0
 public string ConnectSsl(string host, ActiveUp.Net.Security.SslHandShake sslHandShake)
 {
     return this.ConnectSsl(host, 993, sslHandShake);
 }
Ejemplo n.º 20
0
 internal void OnTcpWriting(ActiveUp.Net.Mail.TcpWritingEventArgs e)
 {
     if (TcpWriting != null) TcpWriting(this, e);
     ActiveUp.Net.Mail.Logger.AddEntry("Sending " + e.Command + "...", 1);
 }
Ejemplo n.º 21
0
 public IAsyncResult BeginConnectSsl(string host, int port, ActiveUp.Net.Security.SslHandShake sslHandShake,
                                     AsyncCallback callback)
 {
     this._delegateConnectSsl = this.ConnectSsl;
     return this._delegateConnectSsl.BeginInvoke(host, port, sslHandShake, callback, this._delegateConnectSsl);
 }
Ejemplo n.º 22
0
 internal void OnTcpWritten(ActiveUp.Net.Mail.TcpWrittenEventArgs e)
 {
     if (TcpWritten != null) TcpWritten(this, e);
     ActiveUp.Net.Mail.Logger.AddEntry("Sent " + e.Command + ".", 1);
 }
Ejemplo n.º 23
0
 public IAsyncResult BeginConnectSsl(System.Net.IPAddress[] addresses, int port,
                                     ActiveUp.Net.Security.SslHandShake sslHandShake, AsyncCallback callback)
 {
     this._delegateConnectSslIPAddresses = this.ConnectSsl;
     return this._delegateConnectSslIPAddresses.BeginInvoke(addresses, port, sslHandShake, callback,
                                                            this._delegateConnectSslIPAddresses);
 }
Ejemplo n.º 24
0
 internal void OnTcpRead(ActiveUp.Net.Mail.TcpReadEventArgs e)
 {
     if (TcpRead != null) TcpRead(this, e);
     ActiveUp.Net.Mail.Logger.AddEntry("Read " + e.Response + ".", 1);
 }
		public void Add(ActiveUp.Net.Groupware.vCard.TelephoneNumber number)
		{
			this.List.Add(number);
		}
Ejemplo n.º 26
0
 internal void OnMessageRetrieved(ActiveUp.Net.Mail.MessageRetrievedEventArgs e)
 {
     if (MessageRetrieved != null) MessageRetrieved(this, e);
     ActiveUp.Net.Mail.Logger.AddEntry("Retrieved message at index " + e.MessageIndex + ".", 2);
 }
		/// <summary>
		/// Add a SmtpException object in the collection.
		/// </summary>
		/// <param name="exception">Exception to add.</param>
		public void Add(ActiveUp.Net.Mail.SmtpException exception)
		{
			this.List.Add(exception);
		}
Ejemplo n.º 28
0
 internal void OnHeaderRetrieved(ActiveUp.Net.Mail.HeaderRetrievedEventArgs e)
 {
     if (HeaderRetrieved != null) HeaderRetrieved(this, e);
     ActiveUp.Net.Mail.Logger.AddEntry("Retrieved Header at index " + e.MessageIndex + ".", 2);
 }
 public void Add(ActiveUp.Net.Groupware.vCard.EmailAddress email)
 {
     this.List.Add(email);
 }
Ejemplo n.º 30
0
 internal void OnDisconnected(ActiveUp.Net.Mail.DisconnectedEventArgs e)
 {
     if (Disconnected != null) Disconnected(this, e);
     ActiveUp.Net.Mail.Logger.AddEntry("Disconnected.", 2);
 }