csmaild-cvs Mailing List for C# Mail Server (Page 2)
Brought to you by:
tamc
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
(7) |
May
|
Jun
|
Jul
(79) |
Aug
(49) |
Sep
|
Oct
|
Nov
|
Dec
|
---|
From: <ta...@us...> - 2003-08-05 01:42:13
|
Update of /cvsroot/csmaild/csmaild/src/Engine/bin/SampleXmlMailstore In directory sc8-pr-cvs1:/tmp/cvs-serv32691/src/Engine/bin/SampleXmlMailstore Modified Files: Mailboxes.xml Messages.xml Users.xml Log Message: Mail store provider has more functionality - Can save messages (flag changes) - Can expunge a message Fixed namespace issues User now has subscribed mailboxes Commands no longer "register" themselves, resorted back to switch statement Index: Mailboxes.xml =================================================================== RCS file: /cvsroot/csmaild/csmaild/src/Engine/bin/SampleXmlMailstore/Mailboxes.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Mailboxes.xml 29 Jul 2003 00:46:28 -0000 1.2 --- Mailboxes.xml 5 Aug 2003 01:42:10 -0000 1.3 *************** *** 1,27 **** <?xml version="1.0" standalone="yes"?> <Mailstore xmlns="http://tempuri.org/Mailboxes.xsd"> ! <Mailboxes> ! <Id>1</Id> ! <UserId>1</UserId> ! <ParentId>0</ParentId> ! <Name>INBOX</Name> ! <NextUniqueId>1</NextUniqueId> ! <UniqueIdValidity>1</UniqueIdValidity> ! <NoSelect>false</NoSelect> ! <NoInferiors>false</NoInferiors> ! <Marked>false</Marked> ! <Unmarked>false</Unmarked> ! </Mailboxes> ! <Mailboxes> ! <Id>2430903176</Id> ! <UserId>1</UserId> ! <ParentId>0</ParentId> ! <Name>Custom</Name> ! <NextUniqueId>1</NextUniqueId> ! <UniqueIdValidity>1</UniqueIdValidity> ! <NoSelect>false</NoSelect> ! <NoInferiors>false</NoInferiors> ! <Marked>false</Marked> ! <Unmarked>false</Unmarked> ! </Mailboxes> </Mailstore> --- 1,39 ---- <?xml version="1.0" standalone="yes"?> <Mailstore xmlns="http://tempuri.org/Mailboxes.xsd"> ! <Mailboxes> ! <Id>1</Id> ! <UserId>1</UserId> ! <ParentId>0</ParentId> ! <Name>INBOX</Name> ! <NextUniqueId>2</NextUniqueId> ! <UniqueIdValidity>3</UniqueIdValidity> ! <NoSelect>False</NoSelect> ! <NoInferiors>False</NoInferiors> ! <Marked>False</Marked> ! <Unmarked>False</Unmarked> ! </Mailboxes> ! <Mailboxes> ! <Id>3301003416</Id> ! <UserId>1</UserId> ! <ParentId>0</ParentId> ! <Name>Sent Items</Name> ! <NextUniqueId>1</NextUniqueId> ! <UniqueIdValidity>1</UniqueIdValidity> ! <NoSelect>False</NoSelect> ! <NoInferiors>False</NoInferiors> ! <Marked>False</Marked> ! <Unmarked>False</Unmarked> ! </Mailboxes> ! <Mailboxes> ! <Id>3301003417</Id> ! <UserId>1</UserId> ! <ParentId>0</ParentId> ! <Name>Drafts</Name> ! <NextUniqueId>1</NextUniqueId> ! <UniqueIdValidity>1</UniqueIdValidity> ! <NoSelect>False</NoSelect> ! <NoInferiors>False</NoInferiors> ! <Marked>False</Marked> ! <Unmarked>False</Unmarked> ! </Mailboxes> </Mailstore> Index: Messages.xml =================================================================== RCS file: /cvsroot/csmaild/csmaild/src/Engine/bin/SampleXmlMailstore/Messages.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Messages.xml 29 Jul 2003 00:46:28 -0000 1.2 --- Messages.xml 5 Aug 2003 01:42:10 -0000 1.3 *************** *** 1,14 **** <?xml version="1.0" standalone="yes"?> ! <Mailstore xmlns="http://tempuri.org/Messages.xsd"> ! <Messages> ! <Id>1</Id> ! <MailboxId>1</MailboxId> ! <UniqueIdentifier>1</UniqueIdentifier> ! <Seen>true</Seen> ! <Answered>true</Answered> ! <Flagged>true</Flagged> ! <Deleted>true</Deleted> ! <Draft>true</Draft> ! <Size>0</Size> ! </Messages> </Mailstore> --- 1,41 ---- <?xml version="1.0" standalone="yes"?> ! <Mailstore> ! <Messages> ! <Id>3301003416</Id> ! <MailboxId>3301003417</MailboxId> ! <UniqueIdentifier>1</UniqueIdentifier> ! <Seen>True</Seen> ! <Answered>True</Answered> ! <Flagged>False</Flagged> ! <Deleted>False</Deleted> ! <Draft>False</Draft> ! <Recent>True</Recent> ! <Size>767</Size> ! <InternalDate>7/7/1977 12:30:00 PM</InternalDate> ! <RawMessage>Return-path: <jo...@ch...> ! Received: from CHICKEN [64.22.212.165] ! by chegg.com [127.0.0.1] ! with SMTP (MDaemon.PRO.v5.0.4.R) ! for <jo...@ch...>; Thu, 31 Jul 2003 13:33:59 -0500 ! Message-ID: <004001c35792$af685d40$6501a8c0@asi.local> ! From: "Josh" <jo...@ch...> ! To: <jo...@ch...> ! Subject: Yo yo ! Date: Thu, 31 Jul 2003 13:36:41 -0500 ! MIME-Version: 1.0 ! Content-Type: text/plain; ! charset="iso-8859-1" ! Content-Transfer-Encoding: 7bit ! X-Priority: 3 ! X-MSMail-Priority: Normal ! X-Mailer: Microsoft Outlook Express 6.00.2800.1158 ! X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 ! X-MDRcpt-To: jo...@ch... ! X-MDRemoteIP: 64.22.212.165 ! X-Return-Path: jo...@ch... ! X-MDaemon-Deliver-To: jo...@ch... ! ! This is a plain text message. ! </RawMessage> ! </Messages> </Mailstore> Index: Users.xml =================================================================== RCS file: /cvsroot/csmaild/csmaild/src/Engine/bin/SampleXmlMailstore/Users.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Users.xml 29 Jul 2003 00:46:28 -0000 1.2 --- Users.xml 5 Aug 2003 01:42:10 -0000 1.3 *************** *** 1,8 **** <?xml version="1.0" standalone="yes"?> <Mailstore xmlns="http://tempuri.org/Users.xsd"> ! <Users> ! <Id>1</Id> ! <Username>csmaild_test</Username> ! <Password>csmaild_test</Password> ! </Users> </Mailstore> --- 1,9 ---- <?xml version="1.0" standalone="yes"?> <Mailstore xmlns="http://tempuri.org/Users.xsd"> ! <Users> ! <Id>1</Id> ! <Username>csmaild_test</Username> ! <Password>csmaild_test</Password> ! <SubscribedMailboxes>INBOX,Sent Items,Drafts</SubscribedMailboxes> ! </Users> </Mailstore> |
From: <ta...@us...> - 2003-08-05 01:42:13
|
Update of /cvsroot/csmaild/csmaild/src/Common/NetworkManager In directory sc8-pr-cvs1:/tmp/cvs-serv32691/src/Common/NetworkManager Modified Files: Connection.cs Listener.cs NetworkManager.cs Log Message: Mail store provider has more functionality - Can save messages (flag changes) - Can expunge a message Fixed namespace issues User now has subscribed mailboxes Commands no longer "register" themselves, resorted back to switch statement Index: Connection.cs =================================================================== RCS file: /cvsroot/csmaild/csmaild/src/Common/NetworkManager/Connection.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Connection.cs 30 Jul 2003 22:44:43 -0000 1.1 --- Connection.cs 5 Aug 2003 01:42:09 -0000 1.2 *************** *** 7,11 **** using System.Text; ! namespace Imap.NetworkManager { public delegate void ReceivedLineDelegate(Connection con, string line); --- 7,11 ---- using System.Text; ! namespace Common.NetworkManager { public delegate void ReceivedLineDelegate(Connection con, string line); *************** *** 240,244 **** public override string ToString() { ! return mClient.RemoteEndPoint.ToString(); } #endregion --- 240,247 ---- public override string ToString() { ! if(mClient.Connected) ! return mClient.RemoteEndPoint.ToString(); ! else ! return string.Empty; } #endregion Index: Listener.cs =================================================================== RCS file: /cvsroot/csmaild/csmaild/src/Common/NetworkManager/Listener.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Listener.cs 30 Jul 2003 22:44:44 -0000 1.1 --- Listener.cs 5 Aug 2003 01:42:10 -0000 1.2 *************** *** 3,7 **** using System.Net.Sockets; ! namespace Imap.NetworkManager { public delegate void AcceptDelegate(Connection con); --- 3,7 ---- using System.Net.Sockets; ! namespace Common.NetworkManager { public delegate void AcceptDelegate(Connection con); Index: NetworkManager.cs =================================================================== RCS file: /cvsroot/csmaild/csmaild/src/Common/NetworkManager/NetworkManager.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** NetworkManager.cs 30 Jul 2003 22:44:44 -0000 1.1 --- NetworkManager.cs 5 Aug 2003 01:42:10 -0000 1.2 *************** *** 4,8 **** using System.Text; ! namespace Imap.NetworkManager { /// <summary> --- 4,8 ---- using System.Text; ! namespace Common.NetworkManager { /// <summary> |
From: <ta...@us...> - 2003-08-05 01:42:13
|
Update of /cvsroot/csmaild/csmaild/src/Common In directory sc8-pr-cvs1:/tmp/cvs-serv32691/src/Common Modified Files: Mailbox.cs MailboxCollection.cs Message.cs MessageCollection.cs User.cs Log Message: Mail store provider has more functionality - Can save messages (flag changes) - Can expunge a message Fixed namespace issues User now has subscribed mailboxes Commands no longer "register" themselves, resorted back to switch statement Index: Mailbox.cs =================================================================== RCS file: /cvsroot/csmaild/csmaild/src/Common/Mailbox.cs,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Mailbox.cs 3 Aug 2003 01:04:26 -0000 1.10 --- Mailbox.cs 5 Aug 2003 01:42:09 -0000 1.11 *************** *** 83,87 **** get { ! return (uint)DateTime.Now.Ticks;//mUniqueIdValidity; } } --- 83,87 ---- get { ! return mUniqueIdValidity; } } Index: MailboxCollection.cs =================================================================== RCS file: /cvsroot/csmaild/csmaild/src/Common/MailboxCollection.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** MailboxCollection.cs 30 Jul 2003 22:33:20 -0000 1.4 --- MailboxCollection.cs 5 Aug 2003 01:42:09 -0000 1.5 *************** *** 61,68 **** Add(box); ! if(mMailstoreProvider.InsertMailbox(mUser, box)) ! return box; ! else ! return null; } --- 61,66 ---- Add(box); ! mMailstoreProvider.InsertMailbox(mUser, box); ! return box; } Index: Message.cs =================================================================== RCS file: /cvsroot/csmaild/csmaild/src/Common/Message.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Message.cs 3 Aug 2003 01:04:26 -0000 1.7 --- Message.cs 5 Aug 2003 01:42:09 -0000 1.8 *************** *** 198,201 **** --- 198,206 ---- mInternalDate = internalDate; } + + public void Save() + { + mMailstoreProvider.SaveMessage(this); + } } } Index: MessageCollection.cs =================================================================== RCS file: /cvsroot/csmaild/csmaild/src/Common/MessageCollection.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** MessageCollection.cs 3 Aug 2003 01:04:26 -0000 1.4 --- MessageCollection.cs 5 Aug 2003 01:42:09 -0000 1.5 *************** *** 66,69 **** --- 66,77 ---- } + public void Delete(uint sequenceNumber) + { + Message msg = BySeq(sequenceNumber); + mSequenceList.Remove(sequenceNumber); + mUidList.Remove(msg.UniqueId); + mMailstoreProvider.DeleteMessage(msg); + } + #region IEnumerable public override IEnumerator GetEnumerator() Index: User.cs =================================================================== RCS file: /cvsroot/csmaild/csmaild/src/Common/User.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** User.cs 29 Jul 2003 00:46:28 -0000 1.4 --- User.cs 5 Aug 2003 01:42:09 -0000 1.5 *************** *** 2,5 **** --- 2,6 ---- using System; + using System.Collections.Specialized; namespace Common *************** *** 13,16 **** --- 14,18 ---- private string mUsername; private string mPassword; + private StringCollection mSubscribedMailboxes; #endregion *************** *** 38,41 **** --- 40,51 ---- } + public StringCollection SubscribedMailboxes + { + get + { + return mSubscribedMailboxes; + } + } + public MailboxCollection Mailboxes { *************** *** 47,54 **** #endregion ! public User(IMailstoreProvider provider, object providersId, string username, string password) : base(provider, providersId) { mUsername = username; mPassword = password; } } --- 57,70 ---- #endregion ! public User(IMailstoreProvider provider, object providersId, string username, string password, StringCollection subscribedBoxes) : base(provider, providersId) { mUsername = username; mPassword = password; + mSubscribedMailboxes = subscribedBoxes; + } + + public void Save() + { + mMailstoreProvider.SaveUser(this); } } |
From: <ta...@us...> - 2003-08-05 01:42:13
|
Update of /cvsroot/csmaild/csmaild/src/Common/MailstoreProviders In directory sc8-pr-cvs1:/tmp/cvs-serv32691/src/Common/MailstoreProviders Modified Files: IMailstoreProvider.cs XmlMailstoreProvider.cs Log Message: Mail store provider has more functionality - Can save messages (flag changes) - Can expunge a message Fixed namespace issues User now has subscribed mailboxes Commands no longer "register" themselves, resorted back to switch statement Index: IMailstoreProvider.cs =================================================================== RCS file: /cvsroot/csmaild/csmaild/src/Common/MailstoreProviders/IMailstoreProvider.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** IMailstoreProvider.cs 3 Aug 2003 01:04:27 -0000 1.8 --- IMailstoreProvider.cs 5 Aug 2003 01:42:09 -0000 1.9 *************** *** 1,3 **** --- 1,4 ---- using System; + using System.Collections.Specialized; using System.IO; *************** *** 15,19 **** #endregion ! #region User accessors /// <summary> /// Gets the user with the login info --- 16,20 ---- #endregion ! #region User stuff /// <summary> /// Gets the user with the login info *************** *** 23,38 **** /// <returns>The user with the username and password</returns> User GetUser(string username, string password); #endregion #region Mailbox stuff - #region Mailbox functions /// <summary> ! /// Gets the mailbox with the specified absolute path for a particular user /// </summary> /// <param name="user">The user that owns this mailbox</param> ! /// <param name="absoluteHiearchicalName">The absolute path of the mailbox to retreive</param> ! /// <returns>The mailbox or null if not found</returns> ! Mailbox GetMailbox(User user, string absoluteHiearchicalName); /// <summary> --- 24,44 ---- /// <returns>The user with the username and password</returns> User GetUser(string username, string password); + + /// <summary> + /// Saves the user to the data store + /// </summary> + /// <param name="user">The user to save</param> + void SaveUser(User user); #endregion #region Mailbox stuff /// <summary> ! /// Gets the mailbox with the specified fully qualified name for a particular user /// </summary> /// <param name="user">The user that owns this mailbox</param> ! /// <param name="absoluteHiearchicalName">The fully qualified name of the mailbox to retreive</param> ! /// <returns>The mailbox found (null if not)</returns> ! Mailbox GetMailbox(User user, string name); /// <summary> *************** *** 58,72 **** /// Inserts a mailbox for a particular user /// </summary> ! /// <param name="user"></param> ! /// <param name="box"></param> ! /// <returns></returns> ! bool InsertMailbox(User user, Mailbox box); /// <summary> ! /// Permanently deletes the mailbox /// </summary> /// <param name="box">The box to delete</param> void DeleteMailbox(Mailbox box); - #endregion #endregion --- 64,76 ---- /// Inserts a mailbox for a particular user /// </summary> ! /// <param name="user">The user to add this mailbox to</param> ! /// <param name="box">The prepopulated Mailbox object</param> ! void InsertMailbox(User user, Mailbox box); /// <summary> ! /// Permanently deletes the mailbox from the data store /// </summary> /// <param name="box">The box to delete</param> void DeleteMailbox(Mailbox box); #endregion *************** *** 103,106 **** --- 107,115 ---- void DeleteMessages(Mailbox box); + /// <summary> + /// Deletes the message from the mailstore + /// </summary> + /// <param name="msg">The message to delete</param> + void DeleteMessage(Message msg); /// <summary> *************** *** 108,113 **** /// </summary> /// <param name="msg">The message to insert</param> ! /// <returns>True is successful, false otherwise</returns> ! bool InsertMessage(Message msg, TextReader rawSrc); #endregion --- 117,127 ---- /// </summary> /// <param name="msg">The message to insert</param> ! void InsertMessage(Message msg, TextReader rawSrc); ! ! /// <summary> ! /// Saves the message into the data store ! /// </summary> ! /// <param name="msg">The message to save</param> ! void SaveMessage(Message msg); #endregion Index: XmlMailstoreProvider.cs =================================================================== RCS file: /cvsroot/csmaild/csmaild/src/Common/MailstoreProviders/XmlMailstoreProvider.cs,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** XmlMailstoreProvider.cs 3 Aug 2003 01:04:27 -0000 1.10 --- XmlMailstoreProvider.cs 5 Aug 2003 01:42:09 -0000 1.11 *************** *** 1,3 **** --- 1,4 ---- using System; + using System.Collections.Specialized; using System.Data; using System.IO; *************** *** 56,60 **** #endregion ! #region User accessors public User GetUser(string username, string password) { --- 57,80 ---- #endregion ! #region User stuff ! public void SaveUser(User user) ! { ! DataRow[] rows = mUsers.Select("Id = '" + user.ProvidersIdentifier + "'"); ! ! if(rows.Length == 1) ! { ! DataRow row = rows[0]; ! ! string subscribedBoxes = string.Empty; ! for(int idx = 0; idx < user.SubscribedMailboxes.Count; ++idx) ! subscribedBoxes += user.SubscribedMailboxes[idx] + (idx == user.SubscribedMailboxes.Count-1 ? string.Empty : ","); ! ! row["Password"] = user.Password; ! row["SubscribedMailboxes"] = subscribedBoxes; ! } ! ! Save(true, false, false); ! } ! public User GetUser(string username, string password) { *************** *** 65,70 **** DataRow user = users[0]; if((user["Password"] as string) == password) ! return new User(this, user["Id"], user["Username"] as string, user["Password"] as string); else return null; --- 85,96 ---- DataRow user = users[0]; + + StringCollection subs = new StringCollection(); + string[] s = (user["SubscribedMailboxes"] as string).Split(','); + if(s[0] != string.Empty) + subs.AddRange(s); + if((user["Password"] as string) == password) ! return new User(this, user["Id"], user["Username"] as string, user["Password"] as string, subs); else return null; *************** *** 138,142 **** #region Mailbox insert ! public bool InsertMailbox(User user, Mailbox box) { DataRow newBox = mMailboxes.NewRow(); --- 164,168 ---- #region Mailbox insert ! public void InsertMailbox(User user, Mailbox box) { DataRow newBox = mMailboxes.NewRow(); *************** *** 164,169 **** mMailboxes.Rows.Add(newBox); Save(false, true, false); - - return true; } #endregion --- 190,193 ---- *************** *** 216,219 **** --- 240,254 ---- #region Message deletes + public void DeleteMessage(Message msg) + { + DataRow[] rows = mMessages.Select("Id = '" + msg.ProvidersIdentifier + "'"); + + if(rows.Length == 1) + { + rows[0].Delete(); + Save(false, false, true); + } + } + public void DeleteMessages(Mailbox box) { *************** *** 226,230 **** #region Message insert ! public bool InsertMessage(Message msg, TextReader rawSrc) { DataRow newMsg = mMessages.NewRow(); --- 261,265 ---- #region Message insert ! public void InsertMessage(Message msg, TextReader rawSrc) { DataRow newMsg = mMessages.NewRow(); *************** *** 248,253 **** mMessages.Rows.Add(newMsg); Save(false, false, true); ! return true; } #endregion --- 283,313 ---- mMessages.Rows.Add(newMsg); Save(false, false, true); + } + #endregion ! #region Message updates ! public void SaveMessage(Message msg) ! { ! DataRow[] rows = mMessages.Select("Id = '" + msg.ProvidersIdentifier + "'"); ! ! if(rows.Length == 1) ! { ! DataRow row = rows[0]; ! ! // row["Id"] = msg.ProvidersIdentifier; ! // row["MailboxId"] = msg.Mailbox.ProvidersIdentifier; ! // row["UniqueIdentifier"] = msg.UniqueId; ! row["Seen"] = msg.Seen; ! row["Answered"] = msg.Answered; ! row["Flagged"] = msg.Flagged; ! row["Deleted"] = msg.Deleted; ! row["Draft"] = msg.Draft; ! row["Recent"] = msg.Recent; ! // row["Size"] = msg.Size; ! // row["InternalDate"] = msg.InternalDate; ! // row["RawMessage"] = rawSrc.ReadToEnd(); ! } ! ! Save(false, false, true); } #endregion |
From: <ta...@us...> - 2003-08-03 01:08:41
|
Update of /cvsroot/csmaild/csmaild/src/Imap In directory sc8-pr-cvs1:/tmp/cvs-serv17718/src/Imap Modified Files: Connection.cs Imap.csproj Server.cs Log Message: Support for UID commands Working COPY command Index: Connection.cs =================================================================== RCS file: /cvsroot/csmaild/csmaild/src/Imap/Connection.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Connection.cs 1 Aug 2003 22:02:37 -0000 1.8 --- Connection.cs 3 Aug 2003 01:08:38 -0000 1.9 *************** *** 32,35 **** --- 32,36 ---- private string mCurrentTag; // the current tag sent in the most recent command private ImapCommand mCurrentCommand; // the current command being processed + private bool mCurrentCommandUID; // whether the current command started with UID private string mCurrentArguments; // the un-parsed arguments for the currently processing command *************** *** 138,142 **** if(idxTagEnd == -1) // this would mean that there isn't a space, just call it a missing tag { ! SendUntaggedMessage("BAD"); // missing tag return false; } --- 139,143 ---- if(idxTagEnd == -1) // this would mean that there isn't a space, just call it a missing tag { ! SendUntaggedMessage("BAD Missing tag"); // missing tag return false; } *************** *** 145,175 **** if(!CommandPart.ValidateTagCharacters(mCurrentTag)) // uh oh, bad client, bad client, no supper for you { ! SendTaggedMessage("BAD"); // tag contains invalid characters return false; } // parse and validate command string cmd; ! int idxCommandEnd = line.IndexOf(' ', idxTagEnd+1); if(idxCommandEnd == -1) // nothing after the command { ! cmd = line.Substring(idxTagEnd+1).ToUpper(); // one space past the tag til the end mCurrentArguments = string.Empty; // no arguments } else { ! cmd = line.Substring(idxTagEnd+1, idxCommandEnd-idxTagEnd-1).ToUpper(); // one space past tag til the next space mCurrentArguments = line.Substring(idxCommandEnd); // args will include the preceding space } ! mCurrentCommand = (ImapCommand)Server.Commands[cmd]; if(mCurrentCommand == null) { ! SendTaggedMessage("BAD"); // command not found return false; } ! mCurrentCommand.Initialize(mCurrentArguments, this); if(!mCurrentCommand.ValidateState()) --- 146,190 ---- if(!CommandPart.ValidateTagCharacters(mCurrentTag)) // uh oh, bad client, bad client, no supper for you { ! SendTaggedMessage("BAD Tag has invalid characters"); // tag contains invalid characters return false; } + ++idxTagEnd; + + if(line.Substring(idxTagEnd, 4).ToUpper() == "UID ") + { + mCurrentCommandUID = true; + idxTagEnd+=4; + } + else + mCurrentCommandUID = false; + // parse and validate command string cmd; ! int idxCommandEnd = line.IndexOf(' ', idxTagEnd); if(idxCommandEnd == -1) // nothing after the command { ! cmd = line.Substring(idxTagEnd).ToUpper(); // one space past the tag til the end mCurrentArguments = string.Empty; // no arguments } else { ! cmd = line.Substring(idxTagEnd, idxCommandEnd-idxTagEnd).ToUpper(); // one space past tag til the next space mCurrentArguments = line.Substring(idxCommandEnd); // args will include the preceding space } ! if(mCurrentCommandUID) ! mCurrentCommand = (ImapCommand)Server.UidCommands[cmd]; ! else ! mCurrentCommand = (ImapCommand)Server.Commands[cmd]; ! if(mCurrentCommand == null) { ! SendTaggedMessage("BAD Command not found"); // command not found return false; } ! mCurrentCommand.Initialize(mCurrentArguments, this, mCurrentCommandUID); if(!mCurrentCommand.ValidateState()) Index: Imap.csproj =================================================================== RCS file: /cvsroot/csmaild/csmaild/src/Imap/Imap.csproj,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Imap.csproj 29 Jul 2003 00:46:29 -0000 1.7 --- Imap.csproj 3 Aug 2003 01:08:38 -0000 1.8 *************** *** 225,233 **** /> <File - RelPath = "Commands\UidCommand.cs" - SubType = "Code" - BuildAction = "Compile" - /> - <File RelPath = "Commands\UnsubscribeCommand.cs" SubType = "Code" --- 225,228 ---- Index: Server.cs =================================================================== RCS file: /cvsroot/csmaild/csmaild/src/Imap/Server.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Server.cs 27 Jul 2003 17:26:22 -0000 1.7 --- Server.cs 3 Aug 2003 01:08:38 -0000 1.8 *************** *** 17,20 **** --- 17,21 ---- private Hashtable mImapConnections = new Hashtable(); private Hashtable mImapCommands = new Hashtable(); + private Hashtable mUidImapCommands = new Hashtable(); private IMailstoreProvider mMailstoreProvider; *************** *** 22,27 **** { mNetwork = new NetworkManager.NetworkManager(); - mImapConnections = new Hashtable(); - mMailstoreProvider = provider; --- 23,26 ---- *************** *** 50,55 **** mImapCommands.Add("STORE", new StoreCommand(this)); mImapCommands.Add("SUBSCRIBE", new SubscribeCommand(this)); - mImapCommands.Add("UID", new UidCommand(this)); mImapCommands.Add("UNSUBSCRIBE", new UnsubscribeCommand(this)); #endregion } --- 49,58 ---- mImapCommands.Add("STORE", new StoreCommand(this)); mImapCommands.Add("SUBSCRIBE", new SubscribeCommand(this)); mImapCommands.Add("UNSUBSCRIBE", new UnsubscribeCommand(this)); + + mUidImapCommands.Add("COPY", mImapCommands["COPY"]); + mUidImapCommands.Add("FETCH", mImapCommands["FETCH"]); + mUidImapCommands.Add("STORE", mImapCommands["STORE"]); + mUidImapCommands.Add("SEARCH", mImapCommands["SEARCH"]); #endregion } *************** *** 76,79 **** --- 79,90 ---- { return mImapCommands; + } + } + + public Hashtable UidCommands + { + get + { + return mUidImapCommands; } } |
From: <ta...@us...> - 2003-08-03 01:08:40
|
Update of /cvsroot/csmaild/csmaild/src/Imap/Commands In directory sc8-pr-cvs1:/tmp/cvs-serv17718/src/Imap/Commands Modified Files: CopyCommand.cs ImapCommand.cs StatusCommand.cs Log Message: Support for UID commands Working COPY command Index: CopyCommand.cs =================================================================== RCS file: /cvsroot/csmaild/csmaild/src/Imap/Commands/CopyCommand.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** CopyCommand.cs 29 Jul 2003 00:46:28 -0000 1.5 --- CopyCommand.cs 3 Aug 2003 01:08:38 -0000 1.6 *************** *** 1,2 **** --- 1,4 ---- + using Common; + using System; *************** *** 8,12 **** public class CopyCommand : ImapCommand { ! public CopyCommand(ImapServer svr) : base(svr, "COPY", ImapConnectionState.Selected) { } --- 10,14 ---- public class CopyCommand : ImapCommand { ! public CopyCommand(ImapServer svr) : base(svr, "COPY", ImapConnectionState.Selected, ArgumentType.SequenceSet, ArgumentType.AString) { } *************** *** 14,18 **** override protected void InternalProcess() { ! //return false; } } --- 16,50 ---- override protected void InternalProcess() { ! SequenceSet msgSet = mParsedArguments[0] as SequenceSet; ! string boxFullName = mParsedArguments[1] as string; ! ! Mailbox destination = mConnection.User.Mailboxes.FindMailbox(boxFullName); ! Mailbox source = mConnection.Mailbox; ! if(destination == null) ! mConnection.SendTaggedMessage("NO Destination does not exist"); ! else ! { ! SequenceSet.SequenceRange rng = msgSet.FirstRange; ! while(rng != null) ! { ! for(uint idx = rng.Low; idx <= rng.High; ++idx) ! { ! if(idx > source.MessageCount) ! break; ! ! Message msg = null; ! if(mUidCalled) ! msg = source.Messages.ByUID(idx); ! else ! msg = source.Messages.BySeq(idx); ! ! if(msg != null) ! destination.Messages.AddCopy(msg); ! } ! rng = rng.NextRange; ! } ! ! mConnection.SendTaggedMessage("OK Copy completed"); ! } } } Index: ImapCommand.cs =================================================================== RCS file: /cvsroot/csmaild/csmaild/src/Imap/Commands/ImapCommand.cs,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** ImapCommand.cs 1 Aug 2003 22:02:37 -0000 1.11 --- ImapCommand.cs 3 Aug 2003 01:08:38 -0000 1.12 *************** *** 22,25 **** --- 22,26 ---- private ArgumentType[] mArgumentTypes; + protected bool mUidCalled; protected string mUnparsedArguments; protected int mUnparsedArgumentIdx; *************** *** 68,73 **** } ! public void Initialize(string arguments, ImapConnection con) { mUnparsedArguments = arguments; mConnection = con; --- 69,75 ---- } ! public void Initialize(string arguments, ImapConnection con, bool uidCalled) { + mUidCalled = uidCalled; mUnparsedArguments = arguments; mConnection = con; *************** *** 525,529 **** #region ParenthesizedList ! protected class ParenthesizedList { #region ParenthesizedListItem --- 527,531 ---- #region ParenthesizedList ! public class ParenthesizedList { #region ParenthesizedListItem Index: StatusCommand.cs =================================================================== RCS file: /cvsroot/csmaild/csmaild/src/Imap/Commands/StatusCommand.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** StatusCommand.cs 30 Jul 2003 22:45:50 -0000 1.6 --- StatusCommand.cs 3 Aug 2003 01:08:38 -0000 1.7 *************** *** 15,20 **** } - //status-att = "MESSAGES" / "RECENT" / "UIDNEXT" / "UIDVALIDITY" / "UNSEEN" - override protected void InternalProcess() { --- 15,18 ---- |
From: <ta...@us...> - 2003-08-03 01:08:40
|
Update of /cvsroot/csmaild/csmaild/src/Engine In directory sc8-pr-cvs1:/tmp/cvs-serv17718/src/Engine Modified Files: Engine.csproj Log Message: Support for UID commands Working COPY command Index: Engine.csproj =================================================================== RCS file: /cvsroot/csmaild/csmaild/src/Engine/Engine.csproj,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Engine.csproj 29 Jul 2003 00:46:28 -0000 1.3 --- Engine.csproj 3 Aug 2003 01:08:38 -0000 1.4 *************** *** 109,137 **** /> <File ! RelPath = "bin\SampleXmlMailstore\Mailboxes.xsd" BuildAction = "Content" /> <File ! RelPath = "bin\SampleXmlMailstore\Mailboxes.xsx" ! DependentUpon = "Mailboxes.xsd" ! BuildAction = "None" ! /> ! <File ! RelPath = "bin\SampleXmlMailstore\Messages.xsd" BuildAction = "Content" /> <File ! RelPath = "bin\SampleXmlMailstore\Messages.xsx" ! DependentUpon = "Messages.xsd" ! BuildAction = "None" ! /> ! <File ! RelPath = "bin\SampleXmlMailstore\Users.xsd" BuildAction = "Content" - /> - <File - RelPath = "bin\SampleXmlMailstore\Users.xsx" - DependentUpon = "Users.xsd" - BuildAction = "None" /> </Include> --- 109,122 ---- /> <File ! RelPath = "bin\SampleXmlMailstore\Mailboxes.xml" BuildAction = "Content" /> <File ! RelPath = "bin\SampleXmlMailstore\Messages.xml" BuildAction = "Content" /> <File ! RelPath = "bin\SampleXmlMailstore\Users.xml" BuildAction = "Content" /> </Include> |
From: <ta...@us...> - 2003-08-03 01:04:30
|
Update of /cvsroot/csmaild/csmaild/src/Common/MailstoreProviders In directory sc8-pr-cvs1:/tmp/cvs-serv17238/src/Common/MailstoreProviders Modified Files: IMailstoreProvider.cs XmlMailstoreProvider.cs Log Message: Can add messages to mailboxes now. Some minor fixes and additions to rfc2822 code Index: IMailstoreProvider.cs =================================================================== RCS file: /cvsroot/csmaild/csmaild/src/Common/MailstoreProviders/IMailstoreProvider.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** IMailstoreProvider.cs 1 Aug 2003 22:02:37 -0000 1.7 --- IMailstoreProvider.cs 3 Aug 2003 01:04:27 -0000 1.8 *************** *** 74,78 **** #region Message stuff - #region Message accessors /// <summary> /// Gets the message --- 74,77 ---- *************** *** 97,103 **** /// <returns>An array containing the mailboxes (valid array of size 0 if none)</returns> MessageCollection GetMessages(Mailbox box); - #endregion - #region Message delete /// <summary> /// Deletes all the messages in a mailbox --- 96,100 ---- *************** *** 105,109 **** /// <param name="box">The mailbox to clear out</param> void DeleteMessages(Mailbox box); ! #endregion #endregion --- 102,113 ---- /// <param name="box">The mailbox to clear out</param> void DeleteMessages(Mailbox box); ! ! ! /// <summary> ! /// Inserts the message into the data store ! /// </summary> ! /// <param name="msg">The message to insert</param> ! /// <returns>True is successful, false otherwise</returns> ! bool InsertMessage(Message msg, TextReader rawSrc); #endregion Index: XmlMailstoreProvider.cs =================================================================== RCS file: /cvsroot/csmaild/csmaild/src/Common/MailstoreProviders/XmlMailstoreProvider.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** XmlMailstoreProvider.cs 2 Aug 2003 15:57:10 -0000 1.9 --- XmlMailstoreProvider.cs 3 Aug 2003 01:04:27 -0000 1.10 *************** *** 132,135 **** --- 132,137 ---- row["Unmarked"] = box.Unmarked; } + + Save(false, true, false); } #endregion *************** *** 206,210 **** { DataRow message = messages[idx]; ! msgs.Add(new Message(this, message["Id"], uint.Parse(message["UniqueIdentifier"].ToString()), bool.Parse(message["Seen"].ToString()), bool.Parse(message["Answered"].ToString()), bool.Parse(message["Flagged"].ToString()), bool.Parse(message["Deleted"].ToString()), bool.Parse(message["Draft"].ToString()), int.Parse(message["Size"].ToString()), DateTime.Parse(message["InternalDate"].ToString()))); } --- 208,212 ---- { DataRow message = messages[idx]; ! msgs.Add(new Message(this, box, message["Id"], uint.Parse(message["UniqueIdentifier"].ToString()), bool.Parse(message["Seen"].ToString()), bool.Parse(message["Answered"].ToString()), bool.Parse(message["Flagged"].ToString()), bool.Parse(message["Deleted"].ToString()), bool.Parse(message["Draft"].ToString()), bool.Parse(message["Recent"].ToString()), int.Parse(message["Size"].ToString()), DateTime.Parse(message["InternalDate"].ToString()))); } *************** *** 220,223 **** --- 222,253 ---- msg.Delete(); Save(false, false, true); + } + #endregion + + #region Message insert + public bool InsertMessage(Message msg, TextReader rawSrc) + { + DataRow newMsg = mMessages.NewRow(); + + msg.ProvidersIdentifier = mNextMessageId++; + + // set provider specific unique id + newMsg["Id"] = msg.ProvidersIdentifier; + newMsg["MailboxId"] = msg.Mailbox.ProvidersIdentifier; + newMsg["UniqueIdentifier"] = msg.UniqueId; + newMsg["Seen"] = msg.Seen; + newMsg["Answered"] = msg.Answered; + newMsg["Flagged"] = msg.Flagged; + newMsg["Deleted"] = msg.Deleted; + newMsg["Draft"] = msg.Draft; + newMsg["Recent"] = msg.Recent; + newMsg["Size"] = msg.Size; + newMsg["InternalDate"] = msg.InternalDate; + newMsg["RawMessage"] = rawSrc.ReadToEnd(); + + mMessages.Rows.Add(newMsg); + Save(false, false, true); + + return true; } #endregion |
From: <ta...@us...> - 2003-08-03 01:04:30
|
Update of /cvsroot/csmaild/csmaild/src/Common/Rfc2822 In directory sc8-pr-cvs1:/tmp/cvs-serv17238/src/Common/Rfc2822 Modified Files: AddressList.cs AddressMailbox.cs HeaderField.cs Log Message: Can add messages to mailboxes now. Some minor fixes and additions to rfc2822 code Index: AddressList.cs =================================================================== RCS file: /cvsroot/csmaild/csmaild/src/Common/Rfc2822/AddressList.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** AddressList.cs 2 Aug 2003 15:57:10 -0000 1.2 --- AddressList.cs 3 Aug 2003 01:04:27 -0000 1.3 *************** *** 34,37 **** --- 34,45 ---- } } + + public override string ToString() + { + string rv = string.Empty; + for(int idx = 0; idx < mList.Count; ++idx) + rv += mList[idx].ToString() + (idx == mList.Count-1 ? string.Empty : ","); + return rv; + } } } Index: AddressMailbox.cs =================================================================== RCS file: /cvsroot/csmaild/csmaild/src/Common/Rfc2822/AddressMailbox.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** AddressMailbox.cs 1 Aug 2003 22:02:37 -0000 1.1 --- AddressMailbox.cs 3 Aug 2003 01:04:27 -0000 1.2 *************** *** 47,50 **** --- 47,58 ---- mHost = host; } + + public override string ToString() + { + if(mDisplayName != null) + return "\"" + mDisplayName + "\" <" + mLocalPart + "@" + mHost + ">"; + else + return mLocalPart + "@" + mHost; + } } } Index: HeaderField.cs =================================================================== RCS file: /cvsroot/csmaild/csmaild/src/Common/Rfc2822/HeaderField.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** HeaderField.cs 1 Aug 2003 22:02:37 -0000 1.1 --- HeaderField.cs 3 Aug 2003 01:04:27 -0000 1.2 *************** *** 37,40 **** --- 37,46 ---- mFieldValue = fieldValue; } + + public override string ToString() + { + return mFieldName + ": " + mFieldValue; + } + } } |
From: <ta...@us...> - 2003-08-03 01:04:30
|
Update of /cvsroot/csmaild/csmaild/src/Common In directory sc8-pr-cvs1:/tmp/cvs-serv17238/src/Common Modified Files: Mailbox.cs Message.cs MessageCollection.cs Log Message: Can add messages to mailboxes now. Some minor fixes and additions to rfc2822 code Index: Mailbox.cs =================================================================== RCS file: /cvsroot/csmaild/csmaild/src/Common/Mailbox.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Mailbox.cs 1 Aug 2003 22:02:37 -0000 1.9 --- Mailbox.cs 3 Aug 2003 01:04:26 -0000 1.10 *************** *** 64,67 **** --- 64,80 ---- /// <summary> + /// Gets the next unique id for a message and increments to handle the next one + /// </summary> + internal uint NextUniqueIdIncrement + { + get + { + uint rv = mNextUniqueId; + ++mNextUniqueId; + return rv; + } + } + + /// <summary> /// The UIDVALIDITY of this mailbox /// </summary> *************** *** 70,74 **** get { ! return mUniqueIdValidity; } } --- 83,87 ---- get { ! return (uint)DateTime.Now.Ticks;//mUniqueIdValidity; } } *************** *** 226,235 **** mMarked = marked; mUnmarked = unmarked; - } - - public void MoveMessages(Mailbox destination) - { - destination.Messages.Add(Messages); - Messages.Clear(); } --- 239,242 ---- Index: Message.cs =================================================================== RCS file: /cvsroot/csmaild/csmaild/src/Common/Message.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Message.cs 2 Aug 2003 15:57:10 -0000 1.6 --- Message.cs 3 Aug 2003 01:04:26 -0000 1.7 *************** *** 13,18 **** { #region Variables ! private uint mUniqueId; private bool mSeen; private bool mAnswered; --- 13,19 ---- { #region Variables ! private Mailbox mMailbox; + private uint mUniqueId; private bool mSeen; private bool mAnswered; *************** *** 21,25 **** private bool mDraft; private bool mRecent; - private int mSize; private DateTime mInternalDate; --- 22,25 ---- *************** *** 28,31 **** --- 28,42 ---- #region Properties /// <summary> + /// The mailbox that this message is in + /// </summary> + public Mailbox Mailbox + { + get + { + return mMailbox; + } + } + + /// <summary> /// The UID of this message /// </summary> *************** *** 150,154 **** } ! public Rfc2822.Message Rfc822Message { get --- 161,168 ---- } ! /// <summary> ! /// Returns a parsed object model representing the rfc2822 message ! /// </summary> ! public Rfc2822.Message Rfc2822Message { get *************** *** 157,164 **** } } #endregion ! public Message(IMailstoreProvider provider, object providersId, uint uid, bool seen, bool answered, bool flagged, bool deleted, bool draft, int size, DateTime internalDate) : base(provider, providersId) { mUniqueId = uid; mSeen = seen; --- 171,191 ---- } } + + /// <summary> + /// Returns a TextReader to the raw, unparsed rfc2822 message + /// </summary> + public TextReader RawRfc2822Message + { + get + { + return mMailstoreProvider.GetRawMessageReader(mProvidersIdentifier); + } + } #endregion ! public Message(IMailstoreProvider provider, Mailbox box, object providersId, uint uid, bool seen, bool answered, bool flagged, bool deleted, bool draft, bool recent, int size, DateTime internalDate) : base(provider, providersId) { + mMailbox = box; + mUniqueId = uid; mSeen = seen; *************** *** 167,171 **** mDeleted = deleted; mDraft = draft; ! mRecent = false; mSize = size; mInternalDate = internalDate; --- 194,198 ---- mDeleted = deleted; mDraft = draft; ! mRecent = recent; mSize = size; mInternalDate = internalDate; Index: MessageCollection.cs =================================================================== RCS file: /cvsroot/csmaild/csmaild/src/Common/MessageCollection.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** MessageCollection.cs 1 Aug 2003 22:02:37 -0000 1.3 --- MessageCollection.cs 3 Aug 2003 01:04:26 -0000 1.4 *************** *** 39,42 **** --- 39,49 ---- } + public uint GetSeqForUID(uint uid) + { + Message msg = ByUID(uid); + int idx = mSequenceList.IndexOfValue(msg); + return (uint)mSequenceList.GetKey(idx); + } + public void Clear() { *************** *** 44,48 **** } ! public void Add(Message msg) { mSequenceList.Add((uint)(mSequenceList.Count+1), msg); --- 51,55 ---- } ! internal void Add(Message msg) { mSequenceList.Add((uint)(mSequenceList.Count+1), msg); *************** *** 50,55 **** } ! public void Add(MessageCollection msgs) { } --- 57,67 ---- } ! public void AddCopy(Message msg) { + uint uid = mMailbox.NextUniqueIdIncrement; + Message newMsg = new Message(mMailstoreProvider, mMailbox, null, uid, msg.Seen, msg.Answered, msg.Flagged, msg.Deleted, msg.Draft, true, msg.Size, msg.InternalDate); + + mMailstoreProvider.InsertMessage(newMsg, msg.RawRfc2822Message); + mMailstoreProvider.SaveMailbox(mMailbox); } |
From: <ta...@us...> - 2003-08-02 15:57:13
|
Update of /cvsroot/csmaild/csmaild/src/Common/Rfc2822 In directory sc8-pr-cvs1:/tmp/cvs-serv5380/src/Common/Rfc2822 Modified Files: AddressList.cs AddressMailboxList.cs HeaderFieldList.cs Interpreter.cs Log Message: Modified XML mail store to read the internal date of the message Added internal date to the message object Added Count properties to the various "collections" in the rfc2822 object model Fixed the rfc2822 message interpreter for addresses, and various other small fixes Index: AddressList.cs =================================================================== RCS file: /cvsroot/csmaild/csmaild/src/Common/Rfc2822/AddressList.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** AddressList.cs 1 Aug 2003 22:02:37 -0000 1.1 --- AddressList.cs 2 Aug 2003 15:57:10 -0000 1.2 *************** *** 26,29 **** --- 26,37 ---- mList.Add(addr); } + + public int Count + { + get + { + return mList.Count; + } + } } } Index: AddressMailboxList.cs =================================================================== RCS file: /cvsroot/csmaild/csmaild/src/Common/Rfc2822/AddressMailboxList.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** AddressMailboxList.cs 1 Aug 2003 22:02:37 -0000 1.1 --- AddressMailboxList.cs 2 Aug 2003 15:57:10 -0000 1.2 *************** *** 25,28 **** --- 25,36 ---- mList.Add(box); } + + public int Count + { + get + { + return mList.Count; + } + } } } Index: HeaderFieldList.cs =================================================================== RCS file: /cvsroot/csmaild/csmaild/src/Common/Rfc2822/HeaderFieldList.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** HeaderFieldList.cs 1 Aug 2003 22:02:37 -0000 1.1 --- HeaderFieldList.cs 2 Aug 2003 15:57:10 -0000 1.2 *************** *** 26,30 **** return (HeaderField[])lst.ToArray(typeof(HeaderField)); else ! return new HeaderField[]{}; } } --- 26,30 ---- return (HeaderField[])lst.ToArray(typeof(HeaderField)); else ! return null; } } Index: Interpreter.cs =================================================================== RCS file: /cvsroot/csmaild/csmaild/src/Common/Rfc2822/Interpreter.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Interpreter.cs 1 Aug 2003 22:02:37 -0000 1.1 --- Interpreter.cs 2 Aug 2003 15:57:10 -0000 1.2 *************** *** 51,59 **** string fieldValu = rawHeader.Substring(colonIdx+1); ! // TODO: parse/validate/correct the header based on its name switch(fieldName.ToLower()) { case "date": return new HeaderField(fieldName, InterpretDateTime(fieldValu)); case "to": return new HeaderField(fieldName, InterpretAddressList(fieldValu)); --- 51,66 ---- string fieldValu = rawHeader.Substring(colonIdx+1); ! if(fieldValu[0] == ' ') ! fieldValu = fieldValu.Substring(1); ! switch(fieldName.ToLower()) { case "date": return new HeaderField(fieldName, InterpretDateTime(fieldValu)); + case "bcc": + case "cc": + case "from": + case "reply-to": + case "sender": case "to": return new HeaderField(fieldName, InterpretAddressList(fieldValu)); *************** *** 94,103 **** private AddressMailbox InterpretAddressMailbox(string rawMailbox) { ! int atIdx = rawMailbox.IndexOf('@'); ! int spIdx = rawMailbox.LastIndexOf(' ', atIdx); ! string host = rawMailbox.Substring(atIdx+1); ! string displayName = rawMailbox.Substring(0, spIdx); ! string localPart = rawMailbox.Substring(spIdx+1, atIdx-spIdx); return new AddressMailbox(displayName, localPart, host); --- 101,122 ---- private AddressMailbox InterpretAddressMailbox(string rawMailbox) { ! int spIdx = rawMailbox.LastIndexOf(' '); ! string displayName = null; ! if(spIdx != -1) ! { ! displayName = rawMailbox.Substring(0, spIdx); ! if(displayName[0] == '"' && displayName[displayName.Length-1] == '"') ! displayName = displayName.Substring(1, displayName.Length-2); ! } ! ! string address = rawMailbox.Substring(spIdx+1); ! if(address[0] == '<' && address[address.Length-1] == '>') ! address = address.Substring(1, address.Length-2); ! ! int atIdx = address.IndexOf('@'); ! ! string host = address.Substring(atIdx+1); ! string localPart = address.Substring(0, atIdx); return new AddressMailbox(displayName, localPart, host); *************** *** 129,136 **** { // validate and correct, possibly also convert to System.DateTime for easy use outside of Rfc2822 return rawDateTime; } #endregion ! #region Body private void InterpretBody(MessageBody bdy) --- 148,173 ---- { // validate and correct, possibly also convert to System.DateTime for easy use outside of Rfc2822 + return rawDateTime; } #endregion ! /* ! date-time = [ day-of-week "," ] date FWS time [CFWS] ! day-of-week = ([FWS] day-name) / obs-day-of-week ! day-name = "Mon" / "Tue" / "Wed" / "Thu" / ! "Fri" / "Sat" / "Sun" ! date = day month year ! year = 4*DIGIT / obs-year ! month = (FWS month-name FWS) / obs-month ! month-name = "Jan" / "Feb" / "Mar" / "Apr" / ! "May" / "Jun" / "Jul" / "Aug" / ! "Sep" / "Oct" / "Nov" / "Dec" ! day = ([FWS] 1*2DIGIT) / obs-day ! time = time-of-day FWS zone ! time-of-day = hour ":" minute [ ":" second ] ! hour = 2DIGIT / obs-hour ! minute = 2DIGIT / obs-minute ! second = 2DIGIT / obs-second ! zone = (( "+" / "-" ) 4DIGIT) / obs-zone*/ #region Body private void InterpretBody(MessageBody bdy) |
From: <ta...@us...> - 2003-08-02 15:57:13
|
Update of /cvsroot/csmaild/csmaild/src/Common In directory sc8-pr-cvs1:/tmp/cvs-serv5380/src/Common Modified Files: Message.cs Log Message: Modified XML mail store to read the internal date of the message Added internal date to the message object Added Count properties to the various "collections" in the rfc2822 object model Fixed the rfc2822 message interpreter for addresses, and various other small fixes Index: Message.cs =================================================================== RCS file: /cvsroot/csmaild/csmaild/src/Common/Message.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Message.cs 1 Aug 2003 22:02:37 -0000 1.5 --- Message.cs 2 Aug 2003 15:57:10 -0000 1.6 *************** *** 14,17 **** --- 14,18 ---- #region Variables private uint mUniqueId; + private bool mSeen; private bool mAnswered; *************** *** 20,24 **** --- 21,27 ---- private bool mDraft; private bool mRecent; + private int mSize; + private DateTime mInternalDate; #endregion *************** *** 136,139 **** --- 139,153 ---- } + /// <summary> + /// The exact date of receipt + /// </summary> + public DateTime InternalDate + { + get + { + return mInternalDate; + } + } + public Rfc2822.Message Rfc822Message { *************** *** 145,149 **** #endregion ! public Message(IMailstoreProvider provider, object providersId, uint uid, bool seen, bool answered, bool flagged, bool deleted, bool draft, int size) : base(provider, providersId) { mUniqueId = uid; --- 159,163 ---- #endregion ! public Message(IMailstoreProvider provider, object providersId, uint uid, bool seen, bool answered, bool flagged, bool deleted, bool draft, int size, DateTime internalDate) : base(provider, providersId) { mUniqueId = uid; *************** *** 155,158 **** --- 169,173 ---- mRecent = false; mSize = size; + mInternalDate = internalDate; } } |
From: <ta...@us...> - 2003-08-02 15:57:13
|
Update of /cvsroot/csmaild/csmaild/src/Common/MailstoreProviders In directory sc8-pr-cvs1:/tmp/cvs-serv5380/src/Common/MailstoreProviders Modified Files: XmlMailstoreProvider.cs Log Message: Modified XML mail store to read the internal date of the message Added internal date to the message object Added Count properties to the various "collections" in the rfc2822 object model Fixed the rfc2822 message interpreter for addresses, and various other small fixes Index: XmlMailstoreProvider.cs =================================================================== RCS file: /cvsroot/csmaild/csmaild/src/Common/MailstoreProviders/XmlMailstoreProvider.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** XmlMailstoreProvider.cs 1 Aug 2003 22:02:37 -0000 1.8 --- XmlMailstoreProvider.cs 2 Aug 2003 15:57:10 -0000 1.9 *************** *** 206,210 **** { DataRow message = messages[idx]; ! msgs.Add(new Message(this, message["Id"], uint.Parse(message["UniqueIdentifier"].ToString()), bool.Parse(message["Seen"].ToString()), bool.Parse(message["Answered"].ToString()), bool.Parse(message["Flagged"].ToString()), bool.Parse(message["Deleted"].ToString()), bool.Parse(message["Draft"].ToString()), int.Parse(message["Size"].ToString()))); } --- 206,210 ---- { DataRow message = messages[idx]; ! msgs.Add(new Message(this, message["Id"], uint.Parse(message["UniqueIdentifier"].ToString()), bool.Parse(message["Seen"].ToString()), bool.Parse(message["Answered"].ToString()), bool.Parse(message["Flagged"].ToString()), bool.Parse(message["Deleted"].ToString()), bool.Parse(message["Draft"].ToString()), int.Parse(message["Size"].ToString()), DateTime.Parse(message["InternalDate"].ToString()))); } |
From: <ta...@us...> - 2003-08-02 15:54:26
|
Update of /cvsroot/csmaild/csmaild/docs/rfcs In directory sc8-pr-cvs1:/tmp/cvs-serv4940/docs/rfcs Added Files: 2822 - Internet Message Format.txt Log Message: RFC2822 for reference --- NEW FILE: 2822 - Internet Message Format.txt --- Network Working Group P. Resnick, Editor Request for Comments: 2822 QUALCOMM Incorporated Obsoletes: 822 April 2001 Category: Standards Track Internet Message Format Status of this Memo This document specifies an Internet standards track protocol for the Internet community, and requests discussion and suggestions for improvements. Please refer to the current edition of the "Internet [...2812 lines suppressed...] Resnick Standards Track [Page 51] |
From: <ta...@us...> - 2003-08-01 22:02:41
|
Update of /cvsroot/csmaild/csmaild/src/Smtp In directory sc8-pr-cvs1:/tmp/cvs-serv25503/src/Smtp Added Files: .cvsignore AssemblyInfo.cs Smtp.2002.csproj Smtp.csproj Log Message: Updated 1.0 project files to include new stuff Added blank SMTP project Added initial rfc2822 message parser and object model (not finished but it's lightening outside ;)) Can now add messages to the messagecollection The enumerator for messagecollection works properly now Added method to mailstore provider to allow for accessing the raw message via a reader Added ability to have optional arguments on IMAP commands Fixed literal string parsing External accessors to the sequence range Very high level generic exception handling to handle all those errors I don't want to fix (and don't want them to mess up the connection) --- NEW FILE: .cvsignore --- *.csproj.user bin obj --- NEW FILE: AssemblyInfo.cs --- using System.Reflection; using System.Runtime.CompilerServices; // // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. // [assembly: AssemblyTitle("")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("")] [assembly: AssemblyCopyright("")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: [assembly: AssemblyVersion("1.0.*")] // // In order to sign your assembly you must specify a key to use. Refer to the // Microsoft .NET Framework documentation for more information on assembly signing. // // Use the attributes below to control which key is used for signing. // // Notes: // (*) If no key is specified, the assembly is not signed. // (*) KeyName refers to a key that has been installed in the Crypto Service // Provider (CSP) on your machine. KeyFile refers to a file which contains // a key. // (*) If the KeyFile and the KeyName values are both specified, the // following processing occurs: // (1) If the KeyName can be found in the CSP, that key is used. // (2) If the KeyName does not exist and the KeyFile does exist, the key // in the KeyFile is installed into the CSP and used. // (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. // When specifying the KeyFile, the location of the KeyFile should be // relative to the project output directory which is // %Project Directory%\obj\<configuration>. For example, if your KeyFile is // located in the project directory, you would specify the AssemblyKeyFile // attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] // (*) Delay Signing is an advanced option - see the Microsoft .NET Framework // documentation for more information on this. // [assembly: AssemblyDelaySign(false)] [assembly: AssemblyKeyFile("")] [assembly: AssemblyKeyName("")] --- NEW FILE: Smtp.2002.csproj --- <VisualStudioProject> <CSHARP ProjectType = "Local" ProductVersion = "7.0.9466" SchemaVersion = "1.0" ProjectGuid = "{DD1BF484-EAC2-4C41-8CD5-C45E3CFFA9AA}" > <Build> <Settings ApplicationIcon = "" AssemblyKeyContainerName = "" AssemblyName = "Smtp" AssemblyOriginatorKeyFile = "" DefaultClientScript = "JScript" DefaultHTMLPageLayout = "Grid" DefaultTargetSchema = "IE50" DelaySign = "false" OutputType = "Library" RootNamespace = "Smtp" StartupObject = "" > <Config Name = "Debug" AllowUnsafeBlocks = "false" BaseAddress = "285212672" CheckForOverflowUnderflow = "false" ConfigurationOverrideFile = "" DefineConstants = "DEBUG;TRACE" DocumentationFile = "" DebugSymbols = "true" FileAlignment = "4096" IncrementalBuild = "false" Optimize = "false" OutputPath = "bin\Debug\" RegisterForComInterop = "false" RemoveIntegerChecks = "false" TreatWarningsAsErrors = "false" WarningLevel = "4" /> <Config Name = "Release" AllowUnsafeBlocks = "false" BaseAddress = "285212672" CheckForOverflowUnderflow = "false" ConfigurationOverrideFile = "" DefineConstants = "TRACE" DocumentationFile = "" DebugSymbols = "false" FileAlignment = "4096" IncrementalBuild = "false" Optimize = "true" OutputPath = "bin\Release\" RegisterForComInterop = "false" RemoveIntegerChecks = "false" TreatWarningsAsErrors = "false" WarningLevel = "4" /> </Settings> <References> <Reference Name = "System" AssemblyName = "System" HintPath = "..\..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.0.3705\System.dll" /> <Reference Name = "System.Data" AssemblyName = "System.Data" HintPath = "..\..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.0.3705\System.Data.dll" /> <Reference Name = "System.XML" AssemblyName = "System.XML" HintPath = "..\..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.0.3705\System.XML.dll" /> </References> </Build> <Files> <Include> <File RelPath = "AssemblyInfo.cs" SubType = "Code" BuildAction = "Compile" /> </Include> </Files> </CSHARP> </VisualStudioProject> --- NEW FILE: Smtp.csproj --- <VisualStudioProject> <CSHARP ProjectType = "Local" ProductVersion = "7.10.3077" SchemaVersion = "2.0" ProjectGuid = "{DD1BF484-EAC2-4C41-8CD5-C45E3CFFA9AA}" > <Build> <Settings ApplicationIcon = "" AssemblyKeyContainerName = "" AssemblyName = "Smtp" AssemblyOriginatorKeyFile = "" DefaultClientScript = "JScript" DefaultHTMLPageLayout = "Grid" DefaultTargetSchema = "IE50" DelaySign = "false" OutputType = "Library" PreBuildEvent = "" PostBuildEvent = "" RootNamespace = "Smtp" RunPostBuildEvent = "OnBuildSuccess" StartupObject = "" > <Config Name = "Debug" AllowUnsafeBlocks = "false" BaseAddress = "285212672" CheckForOverflowUnderflow = "false" ConfigurationOverrideFile = "" DefineConstants = "DEBUG;TRACE" DocumentationFile = "" DebugSymbols = "true" FileAlignment = "4096" IncrementalBuild = "false" NoStdLib = "false" NoWarn = "" Optimize = "false" OutputPath = "bin\Debug\" RegisterForComInterop = "false" RemoveIntegerChecks = "false" TreatWarningsAsErrors = "false" WarningLevel = "4" /> <Config Name = "Release" AllowUnsafeBlocks = "false" BaseAddress = "285212672" CheckForOverflowUnderflow = "false" ConfigurationOverrideFile = "" DefineConstants = "TRACE" DocumentationFile = "" DebugSymbols = "false" FileAlignment = "4096" IncrementalBuild = "false" NoStdLib = "false" NoWarn = "" Optimize = "true" OutputPath = "bin\Release\" RegisterForComInterop = "false" RemoveIntegerChecks = "false" TreatWarningsAsErrors = "false" WarningLevel = "4" /> </Settings> <References> <Reference Name = "System" AssemblyName = "System" HintPath = "..\..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.dll" /> <Reference Name = "System.Data" AssemblyName = "System.Data" HintPath = "..\..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Data.dll" /> <Reference Name = "System.XML" AssemblyName = "System.XML" HintPath = "..\..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.XML.dll" /> </References> </Build> <Files> <Include> <File RelPath = "AssemblyInfo.cs" SubType = "Code" BuildAction = "Compile" /> </Include> </Files> </CSHARP> </VisualStudioProject> |
From: <ta...@us...> - 2003-08-01 22:02:41
|
Update of /cvsroot/csmaild/csmaild/src/Imap In directory sc8-pr-cvs1:/tmp/cvs-serv25503/src/Imap Modified Files: Connection.cs Log Message: Updated 1.0 project files to include new stuff Added blank SMTP project Added initial rfc2822 message parser and object model (not finished but it's lightening outside ;)) Can now add messages to the messagecollection The enumerator for messagecollection works properly now Added method to mailstore provider to allow for accessing the raw message via a reader Added ability to have optional arguments on IMAP commands Fixed literal string parsing External accessors to the sequence range Very high level generic exception handling to handle all those errors I don't want to fix (and don't want them to mess up the connection) Index: Connection.cs =================================================================== RCS file: /cvsroot/csmaild/csmaild/src/Imap/Connection.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Connection.cs 28 Jul 2003 00:15:17 -0000 1.7 --- Connection.cs 1 Aug 2003 22:02:37 -0000 1.8 *************** *** 188,194 **** throw new Exception("Fucked up, this is just fucked up!"); ! // this command will parse through the incoming line and make sure it's valid ! if(ParseAndValidate(line) && mCurrentCommand.Process()) { } ReadCommand(); --- 188,203 ---- throw new Exception("Fucked up, this is just fucked up!"); ! ParseAndValidate(line); ! ! try { + if(mCurrentCommand.Process()) + { + } + } + catch(Exception ex) + { + SendTaggedMessage("BAD Unhandled error: " + ex.Message); + Console.WriteLine(ex.ToString()); } ReadCommand(); |
From: <ta...@us...> - 2003-08-01 22:02:40
|
Update of /cvsroot/csmaild/csmaild/src In directory sc8-pr-cvs1:/tmp/cvs-serv25503/src Modified Files: csmaild.2002.sln csmaild.sln Log Message: Updated 1.0 project files to include new stuff Added blank SMTP project Added initial rfc2822 message parser and object model (not finished but it's lightening outside ;)) Can now add messages to the messagecollection The enumerator for messagecollection works properly now Added method to mailstore provider to allow for accessing the raw message via a reader Added ability to have optional arguments on IMAP commands Fixed literal string parsing External accessors to the sequence range Very high level generic exception handling to handle all those errors I don't want to fix (and don't want them to mess up the connection) Index: csmaild.2002.sln =================================================================== RCS file: /cvsroot/csmaild/csmaild/src/csmaild.2002.sln,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** csmaild.2002.sln 29 Jul 2003 00:46:29 -0000 1.2 --- csmaild.2002.sln 1 Aug 2003 22:02:37 -0000 1.3 *************** *** 10,13 **** --- 10,15 ---- Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Pop.2002", "Pop\Pop.2002.csproj", "{C33A99C2-62F0-4165-9C9E-DA97B10AB3B3}" EndProject + Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Smtp.2002", "Smtp\Smtp.2002.csproj", "{DD1BF484-EAC2-4C41-8CD5-C45E3CFFA9AA}" + EndProject Global GlobalSection(SolutionConfiguration) = preSolution *************** *** 38,41 **** --- 40,47 ---- {C33A99C2-62F0-4165-9C9E-DA97B10AB3B3}.Release.ActiveCfg = Release|.NET {C33A99C2-62F0-4165-9C9E-DA97B10AB3B3}.Release.Build.0 = Release|.NET + {DD1BF484-EAC2-4C41-8CD5-C45E3CFFA9AA}.Debug.ActiveCfg = Debug|.NET + {DD1BF484-EAC2-4C41-8CD5-C45E3CFFA9AA}.Debug.Build.0 = Debug|.NET + {DD1BF484-EAC2-4C41-8CD5-C45E3CFFA9AA}.Release.ActiveCfg = Release|.NET + {DD1BF484-EAC2-4C41-8CD5-C45E3CFFA9AA}.Release.Build.0 = Release|.NET EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution Index: csmaild.sln =================================================================== RCS file: /cvsroot/csmaild/csmaild/src/csmaild.sln,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** csmaild.sln 29 Jul 2003 00:46:29 -0000 1.3 --- csmaild.sln 1 Aug 2003 22:02:37 -0000 1.4 *************** *** 20,23 **** --- 20,27 ---- EndProjectSection EndProject + Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Smtp", "Smtp\Smtp.csproj", "{DD1BF484-EAC2-4C41-8CD5-C45E3CFFA9AA}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection + EndProject Global GlobalSection(SolutionConfiguration) = preSolution *************** *** 46,49 **** --- 50,57 ---- {C33A99C2-62F0-4165-9C9E-DA97B10AB3B3}.Release.ActiveCfg = Release|.NET {C33A99C2-62F0-4165-9C9E-DA97B10AB3B3}.Release.Build.0 = Release|.NET + {DD1BF484-EAC2-4C41-8CD5-C45E3CFFA9AA}.Debug.ActiveCfg = Debug|.NET + {DD1BF484-EAC2-4C41-8CD5-C45E3CFFA9AA}.Debug.Build.0 = Debug|.NET + {DD1BF484-EAC2-4C41-8CD5-C45E3CFFA9AA}.Release.ActiveCfg = Release|.NET + {DD1BF484-EAC2-4C41-8CD5-C45E3CFFA9AA}.Release.Build.0 = Release|.NET EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution |
From: <ta...@us...> - 2003-08-01 22:02:40
|
Update of /cvsroot/csmaild/csmaild/src/Common/Rfc2822 In directory sc8-pr-cvs1:/tmp/cvs-serv25503/src/Common/Rfc2822 Added Files: Address.cs AddressGroup.cs AddressList.cs AddressMailbox.cs AddressMailboxList.cs HeaderField.cs HeaderFieldList.cs Interpreter.cs Message.cs MessageBody.cs Log Message: Updated 1.0 project files to include new stuff Added blank SMTP project Added initial rfc2822 message parser and object model (not finished but it's lightening outside ;)) Can now add messages to the messagecollection The enumerator for messagecollection works properly now Added method to mailstore provider to allow for accessing the raw message via a reader Added ability to have optional arguments on IMAP commands Fixed literal string parsing External accessors to the sequence range Very high level generic exception handling to handle all those errors I don't want to fix (and don't want them to mess up the connection) --- NEW FILE: Address.cs --- using System; namespace Common.Rfc2822 { abstract public class Address { } } --- NEW FILE: AddressGroup.cs --- using System; namespace Common.Rfc2822 { public class AddressGroup : Address { private string mDisplayName; private AddressMailboxList mList; public string DisplayName { get { return mDisplayName; } } public AddressMailboxList List { get { return mList; } } public AddressGroup(string displayName, AddressMailboxList list) { mDisplayName = displayName; mList = list; } } } --- NEW FILE: AddressList.cs --- using System; using System.Collections; using System.Text; namespace Common.Rfc2822 { public class AddressList { private ArrayList mList; public Address this[int idx] { get { return (Address)mList[idx]; } } public AddressList() { mList = new ArrayList(); } public void Add(Address addr) { mList.Add(addr); } } } --- NEW FILE: AddressMailbox.cs --- using System; namespace Common.Rfc2822 { public class AddressMailbox : Address { private string mLocalPart; private string mDisplayName; private string mHost; public string MailAddress { get { return mLocalPart + "@" + mHost; } } public string LocalPart { get { return mLocalPart; } } public string Host { get { return mHost; } } public string DisplayName { get { return mDisplayName; } } public AddressMailbox(string displayName, string localPart, string host) { mDisplayName = displayName; mLocalPart = localPart; mHost = host; } } } --- NEW FILE: AddressMailboxList.cs --- using System; using System.Collections; namespace Common.Rfc2822 { public class AddressMailboxList { private ArrayList mList; public AddressMailbox this[int idx] { get { return (AddressMailbox)mList[idx]; } } public AddressMailboxList() { mList = new ArrayList(); } public void Add(AddressMailbox box) { mList.Add(box); } } } --- NEW FILE: HeaderField.cs --- using System; namespace Common.Rfc2822 { public class HeaderField { protected string mFieldName; protected object mFieldValue; public string FieldName { get { return mFieldName; } } public string FieldValueString { get { return (string)mFieldValue; } } public AddressList FieldValueAddressList { get { return (AddressList)mFieldValue; } } public HeaderField(string fieldName, object fieldValue) { mFieldName = fieldName; mFieldValue = fieldValue; } } } --- NEW FILE: HeaderFieldList.cs --- using System; using System.Collections; using System.Text; namespace Common.Rfc2822 { public class HeaderFieldList { private ArrayList mList; private Hashtable mNameList; public HeaderField this[int idx] { get { return (HeaderField)mList[idx]; } } public HeaderField[] this[string name] { get { ArrayList lst = (ArrayList)mNameList[name]; if(lst != null) return (HeaderField[])lst.ToArray(typeof(HeaderField)); else return new HeaderField[]{}; } } public HeaderFieldList() { mList = new ArrayList(); mNameList = new Hashtable(); } public void Add(HeaderField fld) { mList.Add(fld); ArrayList lst = (ArrayList)mNameList[fld.FieldName]; if(lst == null) lst = new ArrayList(); lst.Add(fld); mNameList[fld.FieldName] = lst; } } } --- NEW FILE: Interpreter.cs --- using System; using System.IO; using System.Text; namespace Common.Rfc2822 { public class Interpreter { private static string Whitespace = " \t"; private TextReader mRawMessage; public Interpreter(string msg) : this(new StringReader(msg)) {} public Interpreter(TextReader msg) { mRawMessage = msg; } public Message Interpret() { Message msg = new Message(); InterpretHeaderList(msg.Headers); InterpretBody(msg.Body); return msg; } #region Headers private void InterpretHeaderList(HeaderFieldList hdrList) { while(true) { string hdr = mRawMessage.ReadLine(); if(hdr == null || hdr == string.Empty) // not there or empty, done with headers break; // while lines continue to start with whitespace, add 'em to the header while(Whitespace.IndexOf(Convert.ToChar(mRawMessage.Peek())) != -1) hdr += mRawMessage.ReadLine(); // we're done reading the header hdrList.Add(InterpretHeader(hdr)); } } private HeaderField InterpretHeader(string rawHeader) { int colonIdx = rawHeader.IndexOf(':'); string fieldName = rawHeader.Substring(0, colonIdx); string fieldValu = rawHeader.Substring(colonIdx+1); // TODO: parse/validate/correct the header based on its name switch(fieldName.ToLower()) { case "date": return new HeaderField(fieldName, InterpretDateTime(fieldValu)); case "to": return new HeaderField(fieldName, InterpretAddressList(fieldValu)); default: return new HeaderField(fieldName, fieldValu); } } #endregion #region Addresses private AddressList InterpretAddressList(string rawList) { AddressList list = new AddressList(); int startIdx = 0; while(true) { int idx = rawList.IndexOfAny(new char[]{':', ','}, startIdx); if(idx == -1) { list.Add(InterpretAddressMailbox(rawList.Substring(startIdx))); break; } else if(rawList[idx] == ',') list.Add(InterpretAddressMailbox(rawList.Substring(startIdx, idx-startIdx))); else { idx = rawList.IndexOf(';', idx+1); list.Add(InterpretAddressGroup(rawList.Substring(startIdx, idx-startIdx))); } startIdx = idx+1; // set the next starting point to the character after the seperator } return list; } private AddressMailbox InterpretAddressMailbox(string rawMailbox) { int atIdx = rawMailbox.IndexOf('@'); int spIdx = rawMailbox.LastIndexOf(' ', atIdx); string host = rawMailbox.Substring(atIdx+1); string displayName = rawMailbox.Substring(0, spIdx); string localPart = rawMailbox.Substring(spIdx+1, atIdx-spIdx); return new AddressMailbox(displayName, localPart, host); } private AddressGroup InterpretAddressGroup(string rawGroup) { int colonIdx = rawGroup.IndexOf(':'); string displayName = rawGroup.Substring(0, colonIdx); string addrList = rawGroup.Substring(colonIdx+1); AddressMailboxList list = new AddressMailboxList(); InterpretAddressMailboxList(addrList, list); return new AddressGroup(displayName, list); } private void InterpretAddressMailboxList(string rawList, AddressMailboxList list) { string[] addrs = rawList.Split(','); foreach(string addr in addrs) list.Add(InterpretAddressMailbox(addr)); } #endregion #region Date Time private string InterpretDateTime(string rawDateTime) { // validate and correct, possibly also convert to System.DateTime for easy use outside of Rfc2822 return rawDateTime; } #endregion #region Body private void InterpretBody(MessageBody bdy) { } #endregion } } --- NEW FILE: Message.cs --- using System; using System.IO; using System.Text; namespace Common.Rfc2822 { public class Message { private HeaderFieldList mHeaders; private MessageBody mBody; public HeaderFieldList Headers { get { return mHeaders; } } public MessageBody Body { get { return mBody; } } public Message() { mHeaders = new HeaderFieldList(); mBody = new MessageBody(); } } } --- NEW FILE: MessageBody.cs --- using System; using System.IO; namespace Common.Rfc2822 { public class MessageBody { public MessageBody() { } } } |
From: <ta...@us...> - 2003-08-01 22:02:40
|
Update of /cvsroot/csmaild/csmaild/src/Imap/Commands In directory sc8-pr-cvs1:/tmp/cvs-serv25503/src/Imap/Commands Modified Files: ImapCommand.cs Log Message: Updated 1.0 project files to include new stuff Added blank SMTP project Added initial rfc2822 message parser and object model (not finished but it's lightening outside ;)) Can now add messages to the messagecollection The enumerator for messagecollection works properly now Added method to mailstore provider to allow for accessing the raw message via a reader Added ability to have optional arguments on IMAP commands Fixed literal string parsing External accessors to the sequence range Very high level generic exception handling to handle all those errors I don't want to fix (and don't want them to mess up the connection) Index: ImapCommand.cs =================================================================== RCS file: /cvsroot/csmaild/csmaild/src/Imap/Commands/ImapCommand.cs,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** ImapCommand.cs 30 Jul 2003 22:37:56 -0000 1.10 --- ImapCommand.cs 1 Aug 2003 22:02:37 -0000 1.11 *************** *** 111,115 **** #region Global argument stuff ! [Flags()] protected enum ArgumentType { CustomHandler = 0, --- 111,115 ---- #region Global argument stuff ! protected enum ArgumentType { CustomHandler = 0, *************** *** 124,127 **** --- 124,130 ---- ParenthesizedList = 64, ParenthesizedListAtom = 66, // paren(64) + atom(2) + Optional = 128, + OptionalParenthesizedList = 192, + OptionalQuotedString = 129 } *************** *** 130,140 **** for(int idx = 0; idx < mArgumentTypes.Length; ++idx) { ! if(mUnparsedArgumentIdx >= mUnparsedArguments.Length) ! return false; ! else if(mUnparsedArguments[mUnparsedArgumentIdx++] != ' ') ! return false; ! object arg = ParseArgument(mArgumentTypes[idx]); ! if(arg == null) ! return false; mParsedArguments[idx] = arg; } --- 133,158 ---- for(int idx = 0; idx < mArgumentTypes.Length; ++idx) { ! object arg = null; ! if((mArgumentTypes[idx] & ArgumentType.Optional) == ArgumentType.Optional) ! { ! if(mUnparsedArgumentIdx < mUnparsedArguments.Length) ! { ! if(mUnparsedArguments[mUnparsedArgumentIdx++] != ' ') ! return false; ! arg = ParseArgument(mArgumentTypes[idx]); ! if(arg == null) ! --mUnparsedArgumentIdx; // move back to the space ! } ! } ! else ! { ! if(mUnparsedArgumentIdx >= mUnparsedArguments.Length) ! return false; ! else if(mUnparsedArguments[mUnparsedArgumentIdx++] != ' ') ! return false; ! arg = ParseArgument(mArgumentTypes[idx]); ! if(arg == null) ! return false; ! } mParsedArguments[idx] = arg; } *************** *** 201,206 **** string literalString = mConnection.ReadBlockAsString((int)literalSize); ! // make sure it's a valid literal string (any ascii character besides \0 ! if(!Regex.IsMatch(literalString, @"^[\x01-\xFF]$")) return null; --- 219,224 ---- string literalString = mConnection.ReadBlockAsString((int)literalSize); ! // make sure it's a valid literal string (any ascii character besides \0) ! if(!Regex.IsMatch(literalString, @"^[\x01-\xFF]*$")) return null; *************** *** 315,318 **** --- 333,352 ---- private SequenceRange mNext; + public SequenceRange NextRange + { + get + { + return mNext; + } + } + + public SequenceRange PreviousRange + { + get + { + return mPrevious; + } + } + public uint Low { *************** *** 413,416 **** --- 447,458 ---- private SequenceRange mRootNode; + + public SequenceRange FirstRange + { + get + { + return mRootNode; + } + } public void AddRange(uint num) |
From: <ta...@us...> - 2003-08-01 22:02:40
|
Update of /cvsroot/csmaild/csmaild/src/Common In directory sc8-pr-cvs1:/tmp/cvs-serv25503/src/Common Modified Files: Common.2002.csproj Common.csproj Mailbox.cs Message.cs MessageCollection.cs Log Message: Updated 1.0 project files to include new stuff Added blank SMTP project Added initial rfc2822 message parser and object model (not finished but it's lightening outside ;)) Can now add messages to the messagecollection The enumerator for messagecollection works properly now Added method to mailstore provider to allow for accessing the raw message via a reader Added ability to have optional arguments on IMAP commands Fixed literal string parsing External accessors to the sequence range Very high level generic exception handling to handle all those errors I don't want to fix (and don't want them to mess up the connection) Index: Common.2002.csproj =================================================================== RCS file: /cvsroot/csmaild/csmaild/src/Common/Common.2002.csproj,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Common.2002.csproj 29 Jul 2003 00:46:28 -0000 1.2 --- Common.2002.csproj 1 Aug 2003 22:02:37 -0000 1.3 *************** *** 137,140 **** --- 137,190 ---- BuildAction = "Compile" /> + <File + RelPath = "Rfc2822\Address.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "Rfc2822\AddressGroup.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "Rfc2822\AddressList.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "Rfc2822\AddressMailbox.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "Rfc2822\AddressMailboxList.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "Rfc2822\HeaderField.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "Rfc2822\HeaderFieldList.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "Rfc2822\Interpreter.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "Rfc2822\Message.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "Rfc2822\MessageBody.cs" + SubType = "Code" + BuildAction = "Compile" + /> </Include> </Files> Index: Common.csproj =================================================================== RCS file: /cvsroot/csmaild/csmaild/src/Common/Common.csproj,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Common.csproj 29 Jul 2003 00:46:28 -0000 1.6 --- Common.csproj 1 Aug 2003 22:02:37 -0000 1.7 *************** *** 144,147 **** --- 144,197 ---- BuildAction = "Compile" /> + <File + RelPath = "Rfc2822\Address.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "Rfc2822\AddressGroup.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "Rfc2822\AddressList.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "Rfc2822\AddressMailbox.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "Rfc2822\AddressMailboxList.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "Rfc2822\HeaderField.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "Rfc2822\HeaderFieldList.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "Rfc2822\Interpreter.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "Rfc2822\Message.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "Rfc2822\MessageBody.cs" + SubType = "Code" + BuildAction = "Compile" + /> </Include> </Files> Index: Mailbox.cs =================================================================== RCS file: /cvsroot/csmaild/csmaild/src/Common/Mailbox.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Mailbox.cs 30 Jul 2003 22:32:34 -0000 1.8 --- Mailbox.cs 1 Aug 2003 22:02:37 -0000 1.9 *************** *** 162,166 **** // TODO: make this more efficient then having to load all the messages for(uint idx = 0; idx < Messages.Count; ++idx) ! if(!Messages.BySeq(idx).Seen) return idx; return 0; --- 162,166 ---- // TODO: make this more efficient then having to load all the messages for(uint idx = 0; idx < Messages.Count; ++idx) ! if(!Messages.BySeq(idx+1).Seen) return idx; return 0; Index: Message.cs =================================================================== RCS file: /cvsroot/csmaild/csmaild/src/Common/Message.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Message.cs 29 Jul 2003 00:46:28 -0000 1.4 --- Message.cs 1 Aug 2003 22:02:37 -0000 1.5 *************** *** 2,5 **** --- 2,7 ---- using System; + using System.Collections.Specialized; + using System.IO; namespace Common *************** *** 131,134 **** --- 133,144 ---- { return mSize; + } + } + + public Rfc2822.Message Rfc822Message + { + get + { + return new Rfc2822.Interpreter(mMailstoreProvider.GetRawMessageReader(mProvidersIdentifier)).Interpret(); } } Index: MessageCollection.cs =================================================================== RCS file: /cvsroot/csmaild/csmaild/src/Common/MessageCollection.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MessageCollection.cs 29 Jul 2003 00:46:28 -0000 1.2 --- MessageCollection.cs 1 Aug 2003 22:02:37 -0000 1.3 *************** *** 46,49 **** --- 46,51 ---- public void Add(Message msg) { + mSequenceList.Add((uint)(mSequenceList.Count+1), msg); + mUidList.Add(msg.UniqueId, msg); } *************** *** 55,59 **** public override IEnumerator GetEnumerator() { ! return mSequenceList.GetEnumerator(); } #endregion --- 57,61 ---- public override IEnumerator GetEnumerator() { ! return mSequenceList.Values.GetEnumerator(); } #endregion |
From: <ta...@us...> - 2003-08-01 22:02:40
|
Update of /cvsroot/csmaild/csmaild/src/Common/MailstoreProviders In directory sc8-pr-cvs1:/tmp/cvs-serv25503/src/Common/MailstoreProviders Modified Files: IMailstoreProvider.cs XmlMailstoreProvider.cs Log Message: Updated 1.0 project files to include new stuff Added blank SMTP project Added initial rfc2822 message parser and object model (not finished but it's lightening outside ;)) Can now add messages to the messagecollection The enumerator for messagecollection works properly now Added method to mailstore provider to allow for accessing the raw message via a reader Added ability to have optional arguments on IMAP commands Fixed literal string parsing External accessors to the sequence range Very high level generic exception handling to handle all those errors I don't want to fix (and don't want them to mess up the connection) Index: IMailstoreProvider.cs =================================================================== RCS file: /cvsroot/csmaild/csmaild/src/Common/MailstoreProviders/IMailstoreProvider.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** IMailstoreProvider.cs 29 Jul 2003 00:46:28 -0000 1.6 --- IMailstoreProvider.cs 1 Aug 2003 22:02:37 -0000 1.7 *************** *** 1,3 **** --- 1,4 ---- using System; + using System.IO; namespace Common.MailstoreProviders *************** *** 8,11 **** --- 9,18 ---- public interface IMailstoreProvider { + #region "General stuff" + void BeginTransaction(); + void CommitTransaction(); + void RollbackTransaction(); + #endregion + #region User accessors /// <summary> *************** *** 75,78 **** --- 82,93 ---- /// <returns>The message found, or null if none found</returns> Message GetMessage(Mailbox box, int uniqueId); + + /// <summary> + /// Gets a reader for the raw text of the message (be sure to close it when you're done) + /// </summary> + /// <param name="box">The mailbox the message is located in</param> + /// <param name="uniqueId">The unique identifier of the message</param> + /// <returns>An open TextReader for the message text if found, or null if not</returns> + TextReader GetRawMessageReader(object providersId); /// <summary> Index: XmlMailstoreProvider.cs =================================================================== RCS file: /cvsroot/csmaild/csmaild/src/Common/MailstoreProviders/XmlMailstoreProvider.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** XmlMailstoreProvider.cs 29 Jul 2003 00:46:28 -0000 1.7 --- XmlMailstoreProvider.cs 1 Aug 2003 22:02:37 -0000 1.8 *************** *** 1,4 **** --- 1,5 ---- using System; using System.Data; + using System.IO; namespace Common.MailstoreProviders *************** *** 6,14 **** public class XmlMailstoreProvider : IMailstoreProvider { private string mFolderPath; ! private DataSet mMessageSet = new DataSet(); ! private DataSet mMailboxSet = new DataSet(); ! private DataSet mUserSet = new DataSet(); private DataTable mMessages; private DataTable mMailboxes; --- 7,16 ---- public class XmlMailstoreProvider : IMailstoreProvider { + #region Variables private string mFolderPath; ! private DataSet mMessageSet; ! private DataSet mMailboxSet; ! private DataSet mUserSet; private DataTable mMessages; private DataTable mMailboxes; *************** *** 18,22 **** --- 20,26 ---- private uint mNextMailboxId; private uint mNextUserId; + #endregion + #region Constructor public XmlMailstoreProvider(string folderPath) { *************** *** 26,43 **** mFolderPath += @"\"; - mMessageSet.ReadXml(mFolderPath + "Messages.xml"); - mMessages = mMessageSet.Tables[0]; - mNextMessageId = (uint)DateTime.Now.Ticks; mNextMailboxId = (uint)DateTime.Now.Ticks; mNextUserId = (uint)DateTime.Now.Ticks; ! mMailboxSet.ReadXml(mFolderPath + "Mailboxes.xml"); ! mMailboxes = mMailboxSet.Tables[0]; ! ! mUserSet.ReadXml(mFolderPath + "Users.xml"); ! mUsers = mUserSet.Tables[0]; } #region User accessors public User GetUser(string username, string password) --- 30,59 ---- mFolderPath += @"\"; mNextMessageId = (uint)DateTime.Now.Ticks; mNextMailboxId = (uint)DateTime.Now.Ticks; mNextUserId = (uint)DateTime.Now.Ticks; ! Load(true, true, true); } + #endregion + + #region General Stuff + public void BeginTransaction() + { + throw new NotImplementedException(); + } + + public void CommitTransaction() + { + throw new NotImplementedException(); + } + + public void RollbackTransaction() + { + throw new NotImplementedException(); + } + #endregion + #region User accessors public User GetUser(string username, string password) *************** *** 172,176 **** return null; } ! public MessageCollection GetMessages(Mailbox box) { --- 188,201 ---- return null; } ! ! public TextReader GetRawMessageReader(object providersId) ! { ! DataRow[] msgs = mMessages.Select("Id = '" + providersId + "'"); ! if(msgs.Length == 1) ! return new StringReader(msgs[0]["RawMessage"] as string); ! else ! return null; ! } ! public MessageCollection GetMessages(Mailbox box) { *************** *** 199,202 **** --- 224,242 ---- #endregion + + private void Load(bool loadUsers, bool loadMailboxes, bool loadMessages) + { + mMessageSet = new DataSet(); + mMessageSet.ReadXml(mFolderPath + "Messages.xml"); + mMessages = mMessageSet.Tables[0]; + + mMailboxSet = new DataSet(); + mMailboxSet.ReadXml(mFolderPath + "Mailboxes.xml"); + mMailboxes = mMailboxSet.Tables[0]; + + mUserSet = new DataSet(); + mUserSet.ReadXml(mFolderPath + "Users.xml"); + mUsers = mUserSet.Tables[0]; + } private void Save(bool saveUsers, bool saveMailboxes, bool saveMessages) |
From: <ta...@us...> - 2003-08-01 21:55:36
|
Update of /cvsroot/csmaild/csmaild/src/Common/Rfc2822 In directory sc8-pr-cvs1:/tmp/cvs-serv24179/Rfc2822 Log Message: Directory /cvsroot/csmaild/csmaild/src/Common/Rfc2822 added to the repository |
From: <ta...@us...> - 2003-08-01 21:55:32
|
Update of /cvsroot/csmaild/csmaild/src/Smtp In directory sc8-pr-cvs1:/tmp/cvs-serv24156/Smtp Log Message: Directory /cvsroot/csmaild/csmaild/src/Smtp added to the repository |
From: <ta...@us...> - 2003-08-01 17:07:41
|
Update of /cvsroot/csmaild/csmailc In directory sc8-pr-cvs1:/tmp/cvs-serv23605 Added Files: gpl license.txt Log Message: Initial load --- NEW FILE: gpl license.txt --- GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. <one line to give the program's name and a brief idea of what it does.> Copyright (C) <year> <name of author> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. <signature of Ty Coon>, 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. |
From: <ta...@us...> - 2003-07-30 22:46:03
|
Update of /cvsroot/csmaild/csmaild/src/Common/NetworkManager In directory sc8-pr-cvs1:/tmp/cvs-serv16995/NetworkManager Log Message: Directory /cvsroot/csmaild/csmaild/src/Common/NetworkManager added to the repository |