diff --git a/BouncyCastle.Crypto.dll b/BouncyCastle.Crypto.dll
new file mode 100644
index 0000000..c73649f
Binary files /dev/null and b/BouncyCastle.Crypto.dll differ
diff --git a/MailKit.dll b/MailKit.dll
new file mode 100644
index 0000000..19de400
Binary files /dev/null and b/MailKit.dll differ
diff --git a/MimeKit.dll b/MimeKit.dll
new file mode 100644
index 0000000..bd0148f
Binary files /dev/null and b/MimeKit.dll differ
diff --git a/prebuild.xml b/prebuild.xml
index b4adb71..88bac3a 100644
--- a/prebuild.xml
+++ b/prebuild.xml
@@ -30,6 +30,10 @@
+
+
+
+
diff --git a/src/MailKit/AccessControl.cs b/src/MailKit/AccessControl.cs
deleted file mode 100644
index cd7e5bb..0000000
--- a/src/MailKit/AccessControl.cs
+++ /dev/null
@@ -1,137 +0,0 @@
-//
-// AccessControl.cs
-//
-// Author: Jeffrey Stedfast
-//
-// Copyright (c) 2013-2020 .NET Foundation and Contributors
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-using System;
-using System.Collections.Generic;
-
-namespace MailKit {
- ///
- /// An Access Control.
- ///
- ///
- /// An Access Control is a set of permissions available for a particular identity,
- /// controlling whether or not that identity has the ability to perform various tasks.
- ///
- ///
- ///
- ///
- public class AccessControl
- {
- ///
- /// Initializes a new instance of the class.
- ///
- ///
- /// Creates a new with the given name and
- /// access rights.
- ///
- /// The identifier name.
- /// The access rights.
- ///
- /// is null.
- /// -or-
- /// is null.
- ///
- public AccessControl (string name, IEnumerable rights)
- {
- if (name == null)
- throw new ArgumentNullException (nameof (name));
-
- Rights = new AccessRights (rights);
- Name = name;
- }
-
- ///
- /// Initializes a new instance of the class.
- ///
- ///
- /// Creates a new with the given name and
- /// access rights.
- ///
- /// The identifier name.
- /// The access rights.
- ///
- /// is null.
- /// -or-
- /// is null.
- ///
- public AccessControl (string name, string rights)
- {
- if (name == null)
- throw new ArgumentNullException (nameof (name));
-
- Rights = new AccessRights (rights);
- Name = name;
- }
-
- ///
- /// Initializes a new instance of the class.
- ///
- ///
- /// Creates a new with the given name and no
- /// access rights.
- ///
- /// The identifier name.
- ///
- /// is null.
- ///
- public AccessControl (string name)
- {
- if (name == null)
- throw new ArgumentNullException (nameof (name));
-
- Rights = new AccessRights ();
- Name = name;
- }
-
- ///
- /// The identifier name for the access control.
- ///
- ///
- /// The identifier name for the access control.
- ///
- ///
- ///
- ///
- /// The identifier name.
- public string Name {
- get; private set;
- }
-
- ///
- /// Get the access rights.
- ///
- ///
- /// Gets the access rights.
- ///
- ///
- ///
- ///
- /// The access rights.
- public AccessRights Rights {
- get; private set;
- }
- }
-}
diff --git a/src/MailKit/AccessControlList.cs b/src/MailKit/AccessControlList.cs
deleted file mode 100644
index 06ae9c8..0000000
--- a/src/MailKit/AccessControlList.cs
+++ /dev/null
@@ -1,66 +0,0 @@
-//
-// AccessControlList.cs
-//
-// Author: Jeffrey Stedfast
-//
-// Copyright (c) 2013-2020 .NET Foundation and Contributors
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-using System.Collections.Generic;
-
-namespace MailKit {
- ///
- /// An Access Control List (ACL)
- ///
- ///
- /// An Access Control List (ACL) is a list of access controls defining the permissions
- /// various identities have available.
- ///
- ///
- ///
- ///
- public class AccessControlList : List
- {
- ///
- /// Initializes a new instance of the class.
- ///
- ///
- /// Creates a new .
- ///
- /// The list of access controls.
- ///
- /// is null.
- ///
- public AccessControlList (IEnumerable controls) : base (controls)
- {
- }
-
- ///
- /// Initializes a new instance of the class.
- ///
- ///
- /// Creates a new .
- ///
- public AccessControlList ()
- {
- }
- }
-}
diff --git a/src/MailKit/AccessRight.cs b/src/MailKit/AccessRight.cs
deleted file mode 100644
index ccbb5db..0000000
--- a/src/MailKit/AccessRight.cs
+++ /dev/null
@@ -1,232 +0,0 @@
-//
-// AccessRight.cs
-//
-// Author: Jeffrey Stedfast
-//
-// Copyright (c) 2013-2020 .NET Foundation and Contributors
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-using System;
-
-namespace MailKit {
- ///
- /// An individual Access Right to be used with ACLs.
- ///
- ///
- /// An individual Access Right meant to be used with
- /// .
- /// For more information on what rights are available,
- /// see https://tools.ietf.org/html/rfc4314#section-2.1
- ///
- ///
- public struct AccessRight : IEquatable
- {
- ///
- /// The access right for folder lookups.
- ///
- ///
- /// Allows the to be visible when listing folders.
- ///
- public static readonly AccessRight LookupFolder = new AccessRight ('l');
-
- ///
- /// The access right for opening a folder and getting the status.
- ///
- ///
- /// Provides access for opening and getting the status of the folder.
- ///
- public static readonly AccessRight OpenFolder = new AccessRight ('r');
-
- ///
- /// The access right for adding or removing the Seen flag on messages in the folder.
- ///
- ///
- /// Provides access to add or remove the flag on messages within the
- /// .
- ///
- public static readonly AccessRight SetMessageSeen = new AccessRight ('s');
-
- ///
- /// The access right for adding or removing flags (other than Seen and Deleted)
- /// on messages in a folder.
- ///
- ///
- /// Provides access to add or remove the on messages
- /// (other than and
- /// ) within the folder.
- ///
- public static readonly AccessRight SetMessageFlags = new AccessRight ('w');
-
- ///
- /// The access right allowing messages to be appended or copied into the folder.
- ///
- ///
- /// Provides access to append or copy messages into the folder.
- ///
- public static readonly AccessRight AppendMessages = new AccessRight ('i');
-
- ///
- /// The access right allowing subfolders to be created.
- ///
- ///
- /// Provides access to create subfolders.
- ///
- public static readonly AccessRight CreateFolder = new AccessRight ('k');
-
- ///
- /// The access right for deleting a folder and/or its subfolders.
- ///
- ///
- /// Provides access to delete the folder and/or any subfolders.
- ///
- public static readonly AccessRight DeleteFolder = new AccessRight ('x');
-
- ///
- /// The access right for adding or removing the Deleted flag to messages within a folder.
- ///
- ///
- /// Provides access to add or remove the flag from
- /// messages within the folder. It also provides access for setting the
- /// flag when appending a message to a folder.
- ///
- public static readonly AccessRight SetMessageDeleted = new AccessRight ('t');
-
- ///
- /// The access right for expunging deleted messages in a folder.
- ///
- ///
- /// Provides access to expunge deleted messages in a folder.
- ///
- public static readonly AccessRight ExpungeFolder = new AccessRight ('e');
-
- ///
- /// The access right for administering the ACLs of a folder.
- ///
- ///
- /// Provides administrative access to change the ACLs for the folder.
- ///
- public static readonly AccessRight Administer = new AccessRight ('a');
-
- ///
- /// The character representing the particular access right.
- ///
- ///
- /// Represents the character value of the access right.
- ///
- public readonly char Right;
-
- ///
- /// Initializes a new instance of the struct.
- ///
- ///
- /// Creates a new struct.
- ///
- /// The access right.
- public AccessRight (char right)
- {
- Right = right;
- }
-
- #region IEquatable implementation
-
- ///
- /// Determines whether the specified is equal to the current .
- ///
- ///
- /// Determines whether the specified is equal to the current .
- ///
- /// The to compare with the current .
- /// true if the specified is equal to the current
- /// ; otherwise, false.
- public bool Equals (AccessRight other)
- {
- return other.Right == Right;
- }
-
- #endregion
-
- ///
- /// Determines whether two access rights are equal.
- ///
- ///
- /// Determines whether two access rights are equal.
- ///
- /// true if and are equal; otherwise, false.
- /// The first access right to compare.
- /// The second access right to compare.
- public static bool operator == (AccessRight right1, AccessRight right2)
- {
- return right1.Right == right2.Right;
- }
-
- ///
- /// Determines whether two access rights are not equal.
- ///
- ///
- /// Determines whether two access rights are not equal.
- ///
- /// true if and are not equal; otherwise, false.
- /// The first access right to compare.
- /// The second access right to compare.
- public static bool operator != (AccessRight right1, AccessRight right2)
- {
- return right1.Right != right2.Right;
- }
-
- ///
- /// Determines whether the specified is equal to the current .
- ///
- ///
- /// Determines whether the specified is equal to the current .
- ///
- /// The to compare with the current .
- /// true if the specified is equal to the current ;
- /// otherwise, false.
- public override bool Equals (object obj)
- {
- return obj is AccessRight && ((AccessRight) obj).Right == Right;
- }
-
- ///
- /// Serves as a hash function for a object.
- ///
- ///
- /// Serves as a hash function for a object.
- ///
- /// A hash code for this instance that is suitable for use in hashing algorithms and data structures such as a hash table.
- public override int GetHashCode ()
- {
- return Right.GetHashCode ();
- }
-
- ///
- /// Returns a that represents the current .
- ///
- ///
- /// Returns a that represents the current .
- ///
- /// A that represents the current .
- public override string ToString ()
- {
- return Right.ToString ();
- }
- }
-}
diff --git a/src/MailKit/AccessRights.cs b/src/MailKit/AccessRights.cs
deleted file mode 100644
index 8a07a71..0000000
--- a/src/MailKit/AccessRights.cs
+++ /dev/null
@@ -1,317 +0,0 @@
-//
-// AccessRights.cs
-//
-// Author: Jeffrey Stedfast
-//
-// Copyright (c) 2013-2020 .NET Foundation and Contributors
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-using System;
-using System.Collections;
-using System.Collections.Generic;
-
-namespace MailKit {
- ///
- /// A set of access rights.
- ///
- ///
- /// The set of access rights for a particular identity.
- ///
- public class AccessRights : ICollection
- {
- readonly List list = new List ();
-
- ///
- /// Initializes a new instance of the class.
- ///
- ///
- /// Creates a new set of access rights.
- ///
- /// The access rights.
- ///
- /// is null.
- ///
- public AccessRights (IEnumerable rights)
- {
- AddRange (rights);
- }
-
- ///
- /// Initializes a new instance of the class.
- ///
- ///
- /// Creates a new set of access rights.
- ///
- /// The access rights.
- ///
- /// is null.
- ///
- public AccessRights (string rights)
- {
- AddRange (rights);
- }
-
- ///
- /// Initializes a new instance of the class.
- ///
- ///
- /// Creates an empty set of access rights.
- ///
- public AccessRights ()
- {
- }
-
- ///
- /// Get the number of access rights in the collection.
- ///
- ///
- /// Gets the number of access rights in the collection.
- ///
- /// The count.
- public int Count {
- get { return list.Count; }
- }
-
- ///
- /// Get whether or not this set of access rights is read only.
- ///
- ///
- /// Gets whether or not this set of access rights is read only.
- ///
- /// true if this collection is read only; otherwise, false.
- public bool IsReadOnly {
- get { return false; }
- }
-
- ///
- /// Add the specified access right.
- ///
- ///
- /// Adds the specified access right if it is not already included.
- ///
- /// The access right.
- void ICollection.Add (AccessRight right)
- {
- Add (right);
- }
-
- ///
- /// Add the specified access right.
- ///
- ///
- /// Adds the specified access right if it is not already included.
- ///
- /// true if the right was added; otherwise, false.
- /// The access right.
- public bool Add (AccessRight right)
- {
- if (list.Contains (right))
- return false;
-
- list.Add (right);
-
- return true;
- }
-
- ///
- /// Add the specified right.
- ///
- ///
- /// Adds the right specified by the given character.
- ///
- /// true if the right was added; otherwise, false.
- /// The right.
- public bool Add (char right)
- {
- return Add (new AccessRight (right));
- }
-
- ///
- /// Add the rights specified by the characters in the given string.
- ///
- ///
- /// Adds the rights specified by the characters in the given string.
- ///
- /// The rights.
- ///
- /// is null.
- ///
- public void AddRange (string rights)
- {
- if (rights == null)
- throw new ArgumentNullException (nameof (rights));
-
- for (int i = 0; i < rights.Length; i++)
- Add (new AccessRight (rights[i]));
- }
-
- ///
- /// Add the range of specified rights.
- ///
- ///
- /// Adds the range of specified rights.
- ///
- /// The rights.
- ///
- /// is null.
- ///
- public void AddRange (IEnumerable rights)
- {
- if (rights == null)
- throw new ArgumentNullException (nameof (rights));
-
- foreach (var right in rights)
- Add (right);
- }
-
- ///
- /// Clears the access rights.
- ///
- ///
- /// Removes all of the access rights.
- ///
- public void Clear ()
- {
- list.Clear ();
- }
-
- ///
- /// Checks if the set of access rights contains the specified right.
- ///
- ///
- /// Determines whether or not the set of access rights already contains the specified right
- ///
- /// true if the specified right exists; otherwise false.
- /// The access right.
- public bool Contains (AccessRight right)
- {
- return list.Contains (right);
- }
-
- ///
- /// Copies all of the access rights to the specified array.
- ///
- ///
- /// Copies all of the access rights into the array,
- /// starting at the specified array index.
- ///
- /// The array.
- /// The array index.
- ///
- /// is null.
- ///
- ///
- /// is out of range.
- ///
- public void CopyTo (AccessRight[] array, int arrayIndex)
- {
- if (array == null)
- throw new ArgumentNullException (nameof (array));
-
- if (arrayIndex < 0 || arrayIndex + Count > array.Length)
- throw new ArgumentOutOfRangeException (nameof (arrayIndex));
-
- list.CopyTo (array, arrayIndex);
- }
-
- ///
- /// Removes the specified access right.
- ///
- ///
- /// Removes the specified access right.
- ///
- /// true if the access right was removed; otherwise false.
- /// The access right.
- public bool Remove (AccessRight right)
- {
- return list.Remove (right);
- }
-
- ///
- /// Get the access right at the specified index.
- ///
- ///
- /// Gets the access right at the specified index.
- ///
- /// The access right at the specified index.
- /// The index.
- ///
- /// is out of range.
- ///
- public AccessRight this [int index] {
- get {
- if (index < 0 || index >= list.Count)
- throw new ArgumentOutOfRangeException (nameof (index));
-
- return list[index];
- }
- }
-
- #region IEnumerable implementation
-
- ///
- /// Get the access rights enumerator.
- ///
- ///
- /// Gets the access rights enumerator.
- ///
- /// The enumerator.
- public IEnumerator GetEnumerator ()
- {
- return list.GetEnumerator ();
- }
-
- #endregion
-
- #region IEnumerable implementation
-
- ///
- /// Get the access rights enumerator.
- ///
- ///
- /// Gets the access rights enumerator.
- ///
- /// The enumerator.
- IEnumerator IEnumerable.GetEnumerator ()
- {
- return list.GetEnumerator ();
- }
-
- #endregion
-
- ///
- /// Return a that represents the current .
- ///
- ///
- /// Returns a that represents the current .
- ///
- /// A that represents the current .
- public override string ToString ()
- {
- var rights = new char[list.Count];
-
- for (int i = 0; i < list.Count; i++)
- rights[i] = list[i].Right;
-
- return new string (rights);
- }
- }
-}
diff --git a/src/MailKit/AlertEventArgs.cs b/src/MailKit/AlertEventArgs.cs
deleted file mode 100644
index 79c8279..0000000
--- a/src/MailKit/AlertEventArgs.cs
+++ /dev/null
@@ -1,69 +0,0 @@
-//
-// AlertEventArgs.cs
-//
-// Author: Jeffrey Stedfast
-//
-// Copyright (c) 2013-2020 .NET Foundation and Contributors
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-using System;
-
-namespace MailKit {
- ///
- /// Alert event arguments.
- ///
- ///
- /// Some implementations, such as
- /// , will emit Alert
- /// events when they receive alert messages from the server.
- ///
- public class AlertEventArgs : EventArgs
- {
- ///
- /// Initializes a new instance of the class.
- ///
- ///
- /// Creates a new .
- ///
- /// The alert message.
- ///
- /// is null.
- ///
- public AlertEventArgs (string message)
- {
- if (message == null)
- throw new ArgumentNullException (nameof (message));
-
- Message = message;
- }
-
- ///
- /// Gets the alert message.
- ///
- ///
- /// The alert message will be the exact message received from the server.
- ///
- /// The alert message.
- public string Message {
- get; private set;
- }
- }
-}
diff --git a/src/MailKit/Annotation.cs b/src/MailKit/Annotation.cs
deleted file mode 100644
index c62c61d..0000000
--- a/src/MailKit/Annotation.cs
+++ /dev/null
@@ -1,81 +0,0 @@
-//
-// Annotation.cs
-//
-// Author: Jeffrey Stedfast
-//
-// Copyright (c) 2013-2020 .NET Foundation and Contributors
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-using System;
-using System.Collections.Generic;
-
-namespace MailKit {
- ///
- /// An annotation.
- ///
- ///
- /// An annotation.
- /// For more information about annotations, see
- /// rfc5257.
- ///
- public class Annotation
- {
- ///
- /// Initializes a new instance of the class.
- ///
- ///
- /// Creates a new .
- ///
- /// The annotation entry.
- ///
- /// is null.
- ///
- public Annotation (AnnotationEntry entry)
- {
- if (entry == null)
- throw new ArgumentNullException (nameof (entry));
-
- Properties = new Dictionary ();
- Entry = entry;
- }
-
- ///
- /// Get the annotation tag.
- ///
- ///
- /// Gets the annotation tag.
- ///
- /// The annotation tag.
- public AnnotationEntry Entry {
- get; private set;
- }
-
- ///
- /// Get the annotation properties.
- ///
- ///
- /// Gets the annotation properties.
- ///
- public Dictionary Properties {
- get; private set;
- }
- }
-}
diff --git a/src/MailKit/AnnotationAccess.cs b/src/MailKit/AnnotationAccess.cs
deleted file mode 100644
index b4e5f17..0000000
--- a/src/MailKit/AnnotationAccess.cs
+++ /dev/null
@@ -1,53 +0,0 @@
-//
-// AnnotationAccess.cs
-//
-// Author: Jeffrey Stedfast
-//
-// Copyright (c) 2013-2020 .NET Foundation and Contributors
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-namespace MailKit {
- ///
- /// An annotation access level.
- ///
- ///
- /// An annotation access level.
- /// For more information about annotations, see
- /// rfc5257.
- ///
- public enum AnnotationAccess
- {
- ///
- /// Annotations are not supported.
- ///
- None,
-
- ///
- /// Annotations are read-only.
- ///
- ReadOnly,
-
- ///
- /// Annotations are read-write.
- ///
- ReadWrite
- }
-}
diff --git a/src/MailKit/AnnotationAttribute.cs b/src/MailKit/AnnotationAttribute.cs
deleted file mode 100644
index 06a4478..0000000
--- a/src/MailKit/AnnotationAttribute.cs
+++ /dev/null
@@ -1,251 +0,0 @@
-//
-// AnnotationAttribute.cs
-//
-// Author: Jeffrey Stedfast
-//
-// Copyright (c) 2013-2020 .NET Foundation and Contributors
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-using System;
-
-namespace MailKit {
- ///
- /// An annotation attribute.
- ///
- ///
- /// An annotation attribute.
- /// For more information about annotations, see
- /// rfc5257.
- ///
- public class AnnotationAttribute : IEquatable
- {
- static readonly char[] Wildcards = { '*', '%' };
-
- ///
- /// The annotation value.
- ///
- ///
- /// Used to get or set both the private and shared values of an annotation.
- ///
- public static readonly AnnotationAttribute Value = new AnnotationAttribute ("value", AnnotationScope.Both);
-
- ///
- /// The shared annotation value.
- ///
- ///
- /// Used to get or set the shared value of an annotation.
- ///
- public static readonly AnnotationAttribute SharedValue = new AnnotationAttribute ("value", AnnotationScope.Shared);
-
- ///
- /// The private annotation value.
- ///
- ///
- /// Used to get or set the private value of an annotation.
- ///
- public static readonly AnnotationAttribute PrivateValue = new AnnotationAttribute ("value", AnnotationScope.Private);
-
- ///
- /// The size of an annotation value.
- ///
- ///
- /// Used to get the size of the both the private and shared annotation values.
- ///
- public static readonly AnnotationAttribute Size = new AnnotationAttribute ("size", AnnotationScope.Both);
-
- ///
- /// The size of a shared annotation value.
- ///
- ///
- /// Used to get the size of a shared annotation value.
- ///
- public static readonly AnnotationAttribute SharedSize = new AnnotationAttribute ("size", AnnotationScope.Shared);
-
- ///
- /// The size of a private annotation value.
- ///
- ///
- /// Used to get the size of a private annotation value.
- ///
- public static readonly AnnotationAttribute PrivateSize = new AnnotationAttribute ("size", AnnotationScope.Private);
-
- AnnotationAttribute (string name, AnnotationScope scope)
- {
- switch (scope) {
- case AnnotationScope.Shared: Specifier = string.Format ("{0}.shared", name); break;
- case AnnotationScope.Private: Specifier = string.Format ("{0}.priv", name); break;
- default: Specifier = name; break;
- }
- Scope = scope;
- Name = name;
- }
-
- ///
- /// Initializes a new instance of the class.
- ///
- /// The annotation attribute specifier.
- ///
- /// is null.
- ///
- ///
- /// contains illegal characters.
- ///
- public AnnotationAttribute (string specifier)
- {
- if (specifier == null)
- throw new ArgumentNullException (nameof (specifier));
-
- if (specifier.Length == 0)
- throw new ArgumentException ("Annotation attribute specifiers cannot be empty.", nameof (specifier));
-
- // TODO: improve validation
- if (specifier.IndexOfAny (Wildcards) != -1)
- throw new ArgumentException ("Annotation attribute specifiers cannot contain '*' or '%'.", nameof (specifier));
-
- Specifier = specifier;
-
- if (specifier.EndsWith (".shared", StringComparison.Ordinal)) {
- Name = specifier.Substring (0, specifier.Length - ".shared".Length);
- Scope = AnnotationScope.Shared;
- } else if (specifier.EndsWith (".priv", StringComparison.Ordinal)) {
- Name = specifier.Substring (0, specifier.Length - ".priv".Length);
- Scope = AnnotationScope.Private;
- } else {
- Scope = AnnotationScope.Both;
- Name = specifier;
- }
- }
-
- ///
- /// Get the name of the annotation attribute.
- ///
- ///
- /// Gets the name of the annotation attribute.
- ///
- public string Name {
- get; private set;
- }
-
- ///
- /// Get the scope of the annotation attribute.
- ///
- ///
- /// Gets the scope of the annotation attribute.
- ///
- public AnnotationScope Scope {
- get; private set;
- }
-
- ///
- /// Get the annotation attribute specifier.
- ///
- ///
- /// Gets the annotation attribute specifier.
- ///
- public string Specifier {
- get; private set;
- }
-
- #region IEquatable implementation
-
- ///
- /// Determines whether the specified is equal to the current .
- ///
- ///
- /// Determines whether the specified is equal to the current .
- ///
- /// The to compare with the current .
- /// true if the specified is equal to the current
- /// ; otherwise, false.
- public bool Equals (AnnotationAttribute other)
- {
- return other?.Specifier == Specifier;
- }
-
- #endregion
-
- ///
- /// Determines whether two annotation attributes are equal.
- ///
- ///
- /// Determines whether two annotation attributes are equal.
- ///
- /// true if and are equal; otherwise, false.
- /// The first annotation attribute to compare.
- /// The second annotation attribute to compare.
- public static bool operator == (AnnotationAttribute attr1, AnnotationAttribute attr2)
- {
- return attr1?.Specifier == attr2?.Specifier;
- }
-
- ///
- /// Determines whether two annotation attributes are not equal.
- ///
- ///
- /// Determines whether two annotation attributes are not equal.
- ///
- /// true if and are not equal; otherwise, false.
- /// The first annotation attribute to compare.
- /// The second annotation attribute to compare.
- public static bool operator != (AnnotationAttribute attr1, AnnotationAttribute attr2)
- {
- return attr1?.Specifier != attr2?.Specifier;
- }
-
- ///
- /// Determine whether the specified is equal to the current .
- ///
- ///
- /// Determines whether the specified is equal to the current .
- ///
- /// The to compare with the current .
- /// true if the specified is equal to the current
- /// ; otherwise, false.
- public override bool Equals (object obj)
- {
- return obj is AnnotationAttribute && ((AnnotationAttribute) obj).Specifier == Specifier;
- }
-
- ///
- /// Serves as a hash function for a object.
- ///
- ///
- /// Serves as a hash function for a object.
- ///
- /// A hash code for this instance that is suitable for use in hashing algorithms and data structures such as a hash table.
- public override int GetHashCode ()
- {
- return Specifier.GetHashCode ();
- }
-
- ///
- /// Returns a that represents the current .
- ///
- ///
- /// Returns a that represents the current .
- ///
- /// A that represents the current .
- public override string ToString ()
- {
- return Specifier;
- }
- }
-}
diff --git a/src/MailKit/AnnotationEntry.cs b/src/MailKit/AnnotationEntry.cs
deleted file mode 100644
index 8f510e1..0000000
--- a/src/MailKit/AnnotationEntry.cs
+++ /dev/null
@@ -1,521 +0,0 @@
-//
-// Annotationentry.cs
-//
-// Author: Jeffrey Stedfast
-//
-// Copyright (c) 2013-2020 .NET Foundation and Contributors
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-using System;
-
-namespace MailKit {
- ///
- /// An annotation entry.
- ///
- ///
- /// An annotation entry.
- /// For more information about annotations, see
- /// rfc5257.
- ///
- public class AnnotationEntry : IEquatable
- {
- ///
- /// An annotation entry for a comment on a message.
- ///
- ///
- /// Used to get or set a comment on a message.
- ///
- public static readonly AnnotationEntry Comment = new AnnotationEntry ("/comment", AnnotationScope.Both);
-
- ///
- /// An annotation entry for a private comment on a message.
- ///
- ///
- /// Used to get or set a private comment on a message.
- ///
- public static readonly AnnotationEntry PrivateComment = new AnnotationEntry ("/comment", AnnotationScope.Private);
-
- ///
- /// An annotation entry for a shared comment on a message.
- ///
- ///
- /// Used to get or set a shared comment on a message.
- ///
- public static readonly AnnotationEntry SharedComment = new AnnotationEntry ("/comment", AnnotationScope.Shared);
-
- ///
- /// An annotation entry for flags on a message.
- ///
- ///
- /// Used to get or set flags on a message.
- ///
- public static readonly AnnotationEntry Flags = new AnnotationEntry ("/flags", AnnotationScope.Both);
-
- ///
- /// An annotation entry for private flags on a message.
- ///
- ///
- /// Used to get or set private flags on a message.
- ///
- public static readonly AnnotationEntry PrivateFlags = new AnnotationEntry ("/flags", AnnotationScope.Private);
-
- ///
- /// Aa annotation entry for shared flags on a message.
- ///
- ///
- /// Used to get or set shared flags on a message.
- ///
- public static readonly AnnotationEntry SharedFlags = new AnnotationEntry ("/flags", AnnotationScope.Shared);
-
- ///
- /// An annotation entry for an alternate subject on a message.
- ///
- ///
- /// Used to get or set an alternate subject on a message.
- ///
- public static readonly AnnotationEntry AltSubject = new AnnotationEntry ("/altsubject", AnnotationScope.Both);
-
- ///
- /// An annotation entry for a private alternate subject on a message.
- ///
- ///
- /// Used to get or set a private alternate subject on a message.
- ///
- public static readonly AnnotationEntry PrivateAltSubject = new AnnotationEntry ("/altsubject", AnnotationScope.Private);
-
- ///
- /// An annotation entry for a shared alternate subject on a message.
- ///
- ///
- /// Used to get or set a shared alternate subject on a message.
- ///
- public static readonly AnnotationEntry SharedAltSubject = new AnnotationEntry ("/altsubject", AnnotationScope.Shared);
-
- static void ValidatePath (string path)
- {
- if (path == null)
- throw new ArgumentNullException (nameof (path));
-
- if (path.Length == 0)
- throw new ArgumentException ("Annotation entry paths cannot be empty.", nameof (path));
-
- if (path[0] != '/' && path[0] != '*' && path[0] != '%')
- throw new ArgumentException ("Annotation entry paths must begin with '/'.", nameof (path));
-
- if (path.Length > 1 && path[1] >= '0' && path[1] <= '9')
- throw new ArgumentException ("Annotation entry paths must not include a part-specifier.", nameof (path));
-
- if (path == "*" || path == "%")
- return;
-
- char pc = path[0];
-
- for (int i = 1; i < path.Length; i++) {
- char c = path[i];
-
- if (c > 127)
- throw new ArgumentException ($"Invalid character in annotation entry path: '{c}'.", nameof (path));
-
- if (c >= '0' && c <= '9' && pc == '/')
- throw new ArgumentException ("Invalid annotation entry path.", nameof (path));
-
- if ((pc == '/' || pc == '.') && (c == '/' || c == '.'))
- throw new ArgumentException ("Invalid annotation entry path.", nameof (path));
-
- pc = c;
- }
-
- int endIndex = path.Length - 1;
-
- if (path[endIndex] == '/')
- throw new ArgumentException ("Annotation entry paths must not end with '/'.", nameof (path));
-
- if (path[endIndex] == '.')
- throw new ArgumentException ("Annotation entry paths must not end with '.'.", nameof (path));
- }
-
- static void ValidatePartSpecifier (string partSpecifier)
- {
- if (partSpecifier == null)
- throw new ArgumentNullException (nameof (partSpecifier));
-
- char pc = '\0';
-
- for (int i = 0; i < partSpecifier.Length; i++) {
- char c = partSpecifier[i];
-
- if (!((c >= '0' && c <= '9') || c == '.') || (c == '.' && (pc == '.' || pc == '\0')))
- throw new ArgumentException ("Invalid part-specifier.", nameof (partSpecifier));
-
- pc = c;
- }
-
- if (pc == '.')
- throw new ArgumentException ("Invalid part-specifier.", nameof (partSpecifier));
- }
-
- AnnotationEntry ()
- {
- }
-
- ///
- /// Initializes a new instance of the struct.
- ///
- ///
- /// Creates a new .
- ///
- /// The annotation entry path.
- /// The scope of the annotation.
- ///
- /// is null.
- ///
- ///
- /// is invalid.
- ///
- public AnnotationEntry (string path, AnnotationScope scope = AnnotationScope.Both)
- {
- ValidatePath (path);
-
- switch (scope) {
- case AnnotationScope.Private: Entry = path + ".priv"; break;
- case AnnotationScope.Shared: Entry = path + ".shared"; break;
- default: Entry = path; break;
- }
- PartSpecifier = null;
- Path = path;
- Scope = scope;
- }
-
- ///
- /// Initializes a new instance of the struct.
- ///
- ///
- /// Creates a new for an individual body part of a message.
- ///
- /// The part-specifier of the body part of the message.
- /// The annotation entry path.
- /// The scope of the annotation.
- ///
- /// is null.
- /// -or-
- /// is null.
- ///
- ///
- /// is invalid.
- /// -or-
- /// is invalid.
- ///
- public AnnotationEntry (string partSpecifier, string path, AnnotationScope scope = AnnotationScope.Both)
- {
- ValidatePartSpecifier (partSpecifier);
- ValidatePath (path);
-
- switch (scope) {
- case AnnotationScope.Private: Entry = string.Format ("/{0}{1}.priv", partSpecifier, path); break;
- case AnnotationScope.Shared: Entry = string.Format ("/{0}{1}.shared", partSpecifier, path); break;
- default: Entry = string.Format ("/{0}{1}", partSpecifier, path); break;
- }
- PartSpecifier = partSpecifier;
- Path = path;
- Scope = scope;
- }
-
- ///
- /// Initializes a new instance of the struct.
- ///
- ///
- /// Creates a new for an individual body part of a message.
- ///
- /// The body part of the message.
- /// The annotation entry path.
- /// The scope of the annotation.
- ///
- /// is null.
- /// -or-
- /// is null.
- ///
- ///
- /// is invalid.
- ///
- public AnnotationEntry (BodyPart part, string path, AnnotationScope scope = AnnotationScope.Both)
- {
- if (part == null)
- throw new ArgumentNullException (nameof (part));
-
- ValidatePath (path);
-
- switch (scope) {
- case AnnotationScope.Private: Entry = string.Format ("/{0}{1}.priv", part.PartSpecifier, path); break;
- case AnnotationScope.Shared: Entry = string.Format ("/{0}{1}.shared", part.PartSpecifier, path); break;
- default: Entry = string.Format ("/{0}{1}", part.PartSpecifier, path); break;
- }
- PartSpecifier = part.PartSpecifier;
- Path = path;
- Scope = scope;
- }
-
- ///
- /// Get the annotation entry specifier.
- ///
- ///
- /// Gets the annotation entry specifier.
- ///
- /// The annotation entry specifier.
- public string Entry {
- get; private set;
- }
-
- ///
- /// Get the part-specifier component of the annotation entry.
- ///
- ///
- /// Gets the part-specifier component of the annotation entry.
- ///
- public string PartSpecifier {
- get; private set;
- }
-
- ///
- /// Get the path component of the annotation entry.
- ///
- ///
- /// Gets the path component of the annotation entry.
- ///
- public string Path {
- get; private set;
- }
-
- ///
- /// Get the scope of the annotation.
- ///
- ///
- /// Gets the scope of the annotation.
- ///
- public AnnotationScope Scope {
- get; private set;
- }
-
- #region IEquatable implementation
-
- ///
- /// Determines whether the specified is equal to the current .
- ///
- ///
- /// Determines whether the specified is equal to the current .
- ///
- /// The to compare with the current .
- /// true if the specified is equal to the current
- /// ; otherwise, false.
- public bool Equals (AnnotationEntry other)
- {
- return other?.Entry == Entry;
- }
-
- #endregion
-
- ///
- /// Determines whether two annotation entries are equal.
- ///
- ///
- /// Determines whether two annotation entries are equal.
- ///
- /// true if and are equal; otherwise, false.
- /// The first annotation entry to compare.
- /// The second annotation entry to compare.
- public static bool operator == (AnnotationEntry entry1, AnnotationEntry entry2)
- {
- return entry1?.Entry == entry2?.Entry;
- }
-
- ///
- /// Determines whether two annotation entries are not equal.
- ///
- ///
- /// Determines whether two annotation entries are not equal.
- ///
- /// true if and are not equal; otherwise, false.
- /// The first annotation entry to compare.
- /// The second annotation entry to compare.
- public static bool operator != (AnnotationEntry entry1, AnnotationEntry entry2)
- {
- return entry1?.Entry != entry2?.Entry;
- }
-
- ///
- /// Determine whether the specified is equal to the current .
- ///
- ///
- /// Determines whether the specified is equal to the current .
- ///
- /// The to compare with the current .
- /// true if the specified is equal to the current
- /// ; otherwise, false.
- public override bool Equals (object obj)
- {
- return obj is AnnotationEntry && ((AnnotationEntry) obj).Entry == Entry;
- }
-
- ///
- /// Serves as a hash function for a object.
- ///
- ///
- /// Serves as a hash function for a object.
- ///
- /// A hash code for this instance that is suitable for use in hashing algorithms and data structures such as a hash table.
- public override int GetHashCode ()
- {
- return Entry.GetHashCode ();
- }
-
- ///
- /// Returns a that represents the current .
- ///
- ///
- /// Returns a that represents the current .
- ///
- /// A that represents the current .
- public override string ToString ()
- {
- return Entry;
- }
-
- ///
- /// Parse an annotation entry.
- ///
- ///
- /// Parses an annotation entry.
- ///
- /// The annotation entry.
- /// The parsed annotation entry.
- ///
- /// is null.
- ///
- ///
- /// does not conform to the annotation entry syntax.
- ///
- public static AnnotationEntry Parse (string entry)
- {
- if (entry == null)
- throw new ArgumentNullException (nameof (entry));
-
- if (entry.Length == 0)
- throw new FormatException ("An annotation entry cannot be empty.");
-
- if (entry[0] != '/' && entry[0] != '*' && entry[0] != '%')
- throw new FormatException ("An annotation entry must begin with a '/' character.");
-
- var scope = AnnotationScope.Both;
- int startIndex = 0, endIndex;
- string partSpecifier = null;
- var component = 0;
- var pc = entry[0];
- string path;
-
- for (int i = 1; i < entry.Length; i++) {
- char c = entry[i];
-
- if (c >= '0' && c <= '9' && pc == '/') {
- if (component > 0)
- throw new FormatException ("Invalid annotation entry.");
-
- startIndex = i;
- endIndex = i + 1;
- pc = c;
-
- while (endIndex < entry.Length) {
- c = entry[endIndex];
-
- if (c == '/') {
- if (pc == '.')
- throw new FormatException ("Invalid part-specifier in annotation entry.");
-
- break;
- }
-
- if (!(c >= '0' && c <= '9') && c != '.')
- throw new FormatException ($"Invalid character in part-specifier: '{c}'.");
-
- if (c == '.' && pc == '.')
- throw new FormatException ("Invalid part-specifier in annotation entry.");
-
- endIndex++;
- pc = c;
- }
-
- if (endIndex >= entry.Length)
- throw new FormatException ("Incomplete part-specifier in annotation entry.");
-
- partSpecifier = entry.Substring (startIndex, endIndex - startIndex);
- i = startIndex = endIndex;
- component++;
- } else if (c == '/' || c == '.') {
- if (pc == '/' || pc == '.')
- throw new FormatException ("Invalid annotation entry path.");
-
- if (c == '/')
- component++;
- } else if (c > 127) {
- throw new FormatException ($"Invalid character in annotation entry path: '{c}'.");
- }
-
- pc = c;
- }
-
- if (pc == '/' || pc == '.')
- throw new FormatException ("Invalid annotation entry path.");
-
- if (entry.EndsWith (".shared", StringComparison.Ordinal)) {
- endIndex = entry.Length - ".shared".Length;
- scope = AnnotationScope.Shared;
- } else if (entry.EndsWith (".priv", StringComparison.Ordinal)) {
- endIndex = entry.Length - ".priv".Length;
- scope = AnnotationScope.Private;
- } else {
- endIndex = entry.Length;
- }
-
- path = entry.Substring (startIndex, endIndex - startIndex);
-
- return new AnnotationEntry {
- PartSpecifier = partSpecifier,
- Entry = entry,
- Path = path,
- Scope = scope
- };
- }
-
- internal static AnnotationEntry Create (string entry)
- {
- switch (entry) {
- case "/comment": return Comment;
- case "/comment.priv": return PrivateComment;
- case "/comment.shared": return SharedComment;
- case "/flags": return Flags;
- case "/flags.priv": return PrivateFlags;
- case "/flags.shared": return SharedFlags;
- case "/altsubject": return AltSubject;
- case "/altsubject.priv": return PrivateAltSubject;
- case "/altsubject.shared": return SharedAltSubject;
- default: return Parse (entry);
- }
- }
- }
-}
diff --git a/src/MailKit/AnnotationScope.cs b/src/MailKit/AnnotationScope.cs
deleted file mode 100644
index c091a70..0000000
--- a/src/MailKit/AnnotationScope.cs
+++ /dev/null
@@ -1,61 +0,0 @@
-//
-// AnnotationScope.cs
-//
-// Author: Jeffrey Stedfast
-//
-// Copyright (c) 2013-2020 .NET Foundation and Contributors
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-using System;
-
-namespace MailKit {
- ///
- /// The scope of an annotation.
- ///
- ///
- /// Represents the scope of an annotation.
- /// For more information about annotations, see
- /// rfc5257.
- ///
- [Flags]
- public enum AnnotationScope
- {
- ///
- /// No scopes.
- ///
- None,
-
- ///
- /// The private annotation scope.
- ///
- Private,
-
- ///
- /// The shared annotation scope.
- ///
- Shared,
-
- ///
- /// Both private and shared scopes.
- ///
- Both = Private | Shared
- }
-}
diff --git a/src/MailKit/AnnotationsChangedEventArgs.cs b/src/MailKit/AnnotationsChangedEventArgs.cs
deleted file mode 100644
index b3d4015..0000000
--- a/src/MailKit/AnnotationsChangedEventArgs.cs
+++ /dev/null
@@ -1,93 +0,0 @@
-//
-// AnnotationsChangedEventArgs.cs
-//
-// Author: Jeffrey Stedfast
-//
-// Copyright (c) 2013-2020 .NET Foundation and Contributors
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-using System;
-using System.Linq;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-
-namespace MailKit {
- ///
- /// Event args used when an annotation changes.
- ///
- ///
- /// Event args used when an annotation changes.
- ///
- public class AnnotationsChangedEventArgs : MessageEventArgs
- {
- ///
- /// Initializes a new instance of the class.
- ///
- ///
- /// Creates a new .
- ///
- /// The message index.
- internal AnnotationsChangedEventArgs (int index) : base (index)
- {
- }
-
- ///
- /// Initializes a new instance of the class.
- ///
- ///
- /// Creates a new .
- ///
- /// The message index.
- /// The annotations that changed.
- ///
- /// is null.
- ///
- public AnnotationsChangedEventArgs (int index, IEnumerable annotations) : base (index)
- {
- if (annotations == null)
- throw new ArgumentNullException (nameof (annotations));
-
- Annotations = new ReadOnlyCollection (annotations.ToArray ());
- }
-
- ///
- /// Get the annotations that changed.
- ///
- ///
- /// Gets the annotations that changed.
- ///
- /// The annotation.
- public IList Annotations {
- get; internal set;
- }
-
- ///
- /// Gets the updated mod-sequence value of the message, if available.
- ///
- ///
- /// Gets the updated mod-sequence value of the message, if available.
- ///
- /// The mod-sequence value.
- public ulong? ModSeq {
- get; internal set;
- }
- }
-}
diff --git a/src/MailKit/AuthenticatedEventArgs.cs b/src/MailKit/AuthenticatedEventArgs.cs
deleted file mode 100644
index 5f9467a..0000000
--- a/src/MailKit/AuthenticatedEventArgs.cs
+++ /dev/null
@@ -1,68 +0,0 @@
-//
-// AuthenticatedEventArgs.cs
-//
-// Author: Jeffrey Stedfast
-//
-// Copyright (c) 2013-2020 .NET Foundation and Contributors
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-using System;
-
-namespace MailKit {
- ///
- /// Authenticated event arguments.
- ///
- ///
- /// Some servers, such as GMail IMAP, will send some free-form text in
- /// the response to a successful login.
- ///
- public class AuthenticatedEventArgs : EventArgs
- {
- ///
- /// Initializes a new instance of the class.
- ///
- ///
- /// Creates a new .
- ///
- /// The free-form text.
- ///
- /// is null.
- ///
- public AuthenticatedEventArgs (string message)
- {
- if (message == null)
- throw new ArgumentNullException (nameof (message));
-
- Message = message;
- }
-
- ///
- /// Get the free-form text sent by the server.
- ///
- ///
- /// Gets the free-form text sent by the server.
- ///
- /// The free-form text sent by the server.
- public string Message {
- get; private set;
- }
- }
-}
diff --git a/src/MailKit/BodyPart.cs b/src/MailKit/BodyPart.cs
deleted file mode 100644
index 3d3a548..0000000
--- a/src/MailKit/BodyPart.cs
+++ /dev/null
@@ -1,716 +0,0 @@
-//
-// BodyPart.cs
-//
-// Author: Jeffrey Stedfast
-//
-// Copyright (c) 2013-2020 .NET Foundation and Contributors
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-using System;
-using System.Text;
-using System.Collections.Generic;
-
-using MimeKit;
-using MimeKit.Utils;
-
-namespace MailKit {
- ///
- /// An abstract body part of a message.
- ///
- ///
- /// Each body part will actually be a ,
- /// , , or
- /// .
- ///
- ///
- ///
- ///
- public abstract class BodyPart
- {
- ///
- /// Initializes a new instance of the class.
- ///
- ///
- /// Creates a new .
- ///
- protected BodyPart ()
- {
- }
-
- ///
- /// Gets the Content-Type of the body part.
- ///
- ///
- /// Gets the Content-Type of the body part.
- ///
- /// The content type.
- public ContentType ContentType {
- get; set;
- }
-
- ///
- /// Gets the part specifier.
- ///
- ///
- /// Gets the part specifier.
- ///
- ///
- ///
- ///
- /// The part specifier.
- public string PartSpecifier {
- get; set;
- }
-
- ///
- /// Dispatches to the specific visit method for this MIME body part.
- ///
- ///
- /// This default implementation for nodes
- /// calls . Override this
- /// method to call into a more specific method on a derived visitor class
- /// of the class. However, it should still
- /// support unknown visitors by calling
- /// .
- ///
- /// The visitor.
- ///
- /// is null.
- ///
- public abstract void Accept (BodyPartVisitor visitor);
-
- internal static void Encode (StringBuilder builder, uint value)
- {
- builder.Append (value.ToString ());
- }
-
- internal static void Encode (StringBuilder builder, string value)
- {
- if (value != null)
- builder.Append (MimeUtils.Quote (value));
- else
- builder.Append ("NIL");
- }
-
- internal static void Encode (StringBuilder builder, Uri location)
- {
- if (location != null)
- builder.Append (MimeUtils.Quote (location.ToString ()));
- else
- builder.Append ("NIL");
- }
-
- internal static void Encode (StringBuilder builder, string[] values)
- {
- if (values == null || values.Length == 0) {
- builder.Append ("NIL");
- return;
- }
-
- builder.Append ('(');
-
- for (int i = 0; i < values.Length; i++) {
- if (i > 0)
- builder.Append (' ');
-
- Encode (builder, values[i]);
- }
-
- builder.Append (')');
- }
-
- internal static void Encode (StringBuilder builder, IList parameters)
- {
- if (parameters == null || parameters.Count == 0) {
- builder.Append ("NIL");
- return;
- }
-
- builder.Append ('(');
-
- for (int i = 0; i < parameters.Count; i++) {
- if (i > 0)
- builder.Append (' ');
-
- Encode (builder, parameters[i].Name);
- builder.Append (' ');
- Encode (builder, parameters[i].Value);
- }
-
- builder.Append (')');
- }
-
- internal static void Encode (StringBuilder builder, ContentDisposition disposition)
- {
- if (disposition == null) {
- builder.Append ("NIL");
- return;
- }
-
- builder.Append ('(');
- Encode (builder, disposition.Disposition);
- builder.Append (' ');
- Encode (builder, disposition.Parameters);
- builder.Append (')');
- }
-
- internal static void Encode (StringBuilder builder, ContentType contentType)
- {
- Encode (builder, contentType.MediaType);
- builder.Append (' ');
- Encode (builder, contentType.MediaSubtype);
- builder.Append (' ');
- Encode (builder, contentType.Parameters);
- }
-
- internal static void Encode (StringBuilder builder, BodyPartCollection parts)
- {
- if (parts == null || parts.Count == 0) {
- builder.Append ("NIL");
- return;
- }
-
- for (int i = 0; i < parts.Count; i++) {
- if (i > 0)
- builder.Append (' ');
-
- Encode (builder, parts[i]);
- }
- }
-
- internal static void Encode (StringBuilder builder, Envelope envelope)
- {
- if (envelope == null) {
- builder.Append ("NIL");
- return;
- }
-
- envelope.Encode (builder);
- }
-
- internal static void Encode (StringBuilder builder, BodyPart body)
- {
- if (body == null) {
- builder.Append ("NIL");
- return;
- }
-
- builder.Append ('(');
- body.Encode (builder);
- builder.Append (')');
- }
-
- ///
- /// Encodes the into the .
- ///
- ///
- /// Encodes the into the .
- ///
- /// The string builder.
- protected abstract void Encode (StringBuilder builder);
-
- ///
- /// Returns a that represents the current .
- ///
- ///
- /// Returns a that represents the current .
- /// The syntax of the string returned, while similar to IMAP's BODYSTRUCTURE syntax,
- /// is not completely compatible.
- ///
- /// A that represents the current .
- public override string ToString ()
- {
- var builder = new StringBuilder ();
-
- builder.Append ('(');
- Encode (builder);
- builder.Append (')');
-
- return builder.ToString ();
- }
-
- static bool TryParse (string text, ref int index, out uint value)
- {
- while (index < text.Length && text[index] == ' ')
- index++;
-
- int startIndex = index;
-
- value = 0;
-
- while (index < text.Length && char.IsDigit (text[index]))
- value = (value * 10) + (uint) (text[index++] - '0');
-
- return index > startIndex;
- }
-
- static bool TryParse (string text, ref int index, out string nstring)
- {
- nstring = null;
-
- while (index < text.Length && text[index] == ' ')
- index++;
-
- if (index >= text.Length)
- return false;
-
- if (text[index] != '"') {
- if (index + 3 <= text.Length && text.Substring (index, 3) == "NIL") {
- index += 3;
- return true;
- }
-
- return false;
- }
-
- var token = new StringBuilder ();
- bool escaped = false;
-
- index++;
-
- while (index < text.Length) {
- if (text[index] == '"' && !escaped)
- break;
-
- if (escaped || text[index] != '\\') {
- token.Append (text[index]);
- escaped = false;
- } else {
- escaped = true;
- }
-
- index++;
- }
-
- if (index >= text.Length)
- return false;
-
- nstring = token.ToString ();
-
- index++;
-
- return true;
- }
-
- static bool TryParse (string text, ref int index, out string[] values)
- {
- values = null;
-
- while (index < text.Length && text[index] == ' ')
- index++;
-
- if (index >= text.Length)
- return false;
-
- if (text[index] != '(') {
- if (index + 3 <= text.Length && text.Substring (index, 3) == "NIL") {
- index += 3;
- return true;
- }
-
- return false;
- }
-
- index++;
-
- if (index >= text.Length)
- return false;
-
- var list = new List ();
- string value;
-
- do {
- if (text[index] == ')')
- break;
-
- if (!TryParse (text, ref index, out value))
- return false;
-
- list.Add (value);
- } while (index < text.Length);
-
- if (index >= text.Length || text[index] != ')')
- return false;
-
- values = list.ToArray ();
- index++;
-
- return true;
- }
-
- static bool TryParse (string text, ref int index, out Uri uri)
- {
- string nstring;
-
- uri = null;
-
- if (!TryParse (text, ref index, out nstring))
- return false;
-
- if (!string.IsNullOrEmpty (nstring)) {
- if (Uri.IsWellFormedUriString (nstring, UriKind.Absolute))
- uri = new Uri (nstring, UriKind.Absolute);
- else if (Uri.IsWellFormedUriString (nstring, UriKind.Relative))
- uri = new Uri (nstring, UriKind.Relative);
- }
-
- return true;
- }
-
- static bool TryParse (string text, ref int index, out IList parameters)
- {
- string name, value;
-
- parameters = null;
-
- while (index < text.Length && text[index] == ' ')
- index++;
-
- if (index >= text.Length)
- return false;
-
- if (text[index] != '(') {
- if (index + 3 <= text.Length && text.Substring (index, 3) == "NIL") {
- parameters = new List ();
- index += 3;
- return true;
- }
-
- return false;
- }
-
- index++;
-
- if (index >= text.Length)
- return false;
-
- parameters = new List ();
-
- do {
- if (text[index] == ')')
- break;
-
- if (!TryParse (text, ref index, out name))
- return false;
-
- if (!TryParse (text, ref index, out value))
- return false;
-
- parameters.Add (new Parameter (name, value));
- } while (index < text.Length);
-
- if (index >= text.Length || text[index] != ')')
- return false;
-
- index++;
-
- return true;
- }
-
- static bool TryParse (string text, ref int index, out ContentDisposition disposition)
- {
- IList parameters;
- string value;
-
- disposition = null;
-
- while (index < text.Length && text[index] == ' ')
- index++;
-
- if (index >= text.Length)
- return false;
-
- if (text[index] != '(') {
- if (index + 3 <= text.Length && text.Substring (index, 3) == "NIL") {
- index += 3;
- return true;
- }
-
- return false;
- }
-
- index++;
-
- if (!TryParse (text, ref index, out value))
- return false;
-
- if (!TryParse (text, ref index, out parameters))
- return false;
-
- if (index >= text.Length || text[index] != ')')
- return false;
-
- index++;
-
- disposition = new ContentDisposition (value);
-
- foreach (var param in parameters)
- disposition.Parameters.Add (param);
-
- return true;
- }
-
- static bool TryParse (string text, ref int index, bool multipart, out ContentType contentType)
- {
- IList parameters;
- string type, subtype;
-
- contentType = null;
-
- while (index < text.Length && text[index] == ' ')
- index++;
-
- if (index >= text.Length)
- return false;
-
- if (!multipart) {
- if (!TryParse (text, ref index, out type))
- return false;
- } else {
- type = "multipart";
- }
-
- if (!TryParse (text, ref index, out subtype))
- return false;
-
- if (!TryParse (text, ref index, out parameters))
- return false;
-
- contentType = new ContentType (type ?? "application", subtype ?? "octet-stream");
-
- foreach (var param in parameters)
- contentType.Parameters.Add (param);
-
- return true;
- }
-
- static bool TryParse (string text, ref int index, string prefix, out IList children)
- {
- BodyPart part;
- string path;
- int id = 1;
-
- children = null;
-
- if (index >= text.Length)
- return false;
-
- children = new List ();
-
- do {
- if (text[index] != '(')
- break;
-
- path = prefix + id;
-
- if (!TryParse (text, ref index, path, out part))
- return false;
-
- while (index < text.Length && text[index] == ' ')
- index++;
-
- children.Add (part);
- id++;
- } while (index < text.Length);
-
- return index < text.Length;
- }
-
- static bool TryParse (string text, ref int index, string path, out BodyPart part)
- {
- ContentDisposition disposition;
- ContentType contentType;
- string[] array;
- string nstring;
- Uri location;
- uint number;
-
- part = null;
-
- while (index < text.Length && text[index] == ' ')
- index++;
-
- if (index >= text.Length || text[index] != '(') {
- if (index + 3 <= text.Length && text.Substring (index, 3) == "NIL") {
- index += 3;
- return true;
- }
-
- return false;
- }
-
- index++;
-
- if (index >= text.Length)
- return false;
-
- if (text[index] == '(') {
- var prefix = path.Length > 0 ? path + "." : string.Empty;
- var multipart = new BodyPartMultipart ();
- IList children;
-
- if (!TryParse (text, ref index, prefix, out children))
- return false;
-
- foreach (var child in children)
- multipart.BodyParts.Add (child);
-
- if (!TryParse (text, ref index, true, out contentType))
- return false;
-
- multipart.ContentType = contentType;
-
- if (!TryParse (text, ref index, out disposition))
- return false;
-
- multipart.ContentDisposition = disposition;
-
- if (!TryParse (text, ref index, out array))
- return false;
-
- multipart.ContentLanguage = array;
-
- if (!TryParse (text, ref index, out location))
- return false;
-
- multipart.ContentLocation = location;
-
- part = multipart;
- } else {
- BodyPartMessage message = null;
- BodyPartText txt = null;
- BodyPartBasic basic;
-
- if (!TryParse (text, ref index, false, out contentType))
- return false;
-
- if (contentType.IsMimeType ("message", "rfc822"))
- basic = message = new BodyPartMessage ();
- else if (contentType.IsMimeType ("text", "*"))
- basic = txt = new BodyPartText ();
- else
- basic = new BodyPartBasic ();
-
- basic.ContentType = contentType;
-
- if (!TryParse (text, ref index, out nstring))
- return false;
-
- basic.ContentId = nstring;
-
- if (!TryParse (text, ref index, out nstring))
- return false;
-
- basic.ContentDescription = nstring;
-
- if (!TryParse (text, ref index, out nstring))
- return false;
-
- basic.ContentTransferEncoding = nstring;
-
- if (!TryParse (text, ref index, out number))
- return false;
-
- basic.Octets = number;
-
- if (!TryParse (text, ref index, out nstring))
- return false;
-
- basic.ContentMd5 = nstring;
-
- if (!TryParse (text, ref index, out disposition))
- return false;
-
- basic.ContentDisposition = disposition;
-
- if (!TryParse (text, ref index, out array))
- return false;
-
- basic.ContentLanguage = array;
-
- if (!TryParse (text, ref index, out location))
- return false;
-
- basic.ContentLocation = location;
-
- if (message != null) {
- Envelope envelope;
- BodyPart body;
-
- if (!Envelope.TryParse (text, ref index, out envelope))
- return false;
-
- message.Envelope = envelope;
-
- if (!TryParse (text, ref index, path, out body))
- return false;
-
- message.Body = body;
-
- if (!TryParse (text, ref index, out number))
- return false;
-
- message.Lines = number;
- } else if (txt != null) {
- if (!TryParse (text, ref index, out number))
- return false;
-
- txt.Lines = number;
- }
-
- part = basic;
- }
-
- part.PartSpecifier = path;
-
- if (index >= text.Length || text[index] != ')')
- return false;
-
- index++;
-
- return true;
- }
-
- ///
- /// Tries to parse the given text into a new instance.
- ///
- ///
- /// Parses a body part from the specified text.
- /// This syntax, while similar to IMAP's BODYSTRUCTURE syntax, is not completely
- /// compatible.
- ///
- /// true, if the body part was successfully parsed, false otherwise.
- /// The text to parse.
- /// The parsed body part.
- ///
- /// is null.
- ///
- public static bool TryParse (string text, out BodyPart part)
- {
- if (text == null)
- throw new ArgumentNullException (nameof (text));
-
- int index = 0;
-
- return TryParse (text, ref index, string.Empty, out part) && index == text.Length;
- }
- }
-}
diff --git a/src/MailKit/BodyPartBasic.cs b/src/MailKit/BodyPartBasic.cs
deleted file mode 100644
index 17ffdf6..0000000
--- a/src/MailKit/BodyPartBasic.cs
+++ /dev/null
@@ -1,245 +0,0 @@
-//
-// BodyPartBasic.cs
-//
-// Author: Jeffrey Stedfast
-//
-// Copyright (c) 2013-2020 .NET Foundation and Contributors
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-using System;
-using System.Text;
-
-using MimeKit;
-
-namespace MailKit {
- ///
- /// A basic message body part.
- ///
- ///
- /// Represents any message body part that is not a multipart,
- /// message/rfc822 part, or a text part.
- ///
- ///
- ///
- ///
- public class BodyPartBasic : BodyPart
- {
- ///
- /// Initializes a new instance of the class.
- ///
- ///
- /// Creates a new .
- ///
- public BodyPartBasic ()
- {
- }
-
- ///
- /// Gets the Content-Id of the body part, if available.
- ///
- ///
- /// Gets the Content-Id of the body part, if available.
- ///
- /// The content identifier.
- public string ContentId {
- get; set;
- }
-
- ///
- /// Gets the Content-Description of the body part, if available.
- ///
- ///
- /// Gets the Content-Description of the body part, if available.
- ///
- /// The content description.
- public string ContentDescription {
- get; set;
- }
-
- ///
- /// Gets the Content-Transfer-Encoding of the body part.
- ///
- ///
- /// Gets the Content-Transfer-Encoding of the body part.
- /// Hint: Use the MimeUtils.TryParse
- /// method to parse this value into a usable .
- ///
- /// The content transfer encoding.
- public string ContentTransferEncoding {
- get; set;
- }
-
- ///
- /// Gets the size of the body part, in bytes.
- ///
- ///
- /// Gets the size of the body part, in bytes.
- ///
- /// The number of octets.
- public uint Octets {
- get; set;
- }
-
- ///
- /// Gets the MD5 hash of the content, if available.
- ///
- ///
- /// Gets the MD5 hash of the content, if available.
- ///
- /// The content md5.
- public string ContentMd5 {
- get; set;
- }
-
- ///
- /// Gets the Content-Disposition of the body part, if available.
- ///
- ///
- /// Gets the Content-Disposition of the body part, if available.
- /// The Content-Disposition value is only retrieved if the
- /// flag is used when fetching
- /// summary information from an .
- ///
- /// The content disposition.
- public ContentDisposition ContentDisposition {
- get; set;
- }
-
- ///
- /// Gets the Content-Language of the body part, if available.
- ///
- ///
- /// Gets the Content-Language of the body part, if available.
- /// The Content-Language value is only retrieved if the
- /// flag is used when fetching
- /// summary information from an .
- ///
- /// The content language.
- public string[] ContentLanguage {
- get; set;
- }
-
- ///
- /// Gets the Content-Location of the body part, if available.
- ///
- ///
- /// Gets the Content-Location of the body part, if available.
- /// The Content-Location value is only retrieved if the
- /// flag is used when fetching
- /// summary information from an .
- ///
- /// The content location.
- public Uri ContentLocation {
- get; set;
- }
-
- ///
- /// Determines whether or not the body part is an attachment.
- ///
- ///
- /// Determines whether or not the body part is an attachment based on the value of
- /// the Content-Disposition.
- /// Since the value of the Content-Disposition header is needed, it
- /// is necessary to include the flag when
- /// fetching summary information from an .
- ///
- /// true if this part is an attachment; otherwise, false.
- public bool IsAttachment {
- get { return ContentDisposition != null && ContentDisposition.IsAttachment; }
- }
-
- ///
- /// Get the name of the file.
- ///
- ///
- /// First checks for the "filename" parameter on the Content-Disposition header. If
- /// that does not exist, then the "name" parameter on the Content-Type header is used.
- /// Since the value of the Content-Disposition header is needed, it is
- /// necessary to include the flag when
- /// fetching summary information from an .
- ///
- /// The name of the file.
- public string FileName {
- get {
- string filename = null;
-
- if (ContentDisposition != null)
- filename = ContentDisposition.FileName;
-
- if (filename == null)
- filename = ContentType.Name;
-
- return filename != null ? filename.Trim () : null;
- }
- }
-
- ///
- /// Dispatches to the specific visit method for this MIME body part.
- ///
- ///
- /// This default implementation for nodes
- /// calls . Override this
- /// method to call into a more specific method on a derived visitor class
- /// of the class. However, it should still
- /// support unknown visitors by calling
- /// .
- ///
- /// The visitor.
- ///
- /// is null.
- ///
- public override void Accept (BodyPartVisitor visitor)
- {
- if (visitor == null)
- throw new ArgumentNullException (nameof (visitor));
-
- visitor.VisitBodyPartBasic (this);
- }
-
- ///
- /// Encodes the into the .
- ///
- ///
- /// Encodes the into the .
- ///
- /// The string builder.
- protected override void Encode (StringBuilder builder)
- {
- Encode (builder, ContentType);
- builder.Append (' ');
- Encode (builder, ContentId);
- builder.Append (' ');
- Encode (builder, ContentDescription);
- builder.Append (' ');
- Encode (builder, ContentTransferEncoding);
- builder.Append (' ');
- Encode (builder, Octets);
- builder.Append (' ');
- Encode (builder, ContentMd5);
- builder.Append (' ');
- Encode (builder, ContentDisposition);
- builder.Append (' ');
- Encode (builder, ContentLanguage);
- builder.Append (' ');
- Encode (builder, ContentLocation);
- }
- }
-}
diff --git a/src/MailKit/BodyPartCollection.cs b/src/MailKit/BodyPartCollection.cs
deleted file mode 100644
index bbd78bb..0000000
--- a/src/MailKit/BodyPartCollection.cs
+++ /dev/null
@@ -1,276 +0,0 @@
-//
-// BodyPartCollection.cs
-//
-// Author: Jeffrey Stedfast
-//
-// Copyright (c) 2013-2020 .NET Foundation and Contributors
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-using System;
-using System.Linq;
-using System.Collections;
-using System.Collections.Generic;
-
-using MimeKit.Utils;
-
-namespace MailKit {
- ///
- /// A collection.
- ///
- ///
- /// A collection.
- ///
- public class BodyPartCollection : ICollection
- {
- readonly List collection = new List ();
-
- ///
- /// Initializes a new instance of the class.
- ///
- ///
- /// Creates a new .
- ///
- public BodyPartCollection ()
- {
- }
-
- ///
- /// Get the number of body parts in the collection.
- ///
- ///
- /// Gets the number of body parts in the collection.
- ///
- /// The count.
- public int Count {
- get { return collection.Count; }
- }
-
- ///
- /// Get whether or not this body part collection is read only.
- ///
- ///
- /// Gets whether or not this body part collection is read only.
- ///
- /// true if this collection is read only; otherwise, false.
- public bool IsReadOnly {
- get { return false; }
- }
-
- ///
- /// Add the specified body part to the collection.
- ///
- ///
- /// Adds the specified body part to the collection.
- ///
- /// The body part.
- ///
- /// is null.
- ///
- public void Add (BodyPart part)
- {
- if (part == null)
- throw new ArgumentNullException (nameof (part));
-
- collection.Add (part);
- }
-
- ///
- /// Clears the body part collection.
- ///
- ///
- /// Removes all of the body parts from the collection.
- ///
- public void Clear ()
- {
- collection.Clear ();
- }
-
- ///
- /// Checks if the collection contains the specified body part.
- ///
- ///
- /// Determines whether or not the collection contains the specified body part.
- ///
- /// true if the specified body part exists; otherwise false.
- /// The body part.
- ///
- /// is null.
- ///
- public bool Contains (BodyPart part)
- {
- if (part == null)
- throw new ArgumentNullException (nameof (part));
-
- return collection.Contains (part);
- }
-
- ///
- /// Copies all of the body parts in the collection to the specified array.
- ///
- ///
- /// Copies all of the body parts within the collection into the array,
- /// starting at the specified array index.
- ///
- /// The array.
- /// The array index.
- ///
- /// is null.
- ///
- ///
- /// is out of range.
- ///
- public void CopyTo (BodyPart[] array, int arrayIndex)
- {
- if (array == null)
- throw new ArgumentNullException (nameof (array));
-
- if (arrayIndex < 0 || arrayIndex + Count > array.Length)
- throw new ArgumentOutOfRangeException (nameof (arrayIndex));
-
- collection.CopyTo (array, arrayIndex);
- }
-
- ///
- /// Removes the specified body part.
- ///
- ///
- /// Removes the specified body part.
- ///
- /// true if the body part was removed; otherwise false.
- /// The body part.
- ///
- /// is null.
- ///
- public bool Remove (BodyPart part)
- {
- if (part == null)
- throw new ArgumentNullException (nameof (part));
-
- return collection.Remove (part);
- }
-
- ///
- /// Get the body part at the specified index.
- ///
- ///
- /// Gets the body part at the specified index.
- ///
- /// The body part at the specified index.
- /// The index.
- ///
- /// is out of range.
- ///
- public BodyPart this [int index] {
- get {
- if (index < 0 || index >= collection.Count)
- throw new ArgumentOutOfRangeException (nameof (index));
-
- return collection[index];
- }
- }
-
- ///
- /// Gets the index of the body part matching the specified URI.
- ///
- ///
- /// Finds the index of the body part matching the specified URI, if it exists.
- /// If the URI scheme is "cid", then matching is performed based on the Content-Id header
- /// values, otherwise the Content-Location headers are used. If the provided URI is absolute and a child
- /// part's Content-Location is relative, then then the child part's Content-Location URI will be combined
- /// with the value of its Content-Base header, if available, otherwise it will be combined with the
- /// multipart/related part's Content-Base header in order to produce an absolute URI that can be
- /// compared with the provided absolute URI.
- ///
- /// The index of the part matching the specified URI if found; otherwise -1.
- /// The URI of the body part.
- ///
- /// is null.
- ///
- public int IndexOf (Uri uri)
- {
- if (uri == null)
- throw new ArgumentNullException (nameof (uri));
-
- bool cid = uri.IsAbsoluteUri && uri.Scheme.ToLowerInvariant () == "cid";
-
- for (int index = 0; index < Count; index++) {
- var bodyPart = this[index] as BodyPartBasic;
-
- if (bodyPart == null)
- continue;
-
- if (uri.IsAbsoluteUri) {
- if (cid) {
- if (!string.IsNullOrEmpty (bodyPart.ContentId)) {
- // Note: we might have a Content-Id in the form "", so attempt to decode it
- var id = MimeUtils.EnumerateReferences (bodyPart.ContentId).FirstOrDefault () ?? bodyPart.ContentId;
-
- if (id == uri.AbsolutePath)
- return index;
- }
- } else if (bodyPart.ContentLocation != null) {
- if (!bodyPart.ContentLocation.IsAbsoluteUri)
- continue;
-
- if (bodyPart.ContentLocation == uri)
- return index;
- }
- } else if (bodyPart.ContentLocation == uri) {
- return index;
- }
- }
-
- return -1;
- }
-
- #region IEnumerable implementation
-
- ///
- /// Get the body part enumerator.
- ///
- ///
- /// Gets the body part enumerator.
- ///
- /// The enumerator.
- public IEnumerator GetEnumerator ()
- {
- return collection.GetEnumerator ();
- }
-
- #endregion
-
- #region IEnumerable implementation
-
- ///
- /// Get the body part enumerator.
- ///
- ///
- /// Gets the body part enumerator.
- ///
- /// The enumerator.
- IEnumerator IEnumerable.GetEnumerator ()
- {
- return GetEnumerator ();
- }
-
- #endregion
- }
-}
diff --git a/src/MailKit/BodyPartMessage.cs b/src/MailKit/BodyPartMessage.cs
deleted file mode 100644
index 51985ba..0000000
--- a/src/MailKit/BodyPartMessage.cs
+++ /dev/null
@@ -1,124 +0,0 @@
-//
-// BodyPartMessage.cs
-//
-// Author: Jeffrey Stedfast
-//
-// Copyright (c) 2013-2020 .NET Foundation and Contributors
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-using System;
-using System.Text;
-
-namespace MailKit {
- ///
- /// A message/rfc822 body part.
- ///
- ///
- /// Represents a message/rfc822 body part.
- ///
- public class BodyPartMessage : BodyPartBasic
- {
- ///
- /// Initializes a new instance of the class.
- ///
- ///
- /// Creates a new .
- ///
- public BodyPartMessage ()
- {
- }
-
- ///
- /// Gets the envelope of the message, if available.
- ///
- ///
- /// Gets the envelope of the message, if available.
- ///
- /// The envelope.
- public Envelope Envelope {
- get; set;
- }
-
- ///
- /// Gets the body structure of the message.
- ///
- ///
- /// Gets the body structure of the message.
- ///
- /// The body structure.
- public BodyPart Body {
- get; set;
- }
-
- ///
- /// Gets the length of the message, in lines.
- ///
- ///
- /// Gets the length of the message, in lines.
- ///
- /// The number of lines.
- public uint Lines {
- get; set;
- }
-
- ///
- /// Dispatches to the specific visit method for this MIME body part.
- ///
- ///
- /// This default implementation for nodes
- /// calls . Override this
- /// method to call into a more specific method on a derived visitor class
- /// of the class. However, it should still
- /// support unknown visitors by calling
- /// .
- ///
- /// The visitor.
- ///
- /// is null.
- ///
- public override void Accept (BodyPartVisitor visitor)
- {
- if (visitor == null)
- throw new ArgumentNullException (nameof (visitor));
-
- visitor.VisitBodyPartMessage (this);
- }
-
- ///
- /// Encodes the into the .
- ///
- ///
- /// Encodes the into the .
- ///
- /// The string builder.
- protected override void Encode (StringBuilder builder)
- {
- base.Encode (builder);
-
- builder.Append (' ');
- Encode (builder, Envelope);
- builder.Append (' ');
- Encode (builder, Body);
- builder.Append (' ');
- Encode (builder, Lines);
- }
- }
-}
diff --git a/src/MailKit/BodyPartMultipart.cs b/src/MailKit/BodyPartMultipart.cs
deleted file mode 100644
index bcdc204..0000000
--- a/src/MailKit/BodyPartMultipart.cs
+++ /dev/null
@@ -1,141 +0,0 @@
-//
-// BodyPartMultipart.cs
-//
-// Author: Jeffrey Stedfast
-//
-// Copyright (c) 2013-2020 .NET Foundation and Contributors
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-using System;
-using System.Text;
-
-using MimeKit;
-
-namespace MailKit {
- ///
- /// A multipart body part.
- ///
- ///
- /// A multipart body part.
- ///
- public class BodyPartMultipart : BodyPart
- {
- ///
- /// Initializes a new instance of the class.
- ///
- ///
- /// Creates a new .
- ///
- public BodyPartMultipart ()
- {
- BodyParts = new BodyPartCollection ();
- }
-
- ///
- /// Gets the child body parts.
- ///
- ///
- /// Gets the child body parts.
- ///
- /// The child body parts.
- public BodyPartCollection BodyParts {
- get; private set;
- }
-
- ///
- /// Gets the Content-Disposition of the body part, if available.
- ///
- ///
- /// Gets the Content-Disposition of the body part, if available.
- ///
- /// The content disposition.
- public ContentDisposition ContentDisposition {
- get; set;
- }
-
- ///
- /// Gets the Content-Language of the body part, if available.
- ///
- ///
- /// Gets the Content-Language of the body part, if available.
- ///
- /// The content language.
- public string[] ContentLanguage {
- get; set;
- }
-
- ///
- /// Gets the Content-Location of the body part, if available.
- ///
- ///
- /// Gets the Content-Location of the body part, if available.
- ///
- /// The content location.
- public Uri ContentLocation {
- get; set;
- }
-
- ///
- /// Dispatches to the specific visit method for this MIME body part.
- ///
- ///
- /// This default implementation for nodes
- /// calls . Override this
- /// method to call into a more specific method on a derived visitor class
- /// of the class. However, it should still
- /// support unknown visitors by calling
- /// .
- ///
- /// The visitor.
- ///
- /// is null.
- ///
- public override void Accept (BodyPartVisitor visitor)
- {
- if (visitor == null)
- throw new ArgumentNullException (nameof (visitor));
-
- visitor.VisitBodyPartMultipart (this);
- }
-
- ///
- /// Encodes the into the .
- ///
- ///
- /// Encodes the into the .
- ///
- /// The string builder.
- protected override void Encode (StringBuilder builder)
- {
- Encode (builder, BodyParts);
- builder.Append (' ');
- Encode (builder, ContentType.MediaSubtype);
- builder.Append (' ');
- Encode (builder, ContentType.Parameters);
- builder.Append (' ');
- Encode (builder, ContentDisposition);
- builder.Append (' ');
- Encode (builder, ContentLanguage);
- builder.Append (' ');
- Encode (builder, ContentLocation);
- }
- }
-}
diff --git a/src/MailKit/BodyPartText.cs b/src/MailKit/BodyPartText.cs
deleted file mode 100644
index 8cc9d90..0000000
--- a/src/MailKit/BodyPartText.cs
+++ /dev/null
@@ -1,123 +0,0 @@
-//
-// BodyPartText.cs
-//
-// Author: Jeffrey Stedfast
-//
-// Copyright (c) 2013-2020 .NET Foundation and Contributors
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-using System;
-using System.Text;
-
-namespace MailKit {
- ///
- /// A textual body part.
- ///
- ///
- /// Represents any body part with a media type of "text".
- ///
- ///
- ///
- ///
- public class BodyPartText : BodyPartBasic
- {
- ///
- /// Initializes a new instance of the class.
- ///
- ///
- /// Creates a new .
- ///
- public BodyPartText ()
- {
- }
-
- ///
- /// Gets whether or not this text part contains plain text.
- ///
- ///
- /// Checks whether or not the text part's Content-Type is text/plain.
- ///
- /// true if the text is html; otherwise, false.
- public bool IsPlain {
- get { return ContentType.IsMimeType ("text", "plain"); }
- }
-
- ///
- /// Gets whether or not this text part contains HTML.
- ///
- ///
- /// Checks whether or not the text part's Content-Type is text/html.
- ///
- /// true if the text is html; otherwise, false.
- public bool IsHtml {
- get { return ContentType.IsMimeType ("text", "html"); }
- }
-
- ///
- /// Gets the length of the text, in lines.
- ///
- ///
- /// Gets the length of the text, in lines.
- ///
- /// The number of lines.
- public uint Lines {
- get; set;
- }
-
- ///
- /// Dispatches to the specific visit method for this MIME body part.
- ///
- ///
- /// This default implementation for nodes
- /// calls . Override this
- /// method to call into a more specific method on a derived visitor class
- /// of the class. However, it should still
- /// support unknown visitors by calling
- /// .
- ///
- /// The visitor.
- ///
- /// is null.
- ///
- public override void Accept (BodyPartVisitor visitor)
- {
- if (visitor == null)
- throw new ArgumentNullException (nameof (visitor));
-
- visitor.VisitBodyPartText (this);
- }
-
- ///
- /// Encodes the into the .
- ///
- ///
- /// Encodes the into the .
- ///
- /// The string builder.
- protected override void Encode (StringBuilder builder)
- {
- base.Encode (builder);
-
- builder.Append (' ');
- Encode (builder, Lines);
- }
- }
-}
diff --git a/src/MailKit/BodyPartVisitor.cs b/src/MailKit/BodyPartVisitor.cs
deleted file mode 100644
index 8c06173..0000000
--- a/src/MailKit/BodyPartVisitor.cs
+++ /dev/null
@@ -1,137 +0,0 @@
-//
-// BodyPartVisitor.cs
-//
-// Author: Jeffrey Stedfast
-//
-// Copyright (c) 2013-2020 .NET Foundation and Contributors
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-namespace MailKit {
- ///
- /// Represents a visitor for a tree of MIME body parts.
- ///
- ///
- /// This class is designed to be inherited to create more specialized classes whose
- /// functionality requires traversing, examining or copying a tree of MIME body parts.
- ///
- public abstract class BodyPartVisitor
- {
- ///
- /// Dispatches the entity to one of the more specialized visit methods in this class.
- ///
- ///
- /// Dispatches the entity to one of the more specialized visit methods in this class.
- ///
- /// The MIME body part.
- public virtual void Visit (BodyPart body)
- {
- if (body != null)
- body.Accept (this);
- }
-
- ///
- /// Visit the abstract MIME body part.
- ///
- ///
- /// Visits the abstract MIME body part.
- ///
- /// The MIME body part.
- protected internal virtual void VisitBodyPart (BodyPart entity)
- {
- }
-
- ///
- /// Visit the basic MIME body part.
- ///
- ///
- /// Visits the basic MIME body part.
- ///
- /// The basic MIME body part.
- protected internal virtual void VisitBodyPartBasic (BodyPartBasic entity)
- {
- VisitBodyPart (entity);
- }
-
- ///
- /// Visit the message contained within a message/rfc822 or message/news MIME entity.
- ///
- ///
- /// Visits the message contained within a message/rfc822 or message/news MIME entity.
- ///
- /// The body part representing the message/rfc822 message.
- protected virtual void VisitMessage (BodyPart message)
- {
- if (message != null)
- message.Accept (this);
- }
-
- ///
- /// Visit the message/rfc822 or message/news MIME entity.
- ///
- ///
- /// Visits the message/rfc822 or message/news MIME entity.
- ///
- /// The message/rfc822 or message/news body part.
- protected internal virtual void VisitBodyPartMessage (BodyPartMessage entity)
- {
- VisitBodyPartBasic (entity);
- VisitMessage (entity.Body);
- }
-
- ///
- /// Visit the children of a .
- ///
- ///
- /// Visits the children of a .
- ///
- /// The multipart.
- protected virtual void VisitChildren (BodyPartMultipart multipart)
- {
- for (int i = 0; i < multipart.BodyParts.Count; i++)
- multipart.BodyParts[i].Accept (this);
- }
-
- ///
- /// Visit the abstract multipart MIME entity.
- ///
- ///
- /// Visits the abstract multipart MIME entity.
- ///
- /// The multipart body part.
- protected internal virtual void VisitBodyPartMultipart (BodyPartMultipart multipart)
- {
- VisitBodyPart (multipart);
- VisitChildren (multipart);
- }
-
- ///
- /// Visit the text-based MIME part entity.
- ///
- ///
- /// Visits the text-based MIME part entity.
- ///
- /// The text-based body part.
- protected internal virtual void VisitBodyPartText (BodyPartText entity)
- {
- VisitBodyPartBasic (entity);
- }
- }
-}
diff --git a/src/MailKit/CommandException.cs b/src/MailKit/CommandException.cs
deleted file mode 100644
index b47bbfe..0000000
--- a/src/MailKit/CommandException.cs
+++ /dev/null
@@ -1,102 +0,0 @@
-//
-// CommandException.cs
-//
-// Author: Jeffrey Stedfast
-//
-// Copyright (c) 2013-2020 .NET Foundation and Contributors
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-using System;
-#if SERIALIZABLE
-using System.Security;
-using System.Runtime.Serialization;
-#endif
-
-namespace MailKit {
- ///
- /// The exception that is thrown when there is a command error.
- ///
- ///
- /// A can be thrown by any of the various client
- /// methods in MailKit. Unlike a , a
- /// is typically non-fatal (meaning that it does
- /// not force the client to disconnect).
- ///
-#if SERIALIZABLE
- [Serializable]
-#endif
- public abstract class CommandException : Exception
- {
-#if SERIALIZABLE
- ///
- /// Initializes a new instance of the class.
- ///
- ///
- /// Creates a new .
- ///
- /// The serialization info.
- /// The streaming context.
- ///
- /// is null.
- ///
- [SecuritySafeCritical]
- protected CommandException (SerializationInfo info, StreamingContext context) : base (info, context)
- {
- }
-#endif
-
- ///
- /// Initializes a new instance of the class.
- ///
- ///
- /// Creates a new .
- ///
- /// The error message.
- /// An inner exception.
- protected CommandException (string message, Exception innerException) : base (message, innerException)
- {
- HelpLink = "https://github.com/jstedfast/MailKit/blob/master/FAQ.md#ProtocolLog";
- }
-
- ///
- /// Initializes a new instance of the class.
- ///
- ///
- /// Creates a new .
- ///
- /// The error message.
- protected CommandException (string message) : base (message)
- {
- HelpLink = "https://github.com/jstedfast/MailKit/blob/master/FAQ.md#ProtocolLog";
- }
-
- ///
- /// Initializes a new instance of the class.
- ///
- ///
- /// Creates a new .
- ///
- protected CommandException ()
- {
- HelpLink = "https://github.com/jstedfast/MailKit/blob/master/FAQ.md#ProtocolLog";
- }
- }
-}
diff --git a/src/MailKit/CompressedStream.cs b/src/MailKit/CompressedStream.cs
deleted file mode 100644
index 1de9858..0000000
--- a/src/MailKit/CompressedStream.cs
+++ /dev/null
@@ -1,435 +0,0 @@
-//
-// CompressedStream.cs
-//
-// Author: Jeffrey Stedfast
-//
-// Copyright (c) 2013-2020 .NET Foundation and Contributors
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-using System;
-using System.IO;
-using System.Threading;
-using System.Threading.Tasks;
-
-using Org.BouncyCastle.Utilities.Zlib;
-
-namespace MailKit {
- ///
- /// A compressed stream.
- ///
- class CompressedStream : Stream
- {
- readonly ZStream zIn, zOut;
- bool eos, disposed;
-
- public CompressedStream (Stream innerStream)
- {
- InnerStream = innerStream;
-
- zOut = new ZStream ();
- zOut.deflateInit (5, true);
- zOut.next_out = new byte[4096];
-
- zIn = new ZStream ();
- zIn.inflateInit (true);
- zIn.next_in = new byte[4096];
- }
-
- ///
- /// Gets the inner stream.
- ///
- /// The inner stream.
- public Stream InnerStream {
- get; private set;
- }
-
- ///
- /// Gets whether the stream supports reading.
- ///
- /// true if the stream supports reading; otherwise, false.
- public override bool CanRead {
- get { return InnerStream.CanRead; }
- }
-
- ///
- /// Gets whether the stream supports writing.
- ///
- /// true if the stream supports writing; otherwise, false.
- public override bool CanWrite {
- get { return InnerStream.CanWrite; }
- }
-
- ///
- /// Gets whether the stream supports seeking.
- ///
- /// true if the stream supports seeking; otherwise, false.
- public override bool CanSeek {
- get { return false; }
- }
-
- ///
- /// Gets whether the stream supports I/O timeouts.
- ///
- /// true if the stream supports I/O timeouts; otherwise, false.
- public override bool CanTimeout {
- get { return InnerStream.CanTimeout; }
- }
-
- ///
- /// Gets or sets a value, in miliseconds, that determines how long the stream will attempt to read before timing out.
- ///
- /// A value, in miliseconds, that determines how long the stream will attempt to read before timing out.
- /// The read timeout.
- public override int ReadTimeout {
- get { return InnerStream.ReadTimeout; }
- set { InnerStream.ReadTimeout = value; }
- }
-
- ///
- /// Gets or sets a value, in miliseconds, that determines how long the stream will attempt to write before timing out.
- ///
- /// A value, in miliseconds, that determines how long the stream will attempt to write before timing out.
- /// The write timeout.
- public override int WriteTimeout {
- get { return InnerStream.WriteTimeout; }
- set { InnerStream.WriteTimeout = value; }
- }
-
- ///
- /// Gets or sets the position within the current stream.
- ///
- /// The current position within the stream.
- /// The position of the stream.
- ///
- /// The stream does not support seeking.
- ///
- public override long Position {
- get { throw new NotSupportedException (); }
- set { throw new NotSupportedException (); }
- }
-
- ///
- /// Gets the length in bytes of the stream.
- ///
- /// A long value representing the length of the stream in bytes.
- /// The length of the stream.
- ///
- /// The stream does not support seeking.
- ///
- public override long Length {
- get { throw new NotSupportedException (); }
- }
-
- static void ValidateArguments (byte[] buffer, int offset, int count)
- {
- if (buffer == null)
- throw new ArgumentNullException (nameof (buffer));
-
- if (offset < 0 || offset > buffer.Length)
- throw new ArgumentOutOfRangeException (nameof (offset));
-
- if (count < 0 || count > (buffer.Length - offset))
- throw new ArgumentOutOfRangeException (nameof (count));
- }
-
- void CheckDisposed ()
- {
- if (disposed)
- throw new ObjectDisposedException (nameof (CompressedStream));
- }
-
- async Task ReadAsync (byte[] buffer, int offset, int count, bool doAsync, CancellationToken cancellationToken)
- {
- CheckDisposed ();
-
- ValidateArguments (buffer, offset, count);
-
- if (count == 0)
- return 0;
-
- zIn.next_out = buffer;
- zIn.next_out_index = offset;
- zIn.avail_out = count;
-
- do {
- if (zIn.avail_in == 0 && !eos) {
- cancellationToken.ThrowIfCancellationRequested ();
-
- if (doAsync)
- zIn.avail_in = await InnerStream.ReadAsync (zIn.next_in, 0, zIn.next_in.Length, cancellationToken).ConfigureAwait (false);
- else
- zIn.avail_in = InnerStream.Read (zIn.next_in, 0, zIn.next_in.Length);
-
- eos = zIn.avail_in == 0;
- zIn.next_in_index = 0;
- }
-
- int retval = zIn.inflate (JZlib.Z_FULL_FLUSH);
-
- if (retval == JZlib.Z_STREAM_END)
- break;
-
- if (eos && retval == JZlib.Z_BUF_ERROR)
- return 0;
-
- if (retval != JZlib.Z_OK)
- throw new IOException ("Error inflating: " + zIn.msg);
- } while (zIn.avail_out == count);
-
- return count - zIn.avail_out;
- }
-
- ///
- /// Reads a sequence of bytes from the stream and advances the position
- /// within the stream by the number of bytes read.
- ///
- /// The total number of bytes read into the buffer. This can be less than the number of bytes requested if that many
- /// bytes are not currently available, or zero (0) if the end of the stream has been reached.
- /// The buffer.
- /// The buffer offset.
- /// The number of bytes to read.
- ///
- /// is null.
- ///
- ///
- /// is less than zero or greater than the length of .
- /// -or-
- /// The is not large enough to contain bytes strting
- /// at the specified .
- ///
- ///
- /// The stream has been disposed.
- ///
- ///
- /// An I/O error occurred.
- ///
- public override int Read (byte[] buffer, int offset, int count)
- {
- return ReadAsync (buffer, offset, count, false, CancellationToken.None).GetAwaiter ().GetResult ();
- }
-
- ///
- /// Reads a sequence of bytes from the stream and advances the position
- /// within the stream by the number of bytes read.
- ///
- /// The total number of bytes read into the buffer. This can be less than the number of bytes requested if that many
- /// bytes are not currently available, or zero (0) if the end of the stream has been reached.
- /// The buffer.
- /// The buffer offset.
- /// The number of bytes to read.
- /// The cancellation token.
- ///
- /// is null.
- ///
- ///
- /// is less than zero or greater than the length of .
- /// -or-
- /// The is not large enough to contain bytes strting
- /// at the specified .
- ///
- ///
- /// The stream has been disposed.
- ///
- ///
- /// An I/O error occurred.
- ///
- public override Task ReadAsync (byte[] buffer, int offset, int count, CancellationToken cancellationToken)
- {
- return ReadAsync (buffer, offset, count, true, cancellationToken);
- }
-
- async Task WriteAsync (byte[] buffer, int offset, int count, bool doAsync, CancellationToken cancellationToken)
- {
- CheckDisposed ();
-
- ValidateArguments (buffer, offset, count);
-
- if (count == 0)
- return;
-
- zOut.next_in = buffer;
- zOut.next_in_index = offset;
- zOut.avail_in = count;
-
- do {
- cancellationToken.ThrowIfCancellationRequested ();
-
- zOut.avail_out = zOut.next_out.Length;
- zOut.next_out_index = 0;
-
- if (zOut.deflate (JZlib.Z_FULL_FLUSH) != JZlib.Z_OK)
- throw new IOException ("Error deflating: " + zOut.msg);
-
- if (doAsync)
- await InnerStream.WriteAsync (zOut.next_out, 0, zOut.next_out.Length - zOut.avail_out, cancellationToken).ConfigureAwait (false);
- else
- InnerStream.Write (zOut.next_out, 0, zOut.next_out.Length - zOut.avail_out);
- } while (zOut.avail_in > 0 || zOut.avail_out == 0);
- }
-
- ///
- /// Writes a sequence of bytes to the stream and advances the current
- /// position within this stream by the number of bytes written.
- ///
- /// The buffer to write.
- /// The offset of the first byte to write.
- /// The number of bytes to write.
- ///
- /// is null.
- ///
- ///
- /// is less than zero or greater than the length of .
- /// -or-
- /// The is not large enough to contain bytes strting
- /// at the specified .
- ///
- ///
- /// The stream has been disposed.
- ///
- ///
- /// The stream does not support writing.
- ///
- ///
- /// An I/O error occurred.
- ///
- public override void Write (byte[] buffer, int offset, int count)
- {
- WriteAsync (buffer, offset, count, false, CancellationToken.None).GetAwaiter ().GetResult ();
- }
-
- ///
- /// Writes a sequence of bytes to the stream and advances the current
- /// position within this stream by the number of bytes written.
- ///
- /// A task that represents the asynchronous write operation.
- /// The buffer to write.
- /// The offset of the first byte to write.
- /// The number of bytes to write.
- /// The cancellation token.
- ///
- /// is null.
- ///
- ///
- /// is less than zero or greater than the length of .
- /// -or-
- /// The is not large enough to contain bytes strting
- /// at the specified .
- ///
- ///
- /// The stream has been disposed.
- ///
- ///
- /// The stream does not support writing.
- ///
- ///
- /// An I/O error occurred.
- ///
- public override Task WriteAsync (byte[] buffer, int offset, int count, CancellationToken cancellationToken)
- {
- return WriteAsync (buffer, offset, count, true, cancellationToken);
- }
-
- ///
- /// Clears all output buffers for this stream and causes any buffered data to be written
- /// to the underlying device.
- ///
- ///
- /// The stream has been disposed.
- ///
- ///
- /// The stream does not support writing.
- ///
- ///
- /// An I/O error occurred.
- ///
- public override void Flush ()
- {
- CheckDisposed ();
-
- InnerStream.Flush ();
- }
-
- ///
- /// Clears all output buffers for this stream and causes any buffered data to be written
- /// to the underlying device.
- ///
- /// A task that represents the asynchronous flush operation.
- ///
- /// The stream has been disposed.
- ///
- ///
- /// The stream does not support writing.
- ///
- ///
- /// An I/O error occurred.
- ///
- public override Task FlushAsync (CancellationToken cancellationToken)
- {
- CheckDisposed ();
-
- return InnerStream.FlushAsync (cancellationToken);
- }
-
- ///
- /// Sets the position within the current stream.
- ///
- /// The new position within the stream.
- /// The offset into the stream relative to the .
- /// The origin to seek from.
- ///
- /// The stream does not support seeking.
- ///
- public override long Seek (long offset, SeekOrigin origin)
- {
- throw new NotSupportedException ();
- }
-
- ///
- /// Sets the length of the stream.
- ///
- /// The desired length of the stream in bytes.
- ///
- /// The stream does not support setting the length.
- ///
- public override void SetLength (long value)
- {
- throw new NotSupportedException ();
- }
-
- ///
- /// Releases the unmanaged resources used by the and
- /// optionally releases the managed resources.
- ///
- /// true to release both managed and unmanaged resources;
- /// false to release only the unmanaged resources.
- protected override void Dispose (bool disposing)
- {
- if (disposing && !disposed) {
- InnerStream.Dispose ();
- disposed = true;
- zOut.free ();
- zIn.free ();
- }
-
- base.Dispose (disposing);
- }
- }
-}
diff --git a/src/MailKit/ConnectedEventArgs.cs b/src/MailKit/ConnectedEventArgs.cs
deleted file mode 100644
index 99fc534..0000000
--- a/src/MailKit/ConnectedEventArgs.cs
+++ /dev/null
@@ -1,88 +0,0 @@
-//
-// ConnectedEventArgs.cs
-//
-// Author: Jeffrey Stedfast
-//
-// Copyright (c) 2013-2020 .NET Foundation and Contributors
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-using System;
-
-using MailKit.Security;
-
-namespace MailKit
-{
- ///
- /// Connected event arguments.
- ///
- ///
- /// When a is connected, it will emit a
- /// event.
- ///
- public class ConnectedEventArgs : EventArgs
- {
- ///
- /// Initializes a new instance of the class.
- ///
- /// The name of the host that the client connected to.
- /// The port that the client connected to on the remote host.
- /// The SSL/TLS options that were used when connecting to the remote host.
- public ConnectedEventArgs (string host, int port, SecureSocketOptions options)
- {
- Options = options;
- Host = host;
- Port = port;
- }
-
- ///
- /// Get the name of the remote host.
- ///
- ///
- /// Gets the name of the remote host.
- ///
- /// The host name of the server.
- public string Host {
- get; private set;
- }
-
- ///
- /// Get the port.
- ///
- ///
- /// Gets the port.
- ///
- /// The port.
- public int Port {
- get; private set;
- }
-
- ///
- /// Get the SSL/TLS options.
- ///
- ///
- /// Gets the SSL/TLS options.
- ///
- /// The SSL/TLS options.
- public SecureSocketOptions Options {
- get; private set;
- }
- }
-}
diff --git a/src/MailKit/DeliveryStatusNotification.cs b/src/MailKit/DeliveryStatusNotification.cs
deleted file mode 100644
index 72c2823..0000000
--- a/src/MailKit/DeliveryStatusNotification.cs
+++ /dev/null
@@ -1,61 +0,0 @@
-//
-// DeliveryStatusNotification.cs
-//
-// Author: Jeffrey Stedfast
-//
-// Copyright (c) 2013-2020 .NET Foundation and Contributors
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-using System;
-
-namespace MailKit {
- ///
- /// Delivery status notification types.
- ///
- ///
- /// A set of flags that may be bitwise-or'd together to specify
- /// when a delivery status notification should be sent for a
- /// particlar recipient.
- ///
- [Flags]
- public enum DeliveryStatusNotification {
- ///
- /// Never send delivery status notifications.
- ///
- Never = 0,
-
- ///
- /// Send a notification on successful delivery to the recipient.
- ///
- Success = (1 << 0),
-
- ///
- /// Send a notification on failure to deliver to the recipient.
- ///
- Failure = (1 << 1),
-
- ///
- /// Send a notification when the delivery to the recipient has
- /// been delayed for an unusual amount of time.
- ///
- Delay = (1 << 2)
- }
-}
diff --git a/src/MailKit/DeliveryStatusNotificationType.cs b/src/MailKit/DeliveryStatusNotificationType.cs
deleted file mode 100644
index 717404b..0000000
--- a/src/MailKit/DeliveryStatusNotificationType.cs
+++ /dev/null
@@ -1,54 +0,0 @@
-//
-// DeliveryStatusNotificationReturnType.cs
-//
-// Author: Jeffrey Stedfast
-//
-// Copyright (c) 2013-2019 .NET Foundation and Contributors
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-namespace MailKit.Net.Smtp
-{
- ///
- /// Delivery status notification type.
- ///
- ///
- /// The delivery status notification type specifies whether or not
- /// the full message should be included in any failed DSN issued for
- /// a message transmission as opposed to just the headers.
- ///
- public enum DeliveryStatusNotificationType
- {
- ///
- /// The return type is unspecified, allowing the server to choose.
- ///
- Unspecified,
-
- ///
- /// The full message should be included in any failed delivery status notification issued by the server.
- ///
- Full,
-
- ///
- /// Only the headers should be included in any failed delivery status notification issued by the server.
- ///
- HeadersOnly,
- }
-}
diff --git a/src/MailKit/DisconnectedEventArgs.cs b/src/MailKit/DisconnectedEventArgs.cs
deleted file mode 100644
index 676c904..0000000
--- a/src/MailKit/DisconnectedEventArgs.cs
+++ /dev/null
@@ -1,70 +0,0 @@
-//
-// DisconnectedEventArgs.cs
-//
-// Author: Jeffrey Stedfast
-//
-// Copyright (c) 2013-2020 .NET Foundation and Contributors
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-using MailKit.Security;
-
-namespace MailKit
-{
- ///
- /// Disconnected event arguments.
- ///
- ///
- /// When a gets disconnected, it will emit a
- /// event.
- ///
- public class DisconnectedEventArgs : ConnectedEventArgs
- {
- ///
- /// Initializes a new instance of the class.
- ///
- ///
- /// Initializes a new instance of the class.
- ///
- /// The name of the host that the client was connected to.
- /// The port that the client was connected to.
- /// The SSL/TLS options that were used by the client.
- /// If true, the was disconnected via the
- /// method.
- public DisconnectedEventArgs (string host, int port, SecureSocketOptions options, bool requested) : base (host, port, options)
- {
- IsRequested = requested;
- }
-
- ///
- /// Get whether or not the service was explicitly asked to disconnect.
- ///
- ///
- /// If the was disconnected via the
- /// method, then
- /// the value of will be true. If the connection was unexpectedly
- /// dropped, then the value will be false.
- ///
- /// true if the disconnect was explicitly requested; otherwise, false.
- public bool IsRequested {
- get; private set;
- }
- }
-}
diff --git a/src/MailKit/DuplexStream.cs b/src/MailKit/DuplexStream.cs
deleted file mode 100644
index e71ab1e..0000000
--- a/src/MailKit/DuplexStream.cs
+++ /dev/null
@@ -1,395 +0,0 @@
-//
-// DuplexStream.cs
-//
-// Author: Jeffrey Stedfast
-//
-// Copyright (c) 2013-2020 .NET Foundation and Contributors
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-using System;
-using System.IO;
-using System.Threading;
-using System.Threading.Tasks;
-
-namespace MailKit {
- ///
- /// A duplex stream.
- ///
- class DuplexStream : Stream
- {
- bool disposed;
-
- ///
- /// Initializes a new instance of the class.
- ///
- /// The stream to use for input.
- /// The stream to use for output.
- ///
- /// is null.
- /// -or-
- /// is null.
- ///
- public DuplexStream (Stream istream, Stream ostream)
- {
- if (istream == null)
- throw new ArgumentNullException (nameof (istream));
-
- if (ostream == null)
- throw new ArgumentNullException (nameof (ostream));
-
- InputStream = istream;
- OutputStream = ostream;
- }
-
- ///
- /// Gets the input stream.
- ///
- /// The input stream.
- public Stream InputStream {
- get; private set;
- }
-
- ///
- /// Gets the output stream.
- ///
- /// The output stream.
- public Stream OutputStream {
- get; private set;
- }
-
- ///
- /// Gets whether the stream supports reading.
- ///
- /// true if the stream supports reading; otherwise, false.
- public override bool CanRead {
- get { return true; }
- }
-
- ///
- /// Gets whether the stream supports writing.
- ///
- /// true if the stream supports writing; otherwise, false.
- public override bool CanWrite {
- get { return true; }
- }
-
- ///
- /// Gets whether the stream supports seeking.
- ///
- /// true if the stream supports seeking; otherwise, false.
- public override bool CanSeek {
- get { return false; }
- }
-
- ///
- /// Gets whether the stream supports I/O timeouts.
- ///
- /// true if the stream supports I/O timeouts; otherwise, false.
- public override bool CanTimeout {
- get { return InputStream.CanTimeout && OutputStream.CanTimeout; }
- }
-
- ///
- /// Gets or sets a value, in miliseconds, that determines how long the stream will attempt to read before timing out.
- ///
- /// A value, in miliseconds, that determines how long the stream will attempt to read before timing out.
- /// The read timeout.
- public override int ReadTimeout {
- get { return InputStream.ReadTimeout; }
- set { InputStream.ReadTimeout = value; }
- }
-
- ///
- /// Gets or sets a value, in miliseconds, that determines how long the stream will attempt to write before timing out.
- ///
- /// A value, in miliseconds, that determines how long the stream will attempt to write before timing out.
- /// The write timeout.
- public override int WriteTimeout {
- get { return OutputStream.WriteTimeout; }
- set { OutputStream.WriteTimeout = value; }
- }
-
- ///
- /// Gets or sets the position within the current stream.
- ///
- /// The current position within the stream.
- /// The position of the stream.
- ///
- /// The stream does not support seeking.
- ///
- public override long Position {
- get { throw new NotSupportedException (); }
- set { throw new NotSupportedException (); }
- }
-
- ///
- /// Gets the length in bytes of the stream.
- ///
- /// A long value representing the length of the stream in bytes.
- /// The length of the stream.
- ///
- /// The stream does not support seeking.
- ///
- public override long Length {
- get { throw new NotSupportedException (); }
- }
-
- static void ValidateArguments (byte[] buffer, int offset, int count)
- {
- if (buffer == null)
- throw new ArgumentNullException (nameof (buffer));
-
- if (offset < 0 || offset > buffer.Length)
- throw new ArgumentOutOfRangeException (nameof (offset));
-
- if (count < 0 || count > (buffer.Length - offset))
- throw new ArgumentOutOfRangeException (nameof (count));
- }
-
- void CheckDisposed ()
- {
- if (disposed)
- throw new ObjectDisposedException (nameof (DuplexStream));
- }
-
- ///
- /// Reads a sequence of bytes from the stream and advances the position
- /// within the stream by the number of bytes read.
- ///
- /// The total number of bytes read into the buffer. This can be less than the number of bytes requested if that many
- /// bytes are not currently available, or zero (0) if the end of the stream has been reached.
- /// The buffer.
- /// The buffer offset.
- /// The number of bytes to read.
- ///
- /// is null.
- ///
- ///
- /// is less than zero or greater than the length of .
- /// -or-
- /// The is not large enough to contain bytes strting
- /// at the specified .
- ///
- ///
- /// The stream has been disposed.
- ///
- ///
- /// An I/O error occurred.
- ///
- public override int Read (byte[] buffer, int offset, int count)
- {
- CheckDisposed ();
-
- ValidateArguments (buffer, offset, count);
-
- return InputStream.Read (buffer, offset, count);
- }
-
- ///
- /// Reads a sequence of bytes from the stream and advances the position
- /// within the stream by the number of bytes read.
- ///
- /// The total number of bytes read into the buffer. This can be less than the number of bytes requested if that many
- /// bytes are not currently available, or zero (0) if the end of the stream has been reached.
- /// The buffer.
- /// The buffer offset.
- /// The number of bytes to read.
- /// The cancellation token.
- ///
- /// is null.
- ///
- ///
- /// is less than zero or greater than the length of .
- /// -or-
- /// The is not large enough to contain bytes strting
- /// at the specified .
- ///
- ///
- /// The stream has been disposed.
- ///
- ///
- /// An I/O error occurred.
- ///
- public override Task ReadAsync (byte[] buffer, int offset, int count, CancellationToken cancellationToken)
- {
- CheckDisposed ();
-
- ValidateArguments (buffer, offset, count);
-
- return InputStream.ReadAsync (buffer, offset, count, cancellationToken);
- }
-
- ///
- /// Writes a sequence of bytes to the stream and advances the current
- /// position within this stream by the number of bytes written.
- ///
- /// The buffer to write.
- /// The offset of the first byte to write.
- /// The number of bytes to write.
- ///
- /// is null.
- ///
- ///
- /// is less than zero or greater than the length of .
- /// -or-
- /// The is not large enough to contain bytes strting
- /// at the specified .
- ///
- ///
- /// The stream has been disposed.
- ///
- ///
- /// The stream does not support writing.
- ///
- ///
- /// An I/O error occurred.
- ///
- public override void Write (byte[] buffer, int offset, int count)
- {
- CheckDisposed ();
-
- ValidateArguments (buffer, offset, count);
-
- OutputStream.Write (buffer, offset, count);
- }
-
- ///
- /// Writes a sequence of bytes to the stream and advances the current
- /// position within this stream by the number of bytes written.
- ///
- /// A task that represents the asynchronous write operation.
- /// The buffer to write.
- /// The offset of the first byte to write.
- /// The number of bytes to write.
- /// The cancellation token.
- ///
- /// is null.
- ///
- ///
- /// is less than zero or greater than the length of .
- /// -or-
- /// The is not large enough to contain bytes strting
- /// at the specified .
- ///
- ///
- /// The stream has been disposed.
- ///
- ///
- /// The stream does not support writing.
- ///
- ///
- /// An I/O error occurred.
- ///
- public override Task WriteAsync (byte[] buffer, int offset, int count, CancellationToken cancellationToken)
- {
- CheckDisposed ();
-
- ValidateArguments (buffer, offset, count);
-
- return OutputStream.WriteAsync (buffer, offset, count, cancellationToken);
- }
-
- ///
- /// Clears all output buffers for this stream and causes any buffered data to be written
- /// to the underlying device.
- ///
- ///
- /// The stream has been disposed.
- ///
- ///
- /// The stream does not support writing.
- ///
- ///
- /// An I/O error occurred.
- ///
- public override void Flush ()
- {
- CheckDisposed ();
-
- OutputStream.Flush ();
- }
-
- ///
- /// Clears all output buffers for this stream and causes any buffered data to be written
- /// to the underlying device.
- ///
- /// A task that represents the asynchronous flush operation.
- /// The cancellation token.
- ///
- /// The stream has been disposed.
- ///
- ///
- /// The stream does not support writing.
- ///
- ///
- /// An I/O error occurred.
- ///
- public override Task FlushAsync (CancellationToken cancellationToken)
- {
- CheckDisposed ();
-
- return OutputStream.FlushAsync (cancellationToken);
- }
-
- ///
- /// Sets the position within the current stream.
- ///
- /// The new position within the stream.
- /// The offset into the stream relative to the .
- /// The origin to seek from.
- ///
- /// The stream does not support seeking.
- ///
- public override long Seek (long offset, SeekOrigin origin)
- {
- throw new NotSupportedException ();
- }
-
- ///
- /// Sets the length of the stream.
- ///
- /// The desired length of the stream in bytes.
- ///
- /// The stream does not support setting the length.
- ///
- public override void SetLength (long value)
- {
- throw new NotSupportedException ();
- }
-
- ///
- /// Releases the unmanaged resources used by the and
- /// optionally releases the managed resources.
- ///
- /// true to release both managed and unmanaged resources;
- /// false to release only the unmanaged resources.
- protected override void Dispose (bool disposing)
- {
- if (disposing && !disposed) {
- OutputStream.Dispose ();
- InputStream.Dispose ();
- disposed = true;
- }
-
- base.Dispose (disposing);
- }
- }
-}
diff --git a/src/MailKit/Envelope.cs b/src/MailKit/Envelope.cs
deleted file mode 100644
index 76366cc..0000000
--- a/src/MailKit/Envelope.cs
+++ /dev/null
@@ -1,592 +0,0 @@
-//
-// Envelope.cs
-//
-// Author: Jeffrey Stedfast
-//
-// Copyright (c) 2013-2020 .NET Foundation and Contributors
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-using System;
-using System.Text;
-using System.Linq;
-using System.Collections.Generic;
-
-using MimeKit;
-using MimeKit.Utils;
-
-namespace MailKit {
- ///
- /// A message envelope containing a brief summary of the message.
- ///
- ///
- /// The envelope of a message contains information such as the
- /// date the message was sent, the subject of the message,
- /// the sender of the message, who the message was sent to,
- /// which message(s) the message may be in reply to,
- /// and the message id.
- ///
- public class Envelope
- {
- ///
- /// Initializes a new instance of the class.
- ///
- ///
- /// Creates a new .
- ///
- public Envelope ()
- {
- From = new InternetAddressList ();
- Sender = new InternetAddressList ();
- ReplyTo = new InternetAddressList ();
- To = new InternetAddressList ();
- Cc = new InternetAddressList ();
- Bcc = new InternetAddressList ();
- }
-
- ///
- /// Gets the address(es) that the message is from.
- ///
- ///
- /// Gets the address(es) that the message is from.
- ///
- /// The address(es) that the message is from.
- public InternetAddressList From {
- get; private set;
- }
-
- ///
- /// Gets the actual sender(s) of the message.
- ///
- ///
- /// The senders may differ from the addresses in if
- /// the message was sent by someone on behalf of someone else.
- ///
- /// The actual sender(s) of the message.
- public InternetAddressList Sender {
- get; private set;
- }
-
- ///
- /// Gets the address(es) that replies should be sent to.
- ///
- ///
- /// The senders of the message may prefer that replies are sent
- /// somewhere other than the address they used to send the message.
- ///
- /// The address(es) that replies should be sent to.
- public InternetAddressList ReplyTo {
- get; private set;
- }
-
- ///
- /// Gets the list of addresses that the message was sent to.
- ///
- ///
- /// Gets the list of addresses that the message was sent to.
- ///
- /// The address(es) that the message was sent to.
- public InternetAddressList To {
- get; private set;
- }
-
- ///
- /// Gets the list of addresses that the message was carbon-copied to.
- ///
- ///
- /// Gets the list of addresses that the message was carbon-copied to.
- ///
- /// The address(es) that the message was carbon-copied to.
- public InternetAddressList Cc {
- get; private set;
- }
-
- ///
- /// Gets the list of addresses that the message was blind-carbon-copied to.
- ///
- ///
- /// Gets the list of addresses that the message was blind-carbon-copied to.
- ///
- /// The address(es) that the message was carbon-copied to.
- public InternetAddressList Bcc {
- get; private set;
- }
-
- ///
- /// The Message-Id that the message is replying to.
- ///
- ///
- /// The Message-Id that the message is replying to.
- ///
- /// The Message-Id that the message is replying to.
- public string InReplyTo {
- get; set;
- }
-
- ///
- /// Gets the date that the message was sent on, if available.
- ///
- ///
- /// Gets the date that the message was sent on, if available.
- ///
- /// The date the message was sent.
- public DateTimeOffset? Date {
- get; set;
- }
-
- ///
- /// Gets the ID of the message, if available.
- ///
- ///
- /// Gets the ID of the message, if available.
- ///
- /// The message identifier.
- public string MessageId {
- get; set;
- }
-
- ///
- /// Gets the subject of the message.
- ///
- ///
- /// Gets the subject of the message.
- ///
- /// The subject.
- public string Subject {
- get; set;
- }
-
- static void EncodeMailbox (StringBuilder builder, MailboxAddress mailbox)
- {
- builder.Append ('(');
-
- if (mailbox.Name != null)
- builder.AppendFormat ("{0} ", MimeUtils.Quote (mailbox.Name));
- else
- builder.Append ("NIL ");
-
- if (mailbox.Route.Count != 0)
- builder.AppendFormat ("\"{0}\" ", mailbox.Route);
- else
- builder.Append ("NIL ");
-
- int at = mailbox.Address.LastIndexOf ('@');
-
- if (at >= 0) {
- var domain = mailbox.Address.Substring (at + 1);
- var user = mailbox.Address.Substring (0, at);
-
- builder.AppendFormat ("{0} {1}", MimeUtils.Quote (user), MimeUtils.Quote (domain));
- } else {
- builder.AppendFormat ("{0} \"localhost\"", MimeUtils.Quote (mailbox.Address));
- }
-
- builder.Append (')');
- }
-
- static void EncodeInternetAddressListAddresses (StringBuilder builder, InternetAddressList addresses)
- {
- foreach (var addr in addresses) {
- var mailbox = addr as MailboxAddress;
- var group = addr as GroupAddress;
-
- if (mailbox != null)
- EncodeMailbox (builder, mailbox);
- else if (group != null)
- EncodeGroup (builder, group);
- }
- }
-
- static void EncodeGroup (StringBuilder builder, GroupAddress group)
- {
- builder.AppendFormat ("(NIL NIL {0} NIL)", MimeUtils.Quote (group.Name));
- EncodeInternetAddressListAddresses (builder, group.Members);
- builder.Append ("(NIL NIL NIL NIL)");
- }
-
- static void EncodeAddressList (StringBuilder builder, InternetAddressList list)
- {
- builder.Append ('(');
- EncodeInternetAddressListAddresses (builder, list);
- builder.Append (')');
- }
-
- internal void Encode (StringBuilder builder)
- {
- builder.Append ('(');
-
- if (Date.HasValue)
- builder.AppendFormat ("\"{0}\" ", DateUtils.FormatDate (Date.Value));
- else
- builder.Append ("NIL ");
-
- if (Subject != null)
- builder.AppendFormat ("{0} ", MimeUtils.Quote (Subject));
- else
- builder.Append ("NIL ");
-
- if (From.Count > 0) {
- EncodeAddressList (builder, From);
- builder.Append (' ');
- } else {
- builder.Append ("NIL ");
- }
-
- if (Sender.Count > 0) {
- EncodeAddressList (builder, Sender);
- builder.Append (' ');
- } else {
- builder.Append ("NIL ");
- }
-
- if (ReplyTo.Count > 0) {
- EncodeAddressList (builder, ReplyTo);
- builder.Append (' ');
- } else {
- builder.Append ("NIL ");
- }
-
- if (To.Count > 0) {
- EncodeAddressList (builder, To);
- builder.Append (' ');
- } else {
- builder.Append ("NIL ");
- }
-
- if (Cc.Count > 0) {
- EncodeAddressList (builder, Cc);
- builder.Append (' ');
- } else {
- builder.Append ("NIL ");
- }
-
- if (Bcc.Count > 0) {
- EncodeAddressList (builder, Bcc);
- builder.Append (' ');
- } else {
- builder.Append ("NIL ");
- }
-
- if (InReplyTo != null) {
- if (InReplyTo.Length > 1 && InReplyTo[0] != '<' && InReplyTo[InReplyTo.Length - 1] != '>')
- builder.AppendFormat ("{0} ", MimeUtils.Quote ('<' + InReplyTo + '>'));
- else
- builder.AppendFormat ("{0} ", MimeUtils.Quote (InReplyTo));
- } else
- builder.Append ("NIL ");
-
- if (MessageId != null) {
- if (MessageId.Length > 1 && MessageId[0] != '<' && MessageId[MessageId.Length - 1] != '>')
- builder.AppendFormat ("{0}", MimeUtils.Quote ('<' + MessageId + '>'));
- else
- builder.AppendFormat ("{0}", MimeUtils.Quote (MessageId));
- } else
- builder.Append ("NIL");
-
- builder.Append (')');
- }
-
- ///
- /// Returns a that represents the current .
- ///
- ///
- /// The returned string can be parsed by .
- /// The syntax of the string returned, while similar to IMAP's ENVELOPE syntax,
- /// is not completely compatible.
- ///
- /// A that represents the current .
- public override string ToString ()
- {
- var builder = new StringBuilder ();
-
- Encode (builder);
-
- return builder.ToString ();
- }
-
- static bool TryParse (string text, ref int index, out string nstring)
- {
- nstring = null;
-
- while (index < text.Length && text[index] == ' ')
- index++;
-
- if (index >= text.Length)
- return false;
-
- if (text[index] != '"') {
- if (index + 3 <= text.Length && text.Substring (index, 3) == "NIL") {
- index += 3;
- return true;
- }
-
- return false;
- }
-
- var token = new StringBuilder ();
- bool escaped = false;
-
- index++;
-
- while (index < text.Length) {
- if (text[index] == '"' && !escaped)
- break;
-
- if (escaped || text[index] != '\\') {
- token.Append (text[index]);
- escaped = false;
- } else {
- escaped = true;
- }
-
- index++;
- }
-
- if (index >= text.Length)
- return false;
-
- nstring = token.ToString ();
-
- index++;
-
- return true;
- }
-
- static bool TryParse (string text, ref int index, out InternetAddress addr)
- {
- string name, route, user, domain;
- DomainList domains;
-
- addr = null;
-
- if (text[index] != '(')
- return false;
-
- index++;
-
- if (!TryParse (text, ref index, out name))
- return false;
-
- if (!TryParse (text, ref index, out route))
- return false;
-
- if (!TryParse (text, ref index, out user))
- return false;
-
- if (!TryParse (text, ref index, out domain))
- return false;
-
- while (index < text.Length && text[index] == ' ')
- index++;
-
- if (index >= text.Length || text[index] != ')')
- return false;
-
- index++;
-
- if (domain != null) {
- var address = user + "@" + domain;
-
- if (route != null && DomainList.TryParse (route, out domains))
- addr = new MailboxAddress (name, domains, address);
- else
- addr = new MailboxAddress (name, address);
- } else if (user != null) {
- addr = new GroupAddress (user);
- }
-
- return true;
- }
-
- static bool TryParse (string text, ref int index, out InternetAddressList list)
- {
- list = null;
-
- while (index < text.Length && text[index] == ' ')
- index++;
-
- if (index >= text.Length)
- return false;
-
- if (text[index] != '(') {
- if (index + 3 <= text.Length && text.Substring (index, 3) == "NIL") {
- list = new InternetAddressList ();
- index += 3;
- return true;
- }
-
- return false;
- }
-
- index++;
-
- if (index >= text.Length)
- return false;
-
- list = new InternetAddressList ();
- var stack = new List ();
- int sp = 0;
-
- stack.Add (list);
-
- do {
- if (text[index] == ')')
- break;
-
- if (!TryParse (text, ref index, out InternetAddress addr))
- return false;
-
- if (addr != null) {
- var group = addr as GroupAddress;
-
- stack[sp].Add (addr);
-
- if (group != null) {
- stack.Add (group.Members);
- sp++;
- }
- } else if (sp > 0) {
- stack.RemoveAt (sp);
- sp--;
- }
-
- while (index < text.Length && text[index] == ' ')
- index++;
- } while (index < text.Length);
-
- // Note: technically, we should check that sp == 0 as well, since all groups should
- // be popped off the stack, but in the interest of being liberal in what we accept,
- // we'll ignore that.
- if (index >= text.Length)
- return false;
-
- index++;
-
- return true;
- }
-
- internal static bool TryParse (string text, ref int index, out Envelope envelope)
- {
- InternetAddressList from, sender, replyto, to, cc, bcc;
- string inreplyto, messageid, subject, nstring;
- DateTimeOffset? date = null;
-
- envelope = null;
-
- while (index < text.Length && text[index] == ' ')
- index++;
-
- if (index >= text.Length || text[index] != '(') {
- if (index + 3 <= text.Length && text.Substring (index, 3) == "NIL") {
- index += 3;
- return true;
- }
-
- return false;
- }
-
- index++;
-
- if (!TryParse (text, ref index, out nstring))
- return false;
-
- if (nstring != null) {
- DateTimeOffset value;
-
- if (!DateUtils.TryParse (nstring, out value))
- return false;
-
- date = value;
- }
-
- if (!TryParse (text, ref index, out subject))
- return false;
-
- if (!TryParse (text, ref index, out from))
- return false;
-
- if (!TryParse (text, ref index, out sender))
- return false;
-
- if (!TryParse (text, ref index, out replyto))
- return false;
-
- if (!TryParse (text, ref index, out to))
- return false;
-
- if (!TryParse (text, ref index, out cc))
- return false;
-
- if (!TryParse (text, ref index, out bcc))
- return false;
-
- if (!TryParse (text, ref index, out inreplyto))
- return false;
-
- if (!TryParse (text, ref index, out messageid))
- return false;
-
- if (index >= text.Length || text[index] != ')')
- return false;
-
- index++;
-
- envelope = new Envelope {
- Date = date,
- Subject = subject,
- From = from,
- Sender = sender,
- ReplyTo = replyto,
- To = to,
- Cc = cc,
- Bcc = bcc,
- InReplyTo = inreplyto != null ? MimeUtils.EnumerateReferences (inreplyto).FirstOrDefault () ?? inreplyto : null,
- MessageId = messageid != null ? MimeUtils.EnumerateReferences (messageid).FirstOrDefault () ?? messageid : null
- };
-
- return true;
- }
-
- ///
- /// Tries to parse the given text into a new instance.
- ///
- ///
- /// Parses an Envelope value from the specified text.
- /// This syntax, while similar to IMAP's ENVELOPE syntax, is not
- /// completely compatible.
- ///
- /// true, if the envelope was successfully parsed, false otherwise.
- /// The text to parse.
- /// The parsed envelope.
- ///
- /// is null.
- ///
- public static bool TryParse (string text, out Envelope envelope)
- {
- if (text == null)
- throw new ArgumentNullException (nameof (text));
-
- int index = 0;
-
- return TryParse (text, ref index, out envelope) && index == text.Length;
- }
- }
-}
-
\ No newline at end of file
diff --git a/src/MailKit/FolderAccess.cs b/src/MailKit/FolderAccess.cs
deleted file mode 100644
index 940b4e0..0000000
--- a/src/MailKit/FolderAccess.cs
+++ /dev/null
@@ -1,53 +0,0 @@
-//
-// FolderMode.cs
-//
-// Author: Jeffrey Stedfast
-//
-// Copyright (c) 2013-2020 .NET Foundation and Contributors
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-namespace MailKit {
- ///
- /// A folder access mode.
- ///
- ///
- /// A folder access mode.
- ///
- ///
- ///
- ///
- public enum FolderAccess {
- ///
- /// The folder is not open.
- ///
- None,
-
- ///
- /// The folder is read-only.
- ///
- ReadOnly,
-
- ///
- /// The folder is read/write.
- ///
- ReadWrite
- }
-}
diff --git a/src/MailKit/FolderAttributes.cs b/src/MailKit/FolderAttributes.cs
deleted file mode 100644
index e87ebca..0000000
--- a/src/MailKit/FolderAttributes.cs
+++ /dev/null
@@ -1,135 +0,0 @@
-//
-// FolderAttributes.cs
-//
-// Author: Jeffrey Stedfast
-//
-// Copyright (c) 2013-2020 .NET Foundation and Contributors
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-using System;
-
-namespace MailKit {
- ///
- /// Folder attributes as used by .
- ///
- ///
- /// Folder attributes as used by .
- ///
- [Flags]
- public enum FolderAttributes {
- ///
- /// The folder does not have any attributes.
- ///
- None = 0,
-
- ///
- /// It is not possible for any subfolders to exist under the folder.
- ///
- NoInferiors = (1 << 0),
-
- ///
- /// It is not possible to select the folder.
- ///
- NoSelect = (1 << 1),
-
- ///
- /// The folder has been marked as possibly containing new messages
- /// since the folder was last selected.
- ///
- Marked = (1 << 2),
-
- ///
- /// The folder does not contain any new messages since the folder
- /// was last selected.
- ///
- Unmarked = (1 << 3),
-
- ///
- /// The folder does not exist, but is simply a place-holder.
- ///
- NonExistent = (1 << 4),
-
- ///
- /// The folder is subscribed.
- ///
- Subscribed = (1 << 5),
-
- ///
- /// The folder is remote.
- ///
- Remote = (1 << 6),
-
- ///
- /// The folder has subfolders.
- ///
- HasChildren = (1 << 7),
-
- ///
- /// The folder does not have any subfolders.
- ///
- HasNoChildren = (1 << 8),
-
- ///
- /// The folder is a special "All" folder containing an aggregate of all messages.
- ///
- All = (1 << 9),
-
- ///
- /// The folder is a special "Archive" folder.
- ///
- Archive = (1 << 10),
-
- ///
- /// The folder is the special "Drafts" folder.
- ///
- Drafts = (1 << 11),
-
- ///
- /// The folder is the special "Flagged" folder.
- ///
- Flagged = (1 << 12),
-
- ///
- /// The folder is the special "Important" folder.
- ///
- Important = (1 << 13),
-
- ///
- /// The folder is the special "Inbox" folder.
- ///
- Inbox = (1 << 14),
-
- ///
- /// The folder is the special "Junk" folder.
- ///
- Junk = (1 << 15),
-
- ///
- /// The folder is the special "Sent" folder.
- ///
- Sent = (1 << 16),
-
- ///
- /// The folder is the special "Trash" folder.
- ///
- Trash = (1 << 17),
- }
-}
diff --git a/src/MailKit/FolderCreatedEventArgs.cs b/src/MailKit/FolderCreatedEventArgs.cs
deleted file mode 100644
index 949a1ad..0000000
--- a/src/MailKit/FolderCreatedEventArgs.cs
+++ /dev/null
@@ -1,67 +0,0 @@
-//
-// FolderCreatedEventArgs.cs
-//
-// Author: Jeffrey Stedfast
-//
-// Copyright (c) 2013-2020 .NET Foundation and Contributors
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-using System;
-
-namespace MailKit {
- ///
- /// Event args used when a is created.
- ///
- ///
- /// Event args used when a is created.
- ///
- public class FolderCreatedEventArgs : EventArgs
- {
- ///
- /// Initializes a new instance of the class.
- ///
- ///
- /// Creates a new .
- ///
- /// The newly created folder.
- ///
- /// is null.
- ///
- public FolderCreatedEventArgs (IMailFolder folder)
- {
- if (folder == null)
- throw new ArgumentNullException (nameof (folder));
-
- Folder = folder;
- }
-
- ///
- /// Get the folder that was just created.
- ///
- ///
- /// Gets the folder that was just created.
- ///
- /// The folder.
- public IMailFolder Folder {
- get; private set;
- }
- }
-}
diff --git a/src/MailKit/FolderFeature.cs b/src/MailKit/FolderFeature.cs
deleted file mode 100644
index f9774fa..0000000
--- a/src/MailKit/FolderFeature.cs
+++ /dev/null
@@ -1,82 +0,0 @@
-//
-// FolderFeature.cs
-//
-// Author: Jeffrey Stedfast
-//
-// Copyright (c) 2013-2020 .NET Foundation and Contributors
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-namespace MailKit
-{
- ///
- /// An optional feature that an may support.
- ///
- ///
- /// An optional feature that an may support.
- ///
- public enum FolderFeature
- {
- ///
- /// Indicates that the folder supports access rights.
- ///
- AccessRights,
-
- ///
- /// Indicates that the folder allows arbitrary annotations to be set on a message.
- ///
- Annotations,
-
- ///
- /// Indicates that the folder allows arbitrary metadata to be set.
- ///
- Metadata,
-
- ///
- /// Indicates that the folder uses modification sequences for every state change of a message.
- ///
- ModSequences,
-
- ///
- /// Indicates that the folder supports quick resynchronization when opening.
- ///
- QuickResync,
-
- ///
- /// Indicates that the folder supports quotas.
- ///
- Quotas,
-
- ///
- /// Indicates that the folder supports sorting messages.
- ///
- Sorting,
-
- ///
- /// Indicates that the folder supports threading messages.
- ///
- Threading,
-
- ///
- /// Indicates that the folder supports the use of UTF-8.
- ///
- UTF8,
- }
-}
diff --git a/src/MailKit/FolderNamespace.cs b/src/MailKit/FolderNamespace.cs
deleted file mode 100644
index b1cb46e..0000000
--- a/src/MailKit/FolderNamespace.cs
+++ /dev/null
@@ -1,74 +0,0 @@
-//
-// FolderNamespace.cs
-//
-// Author: Jeffrey Stedfast
-//
-// Copyright (c) 2013-2020 .NET Foundation and Contributors
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-using System;
-
-namespace MailKit {
- ///
- /// A folder namespace.
- ///
- ///
- /// A folder namespace.
- ///
- public class FolderNamespace
- {
- ///
- /// The directory separator for this folder namespace.
- ///
- ///
- /// The directory separator for this folder namespace.
- ///
- public readonly char DirectorySeparator;
-
- ///
- /// The base path for this folder namespace.
- ///
- ///
- /// The base path for this folder namespace.
- ///
- public readonly string Path;
-
- ///
- /// Initializes a new instance of the class.
- ///
- ///
- /// Creates a new folder namespace.
- ///
- /// The directory separator.
- /// The folder path.
- ///
- /// is null.
- ///
- public FolderNamespace (char directorySeparator, string path)
- {
- if (path == null)
- throw new ArgumentNullException (nameof (path));
-
- DirectorySeparator = directorySeparator;
- Path = path;
- }
- }
-}
diff --git a/src/MailKit/FolderNamespaceCollection.cs b/src/MailKit/FolderNamespaceCollection.cs
deleted file mode 100644
index c432b39..0000000
--- a/src/MailKit/FolderNamespaceCollection.cs
+++ /dev/null
@@ -1,235 +0,0 @@
-//
-// FolderNamespaceCollection.cs
-//
-// Author: Jeffrey Stedfast
-//
-// Copyright (c) 2013-2020 .NET Foundation and Contributors
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-using System;
-using System.Text;
-using System.Collections;
-using System.Collections.Generic;
-
-using MimeKit.Utils;
-
-namespace MailKit {
- ///
- /// A read-only collection of folder namespaces.
- ///
- ///
- /// A read-only collection of folder namespaces.
- ///
- public class FolderNamespaceCollection : IEnumerable
- {
- readonly List namespaces;
-
- ///
- /// Initializes a new instance of the class.
- ///
- ///
- /// Creates a new .
- ///
- public FolderNamespaceCollection ()
- {
- namespaces = new List ();
- }
-
- #region ICollection implementation
-
- ///
- /// Gets the number of folder namespaces contained in the collection.
- ///
- ///
- /// Gets the number of folder namespaces contained in the collection.
- ///
- /// The count.
- public int Count {
- get { return namespaces.Count; }
- }
-
- ///
- /// Adds the specified namespace.
- ///
- ///
- /// Adds the specified namespace.
- ///
- /// The namespace to add.
- ///
- /// is null.
- ///
- public void Add (FolderNamespace @namespace)
- {
- if (@namespace == null)
- throw new ArgumentNullException (nameof (@namespace));
-
- namespaces.Add (@namespace);
- }
-
- ///
- /// Removes all namespaces from the collection.
- ///
- ///
- /// Removes all namespaces from the collection.
- ///
- public void Clear ()
- {
- namespaces.Clear ();
- }
-
- ///
- /// Checks if the collection contains the specified namespace.
- ///
- ///
- /// Checks if the collection contains the specified namespace.
- ///
- /// true if the specified namespace exists;
- /// otherwise false.
- /// The namespace.
- ///
- /// is null.
- ///
- public bool Contains (FolderNamespace @namespace)
- {
- if (@namespace == null)
- throw new ArgumentNullException (nameof (@namespace));
-
- return namespaces.Contains (@namespace);
- }
-
- ///
- /// Removes the first occurance of the specified namespace.
- ///
- ///
- /// Removes the first occurance of the specified namespace.
- ///
- /// true if the frst occurance of the specified
- /// namespace was removed; otherwise false.
- /// The namespace.
- ///
- /// is null.
- ///
- public bool Remove (FolderNamespace @namespace)
- {
- if (@namespace == null)
- throw new ArgumentNullException (nameof (@namespace));
-
- return namespaces.Remove (@namespace);
- }
-
- ///
- /// Gets the at the specified index.
- ///
- ///
- /// Gets the at the specified index.
- ///
- /// The folder namespace at the specified index.
- /// The index.
- ///
- /// is null.
- ///
- ///
- /// is out of range.
- ///
- public FolderNamespace this [int index] {
- get {
- if (index < 0 || index >= namespaces.Count)
- throw new ArgumentOutOfRangeException (nameof (index));
-
- return namespaces[index];
- }
- set {
- if (index < 0 || index >= namespaces.Count)
- throw new ArgumentOutOfRangeException (nameof (index));
-
- if (value == null)
- throw new ArgumentNullException (nameof (value));
-
- namespaces[index] = value;
- }
- }
-
- #endregion
-
- #region IEnumerable implementation
-
- ///
- /// Gets the enumerator.
- ///
- ///
- /// Gets the enumerator.
- ///
- /// The enumerator.
- public IEnumerator GetEnumerator ()
- {
- return namespaces.GetEnumerator ();
- }
-
- #endregion
-
- #region IEnumerable implementation
-
- ///
- /// Gets the enumerator.
- ///
- ///
- /// Gets the enumerator.
- ///
- /// The enumerator.
- IEnumerator IEnumerable.GetEnumerator ()
- {
- return namespaces.GetEnumerator ();
- }
-
- #endregion
-
- static bool Escape (char directorySeparator)
- {
- return directorySeparator == '\\' || directorySeparator == '"';
- }
-
- ///
- /// Returns a that represents the current .
- ///
- ///
- /// Returns a that represents the current .
- ///
- /// A that represents the current .
- public override string ToString ()
- {
- var builder = new StringBuilder ();
-
- builder.Append ('(');
- for (int i = 0; i < namespaces.Count; i++) {
- builder.Append ("(\"");
- if (Escape (namespaces[i].DirectorySeparator))
- builder.Append ('\\');
- builder.Append (namespaces[i].DirectorySeparator);
- builder.Append ("\" ");
- builder.Append (MimeUtils.Quote (namespaces[i].Path));
- builder.Append (")");
- }
- builder.Append (')');
-
- return builder.ToString ();
- }
- }
-}
diff --git a/src/MailKit/FolderNotFoundException.cs b/src/MailKit/FolderNotFoundException.cs
deleted file mode 100644
index 9747e95..0000000
--- a/src/MailKit/FolderNotFoundException.cs
+++ /dev/null
@@ -1,149 +0,0 @@
-//
-// FolderNotFoundException.cs
-//
-// Author: Jeffrey Stedfast
-//
-// Copyright (c) 2013-2020 .NET Foundation and Contributors
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-using System;
-#if SERIALIZABLE
-using System.Security;
-using System.Runtime.Serialization;
-#endif
-
-namespace MailKit {
- ///
- /// The exception that is thrown when a folder could not be found.
- ///
- ///
- /// This exception is thrown by .
- ///
-#if SERIALIZABLE
- [Serializable]
-#endif
- public class FolderNotFoundException : Exception
- {
-#if SERIALIZABLE
- ///
- /// Initializes a new instance of the class.
- ///
- ///
- /// Deserializes a .
- ///
- /// The serialization info.
- /// The streaming context.
- ///
- /// is null.
- ///
- protected FolderNotFoundException (SerializationInfo info, StreamingContext context) : base (info, context)
- {
- FolderName = info.GetString ("FolderName");
- }
-#endif
-
- ///
- /// Initializes a new instance of the class.
- ///
- ///
- /// Creates a new .
- ///
- /// The error message.
- /// The name of the folder.
- /// The inner exception.
- ///
- /// is null.
- ///
- public FolderNotFoundException (string message, string folderName, Exception innerException) : base (message, innerException)
- {
- if (folderName == null)
- throw new ArgumentNullException (nameof (folderName));
-
- FolderName = folderName;
- }
-
- ///
- /// Initializes a new instance of the class.
- ///
- ///
- /// Creates a new .
- ///
- /// The error message.
- /// The name of the folder.
- ///
- /// is null.
- ///
- public FolderNotFoundException (string message, string folderName) : base (message)
- {
- if (folderName == null)
- throw new ArgumentNullException (nameof (folderName));
-
- FolderName = folderName;
- }
-
- ///
- /// Initializes a new instance of the class.
- ///
- ///
- /// Creates a new .
- ///
- /// The name of the folder.
- ///
- /// is null.
- ///
- public FolderNotFoundException (string folderName) : this ("The requested folder could not be found.", folderName)
- {
- }
-
- ///
- /// Gets the name of the folder that could not be found.
- ///
- ///
- /// Gets the name of the folder that could not be found.
- ///
- /// The name of the folder.
- public string FolderName {
- get; private set;
- }
-
-#if SERIALIZABLE
- ///
- /// When overridden in a derived class, sets the
- /// with information about the exception.
- ///
- ///
- /// Serializes the state of the .
- ///
- /// The serialization info.
- /// The streaming context.
- ///
- /// is null.
- ///
- [SecurityCritical]
- public override void GetObjectData (SerializationInfo info, StreamingContext context)
- {
- base.GetObjectData (info, context);
-
- info.AddValue ("FolderName", FolderName);
- }
-#endif
- }
-}
diff --git a/src/MailKit/FolderNotOpenException.cs b/src/MailKit/FolderNotOpenException.cs
deleted file mode 100644
index 1a52d99..0000000
--- a/src/MailKit/FolderNotOpenException.cs
+++ /dev/null
@@ -1,184 +0,0 @@
-//
-// FolderNotOpenException.cs
-//
-// Author: Jeffrey Stedfast
-//
-// Copyright (c) 2013-2020 .NET Foundation and Contributors
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-using System;
-#if SERIALIZABLE
-using System.Runtime.Serialization;
-#endif
-
-namespace MailKit {
- ///
- /// The exception that is thrown when a folder is not open.
- ///
- ///
- /// This exception is thrown when an operation on a folder could not be completed
- /// due to the folder being in a closed state. For example, the
- ///
- /// method will throw a if the folder is not
- /// current open.
- ///
-#if SERIALIZABLE
- [Serializable]
-#endif
- public class FolderNotOpenException : InvalidOperationException
- {
-#if SERIALIZABLE
- ///
- /// Initializes a new instance of the class.
- ///
- ///
- /// Deserializes a .
- ///
- /// The serialization info.
- /// The streaming context.
- ///
- /// is null.
- ///
- protected FolderNotOpenException (SerializationInfo info, StreamingContext context) : base (info, context)
- {
- var value = info.GetString ("FolderAccess");
- FolderAccess access;
-
- if (!Enum.TryParse (value, out access))
- FolderAccess = FolderAccess.ReadOnly;
- else
- FolderAccess = access;
-
- FolderName = info.GetString ("FolderName");
- }
-#endif
-
- ///
- /// Initializes a new instance of the class.
- ///
- ///
- /// Creates a new .
- ///
- /// The folder name.
- /// The minimum folder access required by the operation.
- /// The error message.
- /// The inner exception.
- ///
- /// is null.
- ///
- public FolderNotOpenException (string folderName, FolderAccess access, string message, Exception innerException) : base (message, innerException)
- {
- if (folderName == null)
- throw new ArgumentNullException (nameof (folderName));
-
- FolderName = folderName;
- FolderAccess = access;
- }
-
- ///
- /// Initializes a new instance of the class.
- ///
- ///
- /// Creates a new .
- ///
- /// The folder name.
- /// The minimum folder access required by the operation.
- /// The error message.
- ///
- /// is null.
- ///
- public FolderNotOpenException (string folderName, FolderAccess access, string message) : base (message)
- {
- if (folderName == null)
- throw new ArgumentNullException (nameof (folderName));
-
- FolderName = folderName;
- FolderAccess = access;
- }
-
- ///
- /// Initializes a new instance of the class.
- ///
- ///
- /// Creates a new .
- ///
- /// The folder name.
- /// The minimum folder access required by the operation.
- ///
- /// is null.
- ///
- public FolderNotOpenException (string folderName, FolderAccess access) : this (folderName, access, GetDefaultMessage (access))
- {
- }
-
- ///
- /// Get the name of the folder.
- ///
- ///
- /// Gets the name of the folder.
- ///
- /// The name of the folder.
- public string FolderName {
- get; private set;
- }
-
- ///
- /// Get the minimum folder access required by the operation.
- ///
- ///
- /// Gets the minimum folder access required by the operation.
- ///
- /// The minimum required folder access.
- public FolderAccess FolderAccess {
- get; private set;
- }
-
- static string GetDefaultMessage (FolderAccess access)
- {
- if (access == FolderAccess.ReadWrite)
- return "The folder is not currently open in read-write mode.";
-
- return "The folder is not currently open.";
- }
-
-#if SERIALIZABLE
- ///
- /// When overridden in a derived class, sets the
- /// with information about the exception.
- ///
- ///
- /// Serializes the state of the .
- ///
- /// The serialization info.
- /// The streaming context.
- ///
- /// is null.
- ///
- public override void GetObjectData (SerializationInfo info, StreamingContext context)
- {
- base.GetObjectData (info, context);
-
- info.AddValue ("FolderAccess", FolderAccess.ToString ());
- info.AddValue ("FolderName", FolderName);
- }
-#endif
- }
-}
diff --git a/src/MailKit/FolderQuota.cs b/src/MailKit/FolderQuota.cs
deleted file mode 100644
index 056fe57..0000000
--- a/src/MailKit/FolderQuota.cs
+++ /dev/null
@@ -1,124 +0,0 @@
-//
-// FolderQuota.cs
-//
-// Author: Jeffrey Stedfast
-//
-// Copyright (c) 2013-2020 .NET Foundation and Contributors
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-using System;
-
-namespace MailKit {
- ///
- /// A folder quota.
- ///
- ///
- /// A is returned by .
- ///
- ///
- ///
- ///
- public class FolderQuota
- {
- ///
- /// Initializes a new instance of the class.
- ///
- ///
- /// Creates a new with the specified root.
- ///
- /// The quota root.
- public FolderQuota (IMailFolder quotaRoot)
- {
- QuotaRoot = quotaRoot;
- }
-
- ///
- /// Get the quota root.
- ///
- ///
- /// Gets the quota root. If the quota root is null, then
- /// it suggests that the folder does not have a quota.
- ///
- ///
- ///
- ///
- /// The quota root.
- public IMailFolder QuotaRoot {
- get; private set;
- }
-
- ///
- /// Get or set the message limit.
- ///
- ///
- /// Gets or sets the message limit.
- ///
- ///
- ///
- ///
- /// The message limit.
- public uint? MessageLimit {
- get; set;
- }
-
- ///
- /// Get or set the storage limit, in kilobytes.
- ///
- ///
- /// Gets or sets the storage limit, in kilobytes.
- ///
- ///
- ///
- ///
- /// The storage limit, in kilobytes.
- public uint? StorageLimit {
- get; set;
- }
-
- ///
- /// Get or set the current message count.
- ///
- ///
- /// Gets or sets the current message count.
- ///
- ///
- ///
- ///
- /// The current message count.
- public uint? CurrentMessageCount {
- get; set;
- }
-
- ///
- /// Gets or sets the size of the current storage, in kilobytes.
- ///
- ///
- /// Gets or sets the size of the current storage, in kilobytes.
- ///
- ///
- ///
- ///
- /// The size of the current storage, in kilobytes.
- public uint? CurrentStorageSize {
- get; set;
- }
- }
-}
diff --git a/src/MailKit/FolderRenamedEventArgs.cs b/src/MailKit/FolderRenamedEventArgs.cs
deleted file mode 100644
index e83b6a1..0000000
--- a/src/MailKit/FolderRenamedEventArgs.cs
+++ /dev/null
@@ -1,85 +0,0 @@
-//
-// FolderRenamedEventArgs.cs
-//
-// Author: Jeffrey Stedfast
-//
-// Copyright (c) 2013-2020 .NET Foundation and Contributors
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-using System;
-
-namespace MailKit {
- ///
- /// Event args used when a is renamed.
- ///
- ///
- /// Event args used when a is renamed.
- ///
- public class FolderRenamedEventArgs : EventArgs
- {
- ///
- /// Initializes a new instance of the class.
- ///
- ///
- /// Creates a new .
- ///
- /// The old name of the folder.
- /// The new name of the folder.
- ///
- /// is null.
- /// -or-
- /// is null.
- ///
- public FolderRenamedEventArgs (string oldName, string newName)
- {
- if (oldName == null)
- throw new ArgumentNullException (nameof (oldName));
-
- if (newName == null)
- throw new ArgumentNullException (nameof (newName));
-
- OldName = oldName;
- NewName = newName;
- }
-
- ///
- /// The old name of the folder.
- ///
- ///
- /// The old name of the folder.
- ///
- /// The old name.
- public string OldName {
- get; private set;
- }
-
- ///
- /// The new name of the folder.
- ///
- ///
- /// The new name of the folder.
- ///
- /// The new name.
- public string NewName {
- get; private set;
- }
- }
-}
diff --git a/src/MailKit/IMailFolder.cs b/src/MailKit/IMailFolder.cs
deleted file mode 100644
index b0065c7..0000000
--- a/src/MailKit/IMailFolder.cs
+++ /dev/null
@@ -1,5077 +0,0 @@
-//
-// IMailFolder.cs
-//
-// Author: Jeffrey Stedfast
-//
-// Copyright (c) 2013-2020 .NET Foundation and Contributors
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-using System;
-using System.IO;
-using System.Threading;
-using System.Threading.Tasks;
-using System.Collections.Generic;
-
-using MimeKit;
-using MailKit.Search;
-
-namespace MailKit {
- ///
- /// An interface for a mailbox folder as used by .
- ///
- ///
- /// Implemented by message stores such as
- ///
- public interface IMailFolder : IEnumerable
- {
- ///
- /// Gets an object that can be used to synchronize access to the folder.
- ///
- ///
- /// Gets an object that can be used to synchronize access to the folder.
- ///
- /// The sync root.
- object SyncRoot { get; }
-
- ///
- /// Get the parent folder.
- ///
- ///
- /// Root-level folders do not have a parent folder.
- ///
- /// The parent folder.
- IMailFolder ParentFolder { get; }
-
- ///
- /// Get the folder attributes.
- ///
- ///
- /// Gets the folder attributes.
- ///
- /// The folder attributes.
- FolderAttributes Attributes { get; }
-
- ///
- /// Get the annotation access level.
- ///
- ///
- /// If annotations are supported, this property can be used to determine whether or not
- /// the supports reading and writing annotations.
- ///
- AnnotationAccess AnnotationAccess { get; }
-
- ///
- /// Get the supported annotation scopes.
- ///
- ///
- /// If annotations are supported, this property can be used to determine which
- /// annotation scopes are supported by the .
- ///
- AnnotationScope AnnotationScopes { get; }
-
- ///
- /// Get the maximum size of annotation values supported by the folder.
- ///
- ///
- /// If annotations are supported, this property can be used to determine the
- /// maximum size of annotation values supported by the .
- ///
- uint MaxAnnotationSize { get; }
-
- ///
- /// Get the permanent flags.
- ///
- ///
- /// The permanent flags are the message flags that will persist between sessions.
- /// If the flag is set, then the folder allows
- /// storing of user-defined (custom) message flags.
- ///
- /// The permanent flags.
- MessageFlags PermanentFlags { get; }
-
- ///
- /// Get the accepted flags.
- ///
- ///
- /// The accepted flags are the message flags that will be accepted and persist
- /// for the current session. For the set of flags that will persist between
- /// sessions, see the property.
- ///
- /// The accepted flags.
- MessageFlags AcceptedFlags { get; }
-
- ///
- /// Get the directory separator.
- ///
- ///
- /// Gets the directory separator.
- ///
- /// The directory separator.
- char DirectorySeparator { get; }
-
- ///
- /// Get the read/write access of the folder.
- ///
- ///
- /// Gets the read/write access of the folder.
- ///
- /// The read/write access.
- FolderAccess Access { get; }
-
- ///
- /// Get whether or not the folder is a namespace folder.
- ///
- ///
- /// Gets whether or not the folder is a namespace folder.
- ///
- /// true if the folder is a namespace folder; otherwise, false.
- bool IsNamespace { get; }
-
- ///
- /// Get the full name of the folder.
- ///
- ///
- /// This is the equivalent of the full path of a file on a file system.
- ///
- /// The full name of the folder.
- string FullName { get; }
-
- ///
- /// Get the name of the folder.
- ///
- ///
- /// This is the equivalent of the file name of a file on the file system.
- ///
- /// The name of the folder.
- string Name { get; }
-
- ///
- /// Get the unique identifier for the folder, if available.
- ///
- ///
- /// Gets a unique identifier for the folder, if available. This is useful for clients
- /// implementing a message cache that want to track the folder after it is renamed by another
- /// client.
- /// This property will only be available if the server supports the
- /// OBJECTID extension.
- ///
- /// The unique folder identifier.
- string Id { get; }
-
- ///
- /// Get whether or not the folder is subscribed.
- ///
- ///
- /// Gets whether or not the folder is subscribed.
- ///
- /// true if the folder is subscribed; otherwise, false.
- bool IsSubscribed { get; }
-
- ///
- /// Get whether or not the folder is currently open.
- ///
- ///
- /// Gets whether or not the folder is currently open.
- ///
- /// true if the folder is currently open; otherwise, false.
- bool IsOpen { get; }
-
- ///
- /// Get whether or not the folder exists.
- ///
- ///
- /// Gets whether or not the folder exists.
- ///
- /// true if the folder exists; otherwise, false.
- bool Exists { get; }
-
- ///
- /// Get whether or not the folder supports mod-sequences.
- ///
- ///
- /// Gets whether or not the folder supports mod-sequences.
- /// If mod-sequences are not supported by the folder, then all of the APIs that take a modseq
- /// argument will throw and should not be used.
- ///
- /// true if the folder supports mod-sequences; otherwise, false.
- [Obsolete ("Use Supports(FolderFeature.ModSequences) instead.")]
- bool SupportsModSeq { get; }
-
- ///
- /// Get the highest mod-sequence value of all messages in the mailbox.
- ///
- ///
- /// Gets the highest mod-sequence value of all messages in the mailbox.
- ///
- /// The highest mod-sequence value.
- ulong HighestModSeq { get; }
-
- ///
- /// Get the Unique ID validity.
- ///
- ///
- /// UIDs are only valid so long as the UID validity value remains unchanged. If and when
- /// the folder's is changed, a client MUST discard its cache of UIDs
- /// along with any summary information that it may have and re-query the folder.
- /// The will only be set after the folder has been opened.
- ///
- /// The UID validity.
- uint UidValidity { get; }
-
- ///
- /// Get the UID that the next message that is added to the folder will be assigned.
- ///
- ///
- /// This value will only be set after the folder has been opened.
- ///
- /// The next UID.
- UniqueId? UidNext { get; }
-
- ///
- /// Get the maximum size of a message that can be appended to the folder.
- ///
- ///
- /// Gets the maximum size of a message that can be appended to the folder.
- /// If the value is not set, then the limit is unspecified.
- ///
- /// The append limit.
- uint? AppendLimit { get; }
-
- ///
- /// Get the size of the folder.
- ///
- ///
- /// Gets the size of the folder in bytes.
- /// If the value is not set, then the size is unspecified.
- ///
- /// The size.
- ulong? Size { get; }
-
- ///
- /// Get the index of the first unread message in the folder.
- ///
- ///
- /// This value will only be set after the folder has been opened.
- ///
- /// The index of the first unread message.
- int FirstUnread { get; }
-
- ///
- /// Get the number of unread messages in the folder.
- ///
- ///
- /// Gets the number of unread messages in the folder.
- /// This value will only be set after calling
- ///
- /// with .
- ///
- /// The number of unread messages.
- int Unread { get; }
-
- ///
- /// Get the number of recently delivered messages in the folder.
- ///
- ///
- /// Gets the number of recently delivered messages in the folder.
- ///
- /// This value will only be set after calling
- ///
- /// with .
- ///
- /// The number of recently delivered messages.
- int Recent { get; }
-
- ///
- /// Get the total number of messages in the folder.
- ///
- ///
- /// Gets the total number of messages in the folder.
- ///
- /// The total number of messages.
- int Count { get; }
-
- ///
- /// Get the threading algorithms supported by the folder.
- ///
- ///
- /// Get the threading algorithms supported by the folder.
- ///
- /// The supported threading algorithms.
- HashSet ThreadingAlgorithms { get; }
-
- ///
- /// Determine whether or not an supports a feature.
- ///
- ///
- /// Determines whether or not an supports a feature.
- ///
- /// The desired feature.
- /// true if the feature is supported; otherwise, false.
- bool Supports (FolderFeature feature);
-
- ///
- /// Opens the folder using the requested folder access.
- ///
- ///
- /// This variant of the
- /// method is meant for quick resynchronization of the folder. Before calling this method,
- /// the method MUST be called.
- /// You should also make sure to add listeners to the and
- /// events to get notifications of changes since
- /// the last time the folder was opened.
- ///
- /// The state of the folder.
- /// The requested folder access.
- /// The last known value.
- /// The last known value.
- /// The last known list of unique message identifiers.
- /// The cancellation token.
- FolderAccess Open (FolderAccess access, uint uidValidity, ulong highestModSeq, IList uids, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Asynchronously opens the folder using the requested folder access.
- ///
- ///
- /// This variant of the
- /// method is meant for quick resynchronization of the folder. Before calling this method,
- /// the method MUST be called.
- /// You should also make sure to add listeners to the and
- /// events to get notifications of changes since
- /// the last time the folder was opened.
- ///
- /// The state of the folder.
- /// The requested folder access.
- /// The last known value.
- /// The last known value.
- /// The last known list of unique message identifiers.
- /// The cancellation token.
- Task OpenAsync (FolderAccess access, uint uidValidity, ulong highestModSeq, IList uids, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Open the folder using the requested folder access.
- ///
- ///
- /// Opens the folder using the requested folder access.
- ///
- /// The state of the folder.
- /// The requested folder access.
- /// The cancellation token.
- FolderAccess Open (FolderAccess access, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Asynchronously open the folder using the requested folder access.
- ///
- ///
- /// Asynchronously opens the folder using the requested folder access.
- ///
- /// The state of the folder.
- /// The requested folder access.
- /// The cancellation token.
- Task OpenAsync (FolderAccess access, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Close the folder, optionally expunging the messages marked for deletion.
- ///
- ///
- /// Closes the folder, optionally expunging the messages marked for deletion.
- ///
- /// If set to true, expunge.
- /// The cancellation token.
- void Close (bool expunge = false, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Asynchronously close the folder, optionally expunging the messages marked for deletion.
- ///
- ///
- /// Asynchronously closes the folder, optionally expunging the messages marked for deletion.
- ///
- /// An asynchronous task context.
- /// If set to true, expunge.
- /// The cancellation token.
- Task CloseAsync (bool expunge = false, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Create a new subfolder with the given name.
- ///
- ///
- /// Creates a new subfolder with the given name.
- ///
- /// The created folder.
- /// The name of the folder to create.
- /// true if the folder will be used to contain messages; otherwise false.
- /// The cancellation token.
- IMailFolder Create (string name, bool isMessageFolder, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Asynchronously create a new subfolder with the given name.
- ///
- ///
- /// Asynchronously creates a new subfolder with the given name.
- ///
- /// The created folder.
- /// The name of the folder to create.
- /// true if the folder will be used to contain messages; otherwise false.
- /// The cancellation token.
- Task CreateAsync (string name, bool isMessageFolder, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Create a new subfolder with the given name.
- ///
- ///
- /// Creates a new subfolder with the given name.
- ///
- /// The created folder.
- /// The name of the folder to create.
- /// A list of special uses for the folder being created.
- /// The cancellation token.
- IMailFolder Create (string name, IEnumerable specialUses, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Asynchronously create a new subfolder with the given name.
- ///
- ///
- /// Asynchronously creates a new subfolder with the given name.
- ///
- /// The created folder.
- /// The name of the folder to create.
- /// A list of special uses for the folder being created.
- /// The cancellation token.
- Task CreateAsync (string name, IEnumerable specialUses, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Create a new subfolder with the given name.
- ///
- ///
- /// Creates a new subfolder with the given name.
- ///
- /// The created folder.
- /// The name of the folder to create.
- /// The special use for the folder being created.
- /// The cancellation token.
- IMailFolder Create (string name, SpecialFolder specialUse, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Asynchronously create a new subfolder with the given name.
- ///
- ///
- /// Asynchronously creates a new subfolder with the given name.
- ///
- /// The created folder.
- /// The name of the folder to create.
- /// The special use for the folder being created.
- /// The cancellation token.
- Task CreateAsync (string name, SpecialFolder specialUse, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Rename the folder.
- ///
- ///
- /// Renames the folder.
- ///
- /// The new parent folder.
- /// The new name of the folder.
- /// The cancellation token.
- void Rename (IMailFolder parent, string name, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Asynchronously rename the folder.
- ///
- ///
- /// Asynchronously renames the folder.
- ///
- /// An asynchronous task context.
- /// The new parent folder.
- /// The new name of the folder.
- /// The cancellation token.
- Task RenameAsync (IMailFolder parent, string name, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Delete the folder.
- ///
- ///
- /// Deletes the folder.
- ///
- /// The cancellation token.
- void Delete (CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Asynchronously delete the folder.
- ///
- ///
- /// Asynchronously deletes the folder.
- ///
- /// An asynchronous task context.
- /// The cancellation token.
- Task DeleteAsync (CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Subscribe to the folder.
- ///
- ///
- /// Subscribes to the folder.
- ///
- /// The cancellation token.
- void Subscribe (CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Asynchronously subscribe to the folder.
- ///
- ///
- /// Asynchronously subscribes to the folder.
- ///
- /// An asynchronous task context.
- /// The cancellation token.
- Task SubscribeAsync (CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Unsubscribe from the folder.
- ///
- ///
- /// Unsubscribes from the folder.
- ///
- /// The cancellation token.
- void Unsubscribe (CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Asynchronously unsubscribe from the folder.
- ///
- ///
- /// Asynchronously unsubscribes from the folder.
- ///
- /// An asynchronous task context.
- /// The cancellation token.
- Task UnsubscribeAsync (CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Get the subfolders.
- ///
- ///
- /// Gets the subfolders as well as queries the server for the status of the requested items.
- /// When the argument is non-empty, this has the equivalent functionality
- /// of calling and then calling
- /// on each of the returned folders.
- /// Using this method is potentially more efficient than querying the status of each returned folder.
- ///
- /// The subfolders.
- /// The status items to pre-populate.
- /// If set to true, only subscribed folders will be listed.
- /// The cancellation token.
- IList GetSubfolders (StatusItems items, bool subscribedOnly = false, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Asynchronously get the subfolders.
- ///
- ///
- /// Asynchronously gets the subfolders as well as queries the server for the status of the requested items.
- /// When the argument is non-empty, this has the equivalent functionality
- /// of calling and then calling
- /// on each of the returned folders.
- ///
- /// The subfolders.
- /// The status items to pre-populate.
- /// If set to true, only subscribed folders will be listed.
- /// The cancellation token.
- Task> GetSubfoldersAsync (StatusItems items, bool subscribedOnly = false, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Get the subfolders.
- ///
- ///
- /// Gets the subfolders.
- ///
- /// The subfolders.
- /// If set to true, only subscribed folders will be listed.
- /// The cancellation token.
- IList GetSubfolders (bool subscribedOnly = false, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Asynchronously get the subfolders.
- ///
- ///
- /// Asynchronously gets the subfolders.
- ///
- /// The subfolders.
- /// If set to true, only subscribed folders will be listed.
- /// The cancellation token.
- Task> GetSubfoldersAsync (bool subscribedOnly = false, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Get the specified subfolder.
- ///
- ///
- /// Gets the specified subfolder.
- ///
- /// The subfolder.
- /// The name of the subfolder.
- /// The cancellation token.
- IMailFolder GetSubfolder (string name, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Asynchronously get the specified subfolder.
- ///
- ///
- /// Asynchronously gets the specified subfolder.
- ///
- /// The subfolder.
- /// The name of the subfolder.
- /// The cancellation token.
- Task GetSubfolderAsync (string name, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Force the server to flush its state for the folder.
- ///
- ///
- /// Forces the server to flush its state for the folder.
- ///
- /// The cancellation token.
- void Check (CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Asynchronously force the server to flush its state for the folder.
- ///
- ///
- /// Asynchronously forces the server to flush its state for the folder.
- ///
- /// An asynchronous task context.
- /// The cancellation token.
- Task CheckAsync (CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Update the values of the specified items.
- ///
- ///
- /// Updates the values of the specified items.
- /// The method
- /// MUST NOT be used on a folder that is already in the opened state. Instead, other ways
- /// of getting the desired information should be used.
- /// For example, a common use for the
- /// method is to get the number of unread messages in the folder. When the folder is open, however, it is
- /// possible to use the
- /// method to query for the list of unread messages.
- ///
- /// The items to update.
- /// The cancellation token.
- void Status (StatusItems items, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Asynchronously update the values of the specified items.
- ///
- ///
- /// Updates the values of the specified items.
- /// The method
- /// MUST NOT be used on a folder that is already in the opened state. Instead, other ways
- /// of getting the desired information should be used.
- /// For example, a common use for the
- /// method is to get the number of unread messages in the folder. When the folder is open, however, it is
- /// possible to use the
- /// method to query for the list of unread messages.
- ///
- /// An asynchronous task context.
- /// The items to update.
- /// The cancellation token.
- Task StatusAsync (StatusItems items, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Get the complete access control list for the folder.
- ///
- ///
- /// Gets the complete access control list for the folder.
- ///
- /// The access control list.
- /// The cancellation token.
- AccessControlList GetAccessControlList (CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Asynchronously get the complete access control list for the folder.
- ///
- ///
- /// Asynchronously gets the complete access control list for the folder.
- ///
- /// The access control list.
- /// The cancellation token.
- Task GetAccessControlListAsync (CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Get the access rights for a particular identifier.
- ///
- ///
- /// Gets the access rights for a particular identifier.
- ///
- /// The access rights.
- /// The identifier name.
- /// The cancellation token.
- AccessRights GetAccessRights (string name, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Asynchronously get the access rights for a particular identifier.
- ///
- ///
- /// Asynchronously gets the access rights for a particular identifier.
- ///
- /// The access rights.
- /// The identifier name.
- /// The cancellation token.
- Task GetAccessRightsAsync (string name, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Get the access rights for the current authenticated user.
- ///
- ///
- /// Gets the access rights for the current authenticated user.
- ///
- /// The access rights.
- /// The cancellation token.
- AccessRights GetMyAccessRights (CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Asynchronously get the access rights for the current authenticated user.
- ///
- ///
- /// Asynchronously gets the access rights for the current authenticated user.
- ///
- /// The access rights.
- /// The cancellation token.
- Task GetMyAccessRightsAsync (CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Add access rights for the specified identity.
- ///
- ///
- /// Adds the given access rights for the specified identity.
- ///
- /// The identity name.
- /// The access rights.
- /// The cancellation token.
- void AddAccessRights (string name, AccessRights rights, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Asynchronously add access rights for the specified identity.
- ///
- ///
- /// Asynchronously adds the given access rights for the specified identity.
- ///
- /// An asynchronous task context.
- /// The identity name.
- /// The access rights.
- /// The cancellation token.
- Task AddAccessRightsAsync (string name, AccessRights rights, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Remove access rights for the specified identity.
- ///
- ///
- /// Removes the given access rights for the specified identity.
- ///
- /// The identity name.
- /// The access rights.
- /// The cancellation token.
- void RemoveAccessRights (string name, AccessRights rights, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Asynchronously remove access rights for the specified identity.
- ///
- ///
- /// Asynchronously removes the given access rights for the specified identity.
- ///
- /// An asynchronous task context.
- /// The identity name.
- /// The access rights.
- /// The cancellation token.
- Task RemoveAccessRightsAsync (string name, AccessRights rights, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Set the access rights for the specified identity.
- ///
- ///
- /// Sets the access rights for the specified identity.
- ///
- /// The identity name.
- /// The access rights.
- /// The cancellation token.
- void SetAccessRights (string name, AccessRights rights, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Asynchronously set the access rights for the sepcified identity.
- ///
- ///
- /// Asynchronously sets the access rights for the specified identity.
- ///
- /// An asynchronous task context.
- /// The identity name.
- /// The access rights.
- /// The cancellation token.
- Task SetAccessRightsAsync (string name, AccessRights rights, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Remove all access rights for the given identity.
- ///
- ///
- /// Removes all access rights for the given identity.
- ///
- /// The identity name.
- /// The cancellation token.
- void RemoveAccess (string name, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Asynchronously remove all access rights for the given identity.
- ///
- ///
- /// Asynchronously removes all access rights for the given identity.
- ///
- /// An asynchronous task context.
- /// The identity name.
- /// The cancellation token.
- Task RemoveAccessAsync (string name, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Get the quota information for the folder.
- ///
- ///
- /// Gets the quota information for the folder.
- /// To determine if a quotas are supported, check the
- /// property.
- ///
- /// The folder quota.
- /// The cancellation token.
- FolderQuota GetQuota (CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Asynchronously get the quota information for the folder.
- ///
- ///
- /// Asynchronously gets the quota information for the folder.
- /// To determine if a quotas are supported, check the
- /// property.
- ///
- /// The folder quota.
- /// The cancellation token.
- Task GetQuotaAsync (CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Set the quota limits for the folder.
- ///
- ///
- /// Sets the quota limits for the folder.
- /// To determine if a quotas are supported, check the
- /// property.
- ///
- /// The updated folder quota.
- /// If not null, sets the maximum number of messages to allow.
- /// If not null, sets the maximum storage size (in kilobytes).
- /// The cancellation token.
- FolderQuota SetQuota (uint? messageLimit, uint? storageLimit, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Asynchronously set the quota limits for the folder.
- ///
- ///
- /// Asynchronously sets the quota limits for the folder.
- /// To determine if a quotas are supported, check the
- /// property.
- ///
- /// The updated folder quota.
- /// If not null, sets the maximum number of messages to allow.
- /// If not null, sets the maximum storage size (in kilobytes).
- /// The cancellation token.
- Task SetQuotaAsync (uint? messageLimit, uint? storageLimit, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Gets the specified metadata.
- ///
- ///
- /// Gets the specified metadata.
- ///
- /// The requested metadata value.
- /// The metadata tag.
- /// The cancellation token.
- string GetMetadata (MetadataTag tag, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Asynchronously gets the specified metadata.
- ///
- ///
- /// Asynchronously gets the specified metadata.
- ///
- /// The requested metadata value.
- /// The metadata tag.
- /// The cancellation token.
- Task GetMetadataAsync (MetadataTag tag, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Gets the specified metadata.
- ///
- ///
- /// Gets the specified metadata.
- ///
- /// The requested metadata.
- /// The metadata tags.
- /// The cancellation token.
- MetadataCollection GetMetadata (IEnumerable tags, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Asynchronously gets the specified metadata.
- ///
- ///
- /// Asynchronously gets the specified metadata.
- ///
- /// The requested metadata.
- /// The metadata tags.
- /// The cancellation token.
- Task GetMetadataAsync (IEnumerable tags, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Gets the specified metadata.
- ///
- ///
- /// Gets the specified metadata.
- ///
- /// The requested metadata.
- /// The metadata options.
- /// The metadata tags.
- /// The cancellation token.
- MetadataCollection GetMetadata (MetadataOptions options, IEnumerable tags, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Asynchronously gets the specified metadata.
- ///
- ///
- /// Asynchronously gets the specified metadata.
- ///
- /// The requested metadata.
- /// The metadata options.
- /// The metadata tags.
- /// The cancellation token.
- Task GetMetadataAsync (MetadataOptions options, IEnumerable tags, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Sets the specified metadata.
- ///
- ///
- /// Sets the specified metadata.
- ///
- /// The metadata.
- /// The cancellation token.
- void SetMetadata (MetadataCollection metadata, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Asynchronously sets the specified metadata.
- ///
- ///
- /// Asynchronously sets the specified metadata.
- ///
- /// An asynchronous task context.
- /// The metadata.
- /// The cancellation token.
- Task SetMetadataAsync (MetadataCollection metadata, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Expunge the folder, permanently removing all messages marked for deletion.
- ///
- ///
- /// Expunges the folder, permanently removing all messages marked for deletion.
- /// Normally, an event will be emitted for each
- /// message that is expunged. However, if the mail store supports the quick
- /// resynchronization feature and it has been enabled via the
- /// method, then
- /// the event will be emitted rather than the
- /// event.
- ///
- /// The cancellation token.
- void Expunge (CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Asynchronously expunge the folder, permanently removing all messages marked for deletion.
- ///
- ///
- /// Asynchronously expunges the folder, permanently removing all messages marked for deletion.
- /// Normally, an event will be emitted for
- /// each message that is expunged. However, if the mail store supports the quick
- /// resynchronization feature and it has been enabled via the
- /// method, then
- /// the event will be emitted rather than the
- /// event.
- ///
- /// An asynchronous task context.
- /// The cancellation token.
- Task ExpungeAsync (CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Expunge the specified uids, permanently removing them from the folder.
- ///
- ///
- /// Expunges the specified uids, permanently removing them from the folder.
- /// Normally, an event will be emitted for
- /// each message that is expunged. However, if the mail store supports the quick
- /// resynchronization feature and it has been enabled via the
- /// method, then
- /// the event will be emitted rather than the
- /// event.
- ///
- /// The message uids.
- /// The cancellation token.
- void Expunge (IList uids, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Asynchronously expunge the specified uids, permanently removing them from the folder.
- ///
- ///
- /// Asynchronously expunges the specified uids, permanently removing them from the folder.
- /// Normally, an event will be emitted for
- /// each message that is expunged. However, if the mail store supports the quick
- /// resynchronization feature and it has been enabled via the
- /// method, then
- /// the event will be emitted rather than the
- /// event.
- ///
- /// An asynchronous task context.
- /// The message uids.
- /// The cancellation token.
- Task ExpungeAsync (IList uids, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Append the specified message to the folder.
- ///
- ///
- /// Appends the specified message to the folder and returns the UniqueId assigned to the message.
- ///
- /// The UID of the appended message, if available; otherwise, null.
- /// The message.
- /// The message flags.
- /// The cancellation token.
- /// The progress reporting mechanism.
- UniqueId? Append (MimeMessage message, MessageFlags flags = MessageFlags.None, CancellationToken cancellationToken = default (CancellationToken), ITransferProgress progress = null);
-
- ///
- /// Asynchronously append the specified message to the folder.
- ///
- ///
- /// Asynchronously appends the specified message to the folder and returns the UniqueId assigned to the message.
- ///
- /// The UID of the appended message, if available; otherwise, null.
- /// The message.
- /// The message flags.
- /// The cancellation token.
- /// The progress reporting mechanism.
- Task AppendAsync (MimeMessage message, MessageFlags flags = MessageFlags.None, CancellationToken cancellationToken = default (CancellationToken), ITransferProgress progress = null);
-
- ///
- /// Append the specified message to the folder.
- ///
- ///
- /// Appends the specified message to the folder and returns the UniqueId assigned to the message.
- ///
- /// The UID of the appended message, if available; otherwise, null.
- /// The message.
- /// The message flags.
- /// The received date of the message.
- /// The cancellation token.
- /// The progress reporting mechanism.
- UniqueId? Append (MimeMessage message, MessageFlags flags, DateTimeOffset date, CancellationToken cancellationToken = default (CancellationToken), ITransferProgress progress = null);
-
- ///
- /// Asynchronously append the specified message to the folder.
- ///
- ///
- /// Asynchronously appends the specified message to the folder and returns the UniqueId assigned to the message.
- ///
- /// The UID of the appended message, if available; otherwise, null.
- /// The message.
- /// The message flags.
- /// The received date of the message.
- /// The cancellation token.
- /// The progress reporting mechanism.
- Task AppendAsync (MimeMessage message, MessageFlags flags, DateTimeOffset date, CancellationToken cancellationToken = default (CancellationToken), ITransferProgress progress = null);
-
- ///
- /// Append the specified message to the folder.
- ///
- ///
- /// Appends the specified message to the folder and returns the UniqueId assigned to the message.
- ///
- /// The UID of the appended message, if available; otherwise, null.
- /// The message.
- /// The message flags.
- /// The received date of the message.
- /// The message annotations.
- /// The cancellation token.
- /// The progress reporting mechanism.
- UniqueId? Append (MimeMessage message, MessageFlags flags, DateTimeOffset? date, IList annotations, CancellationToken cancellationToken = default (CancellationToken), ITransferProgress progress = null);
-
- ///
- /// Asynchronously append the specified message to the folder.
- ///
- ///
- /// Asynchronously appends the specified message to the folder and returns the UniqueId assigned to the message.
- ///
- /// The UID of the appended message, if available; otherwise, null.
- /// The message.
- /// The message flags.
- /// The received date of the message.
- /// The message annotations.
- /// The cancellation token.
- /// The progress reporting mechanism.
- Task AppendAsync (MimeMessage message, MessageFlags flags, DateTimeOffset? date, IList annotations, CancellationToken cancellationToken = default (CancellationToken), ITransferProgress progress = null);
-
- ///
- /// Append the specified message to the folder.
- ///
- ///
- /// Appends the specified message to the folder and returns the UniqueId assigned to the message.
- ///
- /// The UID of the appended message, if available; otherwise, null.
- /// The formatting options.
- /// The message.
- /// The message flags.
- /// The cancellation token.
- /// The progress reporting mechanism.
- UniqueId? Append (FormatOptions options, MimeMessage message, MessageFlags flags = MessageFlags.None, CancellationToken cancellationToken = default (CancellationToken), ITransferProgress progress = null);
-
- ///
- /// Asynchronously append the specified message to the folder.
- ///
- ///
- /// Asynchronously appends the specified message to the folder and returns the UniqueId assigned to the message.
- ///
- /// The UID of the appended message, if available; otherwise, null.
- /// The formatting options.
- /// The message.
- /// The message flags.
- /// The cancellation token.
- /// The progress reporting mechanism.
- Task AppendAsync (FormatOptions options, MimeMessage message, MessageFlags flags = MessageFlags.None, CancellationToken cancellationToken = default (CancellationToken), ITransferProgress progress = null);
-
- ///
- /// Append the specified message to the folder.
- ///
- ///
- /// Appends the specified message to the folder and returns the UniqueId assigned to the message.
- ///
- /// The UID of the appended message, if available; otherwise, null.
- /// The formatting options.
- /// The message.
- /// The message flags.
- /// The received date of the message.
- /// The cancellation token.
- /// The progress reporting mechanism.
- UniqueId? Append (FormatOptions options, MimeMessage message, MessageFlags flags, DateTimeOffset date, CancellationToken cancellationToken = default (CancellationToken), ITransferProgress progress = null);
-
- ///
- /// Asynchronously append the specified message to the folder.
- ///
- ///
- /// Asynchronously appends the specified message to the folder and returns the UniqueId assigned to the message.
- ///
- /// The UID of the appended message, if available; otherwise, null.
- /// The formatting options.
- /// The message.
- /// The message flags.
- /// The received date of the message.
- /// The cancellation token.
- /// The progress reporting mechanism.
- Task AppendAsync (FormatOptions options, MimeMessage message, MessageFlags flags, DateTimeOffset date, CancellationToken cancellationToken = default (CancellationToken), ITransferProgress progress = null);
-
- ///
- /// Append the specified message to the folder.
- ///
- ///
- /// Appends the specified message to the folder and returns the UniqueId assigned to the message.
- ///
- /// The UID of the appended message, if available; otherwise, null.
- /// The formatting options.
- /// The message.
- /// The message flags.
- /// The received date of the message.
- /// The message annotations.
- /// The cancellation token.
- /// The progress reporting mechanism.
- UniqueId? Append (FormatOptions options, MimeMessage message, MessageFlags flags, DateTimeOffset? date, IList annotations, CancellationToken cancellationToken = default (CancellationToken), ITransferProgress progress = null);
-
- ///
- /// Asynchronously append the specified message to the folder.
- ///
- ///
- /// Asynchronously appends the specified message to the folder and returns the UniqueId assigned to the message.
- ///
- /// The UID of the appended message, if available; otherwise, null.
- /// The formatting options.
- /// The message.
- /// The message flags.
- /// The received date of the message.
- /// The message annotations.
- /// The cancellation token.
- /// The progress reporting mechanism.
- Task AppendAsync (FormatOptions options, MimeMessage message, MessageFlags flags, DateTimeOffset? date, IList annotations, CancellationToken cancellationToken = default (CancellationToken), ITransferProgress progress = null);
-
- ///
- /// Append the specified messages to the folder.
- ///
- ///
- /// Appends the specified messages to the folder and returns the UniqueIds assigned to the messages.
- ///
- /// The UIDs of the appended messages, if available; otherwise an empty array.
- /// The list of messages to append to the folder.
- /// The message flags to use for each message.
- /// The cancellation token.
- /// The progress reporting mechanism.
- IList Append (IList messages, IList flags, CancellationToken cancellationToken = default (CancellationToken), ITransferProgress progress = null);
-
- ///
- /// Asynchronously append the specified messages to the folder.
- ///
- ///
- /// Asynchronously appends the specified messages to the folder and returns the UniqueIds assigned to the messages.
- ///
- /// The UIDs of the appended messages, if available; otherwise an empty array.
- /// The list of messages to append to the folder.
- /// The message flags to use for each message.
- /// The cancellation token.
- /// The progress reporting mechanism.
- Task> AppendAsync (IList messages, IList flags, CancellationToken cancellationToken = default (CancellationToken), ITransferProgress progress = null);
-
- ///
- /// Append the specified messages to the folder.
- ///
- ///
- /// Appends the specified messages to the folder and returns the UniqueIds assigned to the messages.
- ///
- /// The UIDs of the appended messages, if available; otherwise an empty array.
- /// The list of messages to append to the folder.
- /// The message flags to use for each of the messages.
- /// The received dates to use for each of the messages.
- /// The cancellation token.
- /// The progress reporting mechanism.
- IList Append (IList messages, IList flags, IList dates, CancellationToken cancellationToken = default (CancellationToken), ITransferProgress progress = null);
-
- ///
- /// Asynchronously append the specified messages to the folder.
- ///
- ///
- /// Asynchronously appends the specified messages to the folder and returns the UniqueIds assigned to the messages.
- ///
- /// The UIDs of the appended messages, if available; otherwise an empty array.
- /// The list of messages to append to the folder.
- /// The message flags to use for each of the messages.
- /// The received dates to use for each of the messages.
- /// The cancellation token.
- /// The progress reporting mechanism.
- Task> AppendAsync (IList messages, IList flags, IList dates, CancellationToken cancellationToken = default (CancellationToken), ITransferProgress progress = null);
-
- ///
- /// Append the specified messages to the folder.
- ///
- ///
- /// Appends the specified messages to the folder and returns the UniqueIds assigned to the messages.
- ///
- /// The UIDs of the appended messages, if available; otherwise an empty array.
- /// The formatting options.
- /// The list of messages to append to the folder.
- /// The message flags to use for each message.
- /// The cancellation token.
- /// The progress reporting mechanism.
- IList Append (FormatOptions options, IList messages, IList flags, CancellationToken cancellationToken = default (CancellationToken), ITransferProgress progress = null);
-
- ///
- /// Asynchronously append the specified messages to the folder.
- ///
- ///
- /// Asynchronously appends the specified messages to the folder and returns the UniqueIds assigned to the messages.
- ///
- /// The UIDs of the appended messages, if available; otherwise an empty array.
- /// The formatting options.
- /// The list of messages to append to the folder.
- /// The message flags to use for each message.
- /// The cancellation token.
- /// The progress reporting mechanism.
- Task> AppendAsync (FormatOptions options, IList messages, IList flags, CancellationToken cancellationToken = default (CancellationToken), ITransferProgress progress = null);
-
- ///
- /// Append the specified messages to the folder.
- ///
- ///
- /// Appends the specified messages to the folder and returns the UniqueIds assigned to the messages.
- ///
- /// The UIDs of the appended messages, if available; otherwise an empty array.
- /// The formatting options.
- /// The list of messages to append to the folder.
- /// The message flags to use for each of the messages.
- /// The received dates to use for each of the messages.
- /// The cancellation token.
- /// The progress reporting mechanism.
- IList Append (FormatOptions options, IList messages, IList flags, IList dates, CancellationToken cancellationToken = default (CancellationToken), ITransferProgress progress = null);
-
- ///
- /// Asynchronously append the specified messages to the folder.
- ///
- ///
- /// Asynchronously appends the specified messages to the folder and returns the UniqueIds assigned to the messages.
- ///
- /// The UIDs of the appended messages, if available; otherwise an empty array.
- /// The formatting options.
- /// The list of messages to append to the folder.
- /// The message flags to use for each of the messages.
- /// The received dates to use for each of the messages.
- /// The cancellation token.
- /// The progress reporting mechanism.
- Task> AppendAsync (FormatOptions options, IList messages, IList flags, IList dates, CancellationToken cancellationToken = default (CancellationToken), ITransferProgress progress = null);
-
- ///
- /// Replace a message in the folder.
- ///
- ///
- /// Replaces the specified message in the folder and returns the UniqueId assigned to the new message.
- ///
- /// The UID of the new message, if available; otherwise, null.
- /// The UID of the message to be replaced.
- /// The message.
- /// The message flags.
- /// The cancellation token.
- /// The progress reporting mechanism.
- UniqueId? Replace (UniqueId uid, MimeMessage message, MessageFlags flags = MessageFlags.None, CancellationToken cancellationToken = default (CancellationToken), ITransferProgress progress = null);
-
- ///
- /// Asynchronously replace a message in the folder.
- ///
- ///
- /// Replaces the specified message in the folder and returns the UniqueId assigned to the new message.
- ///
- /// The UID of the new message, if available; otherwise, null.
- /// The UID of the message to be replaced.
- /// The message.
- /// The message flags.
- /// The cancellation token.
- /// The progress reporting mechanism.
- Task ReplaceAsync (UniqueId uid, MimeMessage message, MessageFlags flags = MessageFlags.None, CancellationToken cancellationToken = default (CancellationToken), ITransferProgress progress = null);
-
- ///
- /// Replace a message in the folder.
- ///
- ///
- /// Replaces the specified message in the folder and returns the UniqueId assigned to the new message.
- ///
- /// The UID of the new message, if available; otherwise, null.
- /// The UID of the message to be replaced.
- /// The message.
- /// The message flags.
- /// The received date of the message.
- /// The cancellation token.
- /// The progress reporting mechanism.
- UniqueId? Replace (UniqueId uid, MimeMessage message, MessageFlags flags, DateTimeOffset date, CancellationToken cancellationToken = default (CancellationToken), ITransferProgress progress = null);
-
- ///
- /// Asynchronously replace a message in the folder.
- ///
- ///
- /// Replaces the specified message in the folder and returns the UniqueId assigned to the new message.
- ///
- /// The UID of the new message, if available; otherwise, null.
- /// The UID of the message to be replaced.
- /// The message.
- /// The message flags.
- /// The received date of the message.
- /// The cancellation token.
- /// The progress reporting mechanism.
- Task ReplaceAsync (UniqueId uid, MimeMessage message, MessageFlags flags, DateTimeOffset date, CancellationToken cancellationToken = default (CancellationToken), ITransferProgress progress = null);
-
- ///
- /// Replace a message in the folder.
- ///
- ///
- /// Replaces the specified message in the folder and returns the UniqueId assigned to the new message.
- ///
- /// The UID of the new message, if available; otherwise, null.
- /// The formatting options.
- /// The UID of the message to be replaced.
- /// The message.
- /// The message flags.
- /// The cancellation token.
- /// The progress reporting mechanism.
- UniqueId? Replace (FormatOptions options, UniqueId uid, MimeMessage message, MessageFlags flags = MessageFlags.None, CancellationToken cancellationToken = default (CancellationToken), ITransferProgress progress = null);
-
- ///
- /// Asynchronously replace a message in the folder.
- ///
- ///
- /// Replaces the specified message in the folder and returns the UniqueId assigned to the new message.
- ///
- /// The UID of the new message, if available; otherwise, null.
- /// The formatting options.
- /// The UID of the message to be replaced.
- /// The message.
- /// The message flags.
- /// The cancellation token.
- /// The progress reporting mechanism.
- Task ReplaceAsync (FormatOptions options, UniqueId uid, MimeMessage message, MessageFlags flags = MessageFlags.None, CancellationToken cancellationToken = default (CancellationToken), ITransferProgress progress = null);
-
- ///
- /// Replace a message in the folder.
- ///
- ///
- /// Replaces the specified message in the folder and returns the UniqueId assigned to the new message.
- ///
- /// The UID of the new message, if available; otherwise, null.
- /// The formatting options.
- /// The UID of the message to be replaced.
- /// The message.
- /// The message flags.
- /// The received date of the message.
- /// The cancellation token.
- /// The progress reporting mechanism.
- UniqueId? Replace (FormatOptions options, UniqueId uid, MimeMessage message, MessageFlags flags, DateTimeOffset date, CancellationToken cancellationToken = default (CancellationToken), ITransferProgress progress = null);
-
- ///
- /// Asynchronously replace a message in the folder.
- ///
- ///
- /// Replaces the specified message in the folder and returns the UniqueId assigned to the new message.
- ///
- /// The UID of the new message, if available; otherwise, null.
- /// The formatting options.
- /// The UID of the message to be replaced.
- /// The message.
- /// The message flags.
- /// The received date of the message.
- /// The cancellation token.
- /// The progress reporting mechanism.
- Task ReplaceAsync (FormatOptions options, UniqueId uid, MimeMessage message, MessageFlags flags, DateTimeOffset date, CancellationToken cancellationToken = default (CancellationToken), ITransferProgress progress = null);
-
- ///
- /// Replace a message in the folder.
- ///
- ///
- /// Replaces the specified message in the folder and returns the UniqueId assigned to the new message.
- ///
- /// The UID of the new message, if available; otherwise, null.
- /// The index of the message to be replaced.
- /// The message.
- /// The message flags.
- /// The cancellation token.
- /// The progress reporting mechanism.
- UniqueId? Replace (int index, MimeMessage message, MessageFlags flags = MessageFlags.None, CancellationToken cancellationToken = default (CancellationToken), ITransferProgress progress = null);
-
- ///
- /// Asynchronously replace a message in the folder.
- ///
- ///
- /// Replaces the specified message in the folder and returns the UniqueId assigned to the new message.
- ///
- /// The UID of the new message, if available; otherwise, null.
- /// The index of the message to be replaced.
- /// The message.
- /// The message flags.
- /// The cancellation token.
- /// The progress reporting mechanism.;
- Task ReplaceAsync (int index, MimeMessage message, MessageFlags flags = MessageFlags.None, CancellationToken cancellationToken = default (CancellationToken), ITransferProgress progress = null);
-
- ///
- /// Replace a message in the folder.
- ///
- ///
- /// Replaces the specified message in the folder and returns the UniqueId assigned to the new message.
- ///
- /// The UID of the new message, if available; otherwise, null.
- /// The index of the message to be replaced.
- /// The message.
- /// The message flags.
- /// The received date of the message.
- /// The cancellation token.
- /// The progress reporting mechanism.
- UniqueId? Replace (int index, MimeMessage message, MessageFlags flags, DateTimeOffset date, CancellationToken cancellationToken = default (CancellationToken), ITransferProgress progress = null);
-
- ///
- /// Asynchronously replace a message in the folder.
- ///
- ///
- /// Replaces the specified message in the folder and returns the UniqueId assigned to the new message.
- ///
- /// The UID of the new message, if available; otherwise, null.
- /// The index of the message to be replaced.
- /// The message.
- /// The message flags.
- /// The received date of the message.
- /// The cancellation token.
- /// The progress reporting mechanism.
- Task ReplaceAsync (int index, MimeMessage message, MessageFlags flags, DateTimeOffset date, CancellationToken cancellationToken = default (CancellationToken), ITransferProgress progress = null);
-
- ///
- /// Replace a message in the folder.
- ///
- ///
- /// Replaces the specified message in the folder and returns the UniqueId assigned to the new message.
- ///
- /// The UID of the new message, if available; otherwise, null.
- /// The formatting options.
- /// The index of the message to be replaced.
- /// The message.
- /// The message flags.
- /// The cancellation token.
- /// The progress reporting mechanism.
- UniqueId? Replace (FormatOptions options, int index, MimeMessage message, MessageFlags flags = MessageFlags.None, CancellationToken cancellationToken = default (CancellationToken), ITransferProgress progress = null);
-
- ///
- /// Asynchronously replace a message in the folder.
- ///
- ///
- /// Replaces the specified message in the folder and returns the UniqueId assigned to the new message.
- ///
- /// The UID of the new message, if available; otherwise, null.
- /// The formatting options.
- /// The index of the message to be replaced.
- /// The message.
- /// The message flags.
- /// The cancellation token.
- /// The progress reporting mechanism.
- Task ReplaceAsync (FormatOptions options, int index, MimeMessage message, MessageFlags flags = MessageFlags.None, CancellationToken cancellationToken = default (CancellationToken), ITransferProgress progress = null);
-
- ///
- /// Replace a message in the folder.
- ///
- ///
- /// Replaces the specified message in the folder and returns the UniqueId assigned to the new message.
- ///
- /// The UID of the new message, if available; otherwise, null.
- /// The formatting options.
- /// The index of the message to be replaced.
- /// The message.
- /// The message flags.
- /// The received date of the message.
- /// The cancellation token.
- /// The progress reporting mechanism.
- UniqueId? Replace (FormatOptions options, int index, MimeMessage message, MessageFlags flags, DateTimeOffset date, CancellationToken cancellationToken = default (CancellationToken), ITransferProgress progress = null);
-
- ///
- /// Asynchronously replace a message in the folder.
- ///
- ///
- /// Replaces the specified message in the folder and returns the UniqueId assigned to the new message.
- ///
- /// The UID of the new message, if available; otherwise, null.
- /// The formatting options.
- /// The index of the message to be replaced.
- /// The message.
- /// The message flags.
- /// The received date of the message.
- /// The cancellation token.
- /// The progress reporting mechanism.
- Task ReplaceAsync (FormatOptions options, int index, MimeMessage message, MessageFlags flags, DateTimeOffset date, CancellationToken cancellationToken = default (CancellationToken), ITransferProgress progress = null);
-
- ///
- /// Copy the specified message to the destination folder.
- ///
- ///
- /// Copies the specified message to the destination folder.
- ///
- /// The UID of the message in the destination folder, if available; otherwise, null.
- /// The UID of the message to copy.
- /// The destination folder.
- /// The cancellation token.
- UniqueId? CopyTo (UniqueId uid, IMailFolder destination, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Asynchronously copy the specified message to the destination folder.
- ///
- ///
- /// Asynchronously copies the specified message to the destination folder.
- ///
- /// The UID of the message in the destination folder, if available; otherwise, null.
- /// The UID of the message to copy.
- /// The destination folder.
- /// The cancellation token.
- Task CopyToAsync (UniqueId uid, IMailFolder destination, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Copy the specified messages to the destination folder.
- ///
- ///
- /// Copies the specified messages to the destination folder.
- ///
- /// The UID mapping of the messages in the destination folder, if available; otherwise an empty mapping.
- /// The UIDs of the messages to copy.
- /// The destination folder.
- /// The cancellation token.
- UniqueIdMap CopyTo (IList uids, IMailFolder destination, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Asynchronously copy the specified messages to the destination folder.
- ///
- ///
- /// Asynchronously copies the specified messages to the destination folder.
- ///
- /// The UID mapping of the messages in the destination folder, if available; otherwise an empty mapping.
- /// The UIDs of the messages to copy.
- /// The destination folder.
- /// The cancellation token.
- Task CopyToAsync (IList uids, IMailFolder destination, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Move the specified message to the destination folder.
- ///
- ///
- /// Moves the specified message to the destination folder.
- ///
- /// The UID of the message in the destination folder, if available; otherwise, null.
- /// The UID of the message to move.
- /// The destination folder.
- /// The cancellation token.
- UniqueId? MoveTo (UniqueId uid, IMailFolder destination, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Asynchronously move the specified message to the destination folder.
- ///
- ///
- /// Asynchronously moves the specified message to the destination folder.
- ///
- /// The UID of the message in the destination folder, if available; otherwise, null.
- /// The UID of the message to move.
- /// The destination folder.
- /// The cancellation token.
- Task MoveToAsync (UniqueId uid, IMailFolder destination, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Move the specified messages to the destination folder.
- ///
- ///
- /// Moves the specified messages to the destination folder.
- ///
- /// The UID mapping of the messages in the destination folder, if available; otherwise an empty mapping.
- /// The UIDs of the messages to copy.
- /// The destination folder.
- /// The cancellation token.
- UniqueIdMap MoveTo (IList uids, IMailFolder destination, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Asynchronously move the specified messages to the destination folder.
- ///
- ///
- /// Asynchronously moves the specified messages to the destination folder.
- ///
- /// The UID mapping of the messages in the destination folder, if available; otherwise an empty mapping.
- /// The UIDs of the messages to copy.
- /// The destination folder.
- /// The cancellation token.
- Task MoveToAsync (IList uids, IMailFolder destination, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Copy the specified message to the destination folder.
- ///
- ///
- /// Copies the specified message to the destination folder.
- ///
- /// The index of the message to copy.
- /// The destination folder.
- /// The cancellation token.
- void CopyTo (int index, IMailFolder destination, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Asynchronously copy the specified message to the destination folder.
- ///
- ///
- /// Asynchronously copies the specified message to the destination folder.
- ///
- /// An asynchronous task context.
- /// The indexes of the message to copy.
- /// The destination folder.
- /// The cancellation token.
- Task CopyToAsync (int index, IMailFolder destination, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Copy the specified messages to the destination folder.
- ///
- ///
- /// Copies the specified messages to the destination folder.
- ///
- /// The indexes of the messages to copy.
- /// The destination folder.
- /// The cancellation token.
- void CopyTo (IList indexes, IMailFolder destination, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Asynchronously copy the specified messages to the destination folder.
- ///
- ///
- /// Asynchronously copies the specified messages to the destination folder.
- ///
- /// An asynchronous task context.
- /// The indexes of the messages to copy.
- /// The destination folder.
- /// The cancellation token.
- Task CopyToAsync (IList indexes, IMailFolder destination, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Move the specified message to the destination folder.
- ///
- ///
- /// Moves the specified message to the destination folder.
- ///
- /// The index of the message to move.
- /// The destination folder.
- /// The cancellation token.
- void MoveTo (int index, IMailFolder destination, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Asynchronously move the specified message to the destination folder.
- ///
- ///
- /// Asynchronously moves the specified message to the destination folder.
- ///
- /// An asynchronous task context.
- /// The index of the message to move.
- /// The destination folder.
- /// The cancellation token.
- Task MoveToAsync (int index, IMailFolder destination, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Move the specified messages to the destination folder.
- ///
- ///
- /// Moves the specified messages to the destination folder.
- ///
- /// The indexes of the messages to move.
- /// The destination folder.
- /// The cancellation token.
- void MoveTo (IList indexes, IMailFolder destination, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Asynchronously move the specified messages to the destination folder.
- ///
- ///
- /// Asynchronously moves the specified messages to the destination folder.
- ///
- /// An asynchronous task context.
- /// The indexes of the messages to move.
- /// The destination folder.
- /// The cancellation token.
- Task MoveToAsync (IList indexes, IMailFolder destination, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Fetch the message summaries for the specified message UIDs.
- ///
- ///
- /// Fetches the message summaries for the specified message UIDs.
- /// It should be noted that if another client has modified any message
- /// in the folder, the mail service may choose to return information that was
- /// not explicitly requested. It is therefore important to be prepared to
- /// handle both additional fields on a for
- /// messages that were requested as well as summaries for messages that were
- /// not requested at all.
- ///
- ///
- ///
- ///
- /// An enumeration of summaries for the requested messages.
- /// The UIDs.
- /// The message summary items to fetch.
- /// The cancellation token.
- IList Fetch (IList uids, MessageSummaryItems items, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Asynchronously fetch the message summaries for the specified message UIDs.
- ///
- ///
- /// Asynchronously fetches the message summaries for the specified message
- /// UIDs.
- /// It should be noted that if another client has modified any message
- /// in the folder, the mail service may choose to return information that was
- /// not explicitly requested. It is therefore important to be prepared to
- /// handle both additional fields on a for
- /// messages that were requested as well as summaries for messages that were
- /// not requested at all.
- ///
- /// An enumeration of summaries for the requested messages.
- /// The UIDs.
- /// The message summary items to fetch.
- /// The cancellation token.
- Task> FetchAsync (IList uids, MessageSummaryItems items, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Fetch the message summaries for the specified message UIDs.
- ///
- ///
- /// Fetches the message summaries for the specified message UIDs.
- /// It should be noted that if another client has modified any message
- /// in the folder, the mail service may choose to return information that was
- /// not explicitly requested. It is therefore important to be prepared to
- /// handle both additional fields on a for
- /// messages that were requested as well as summaries for messages that were
- /// not requested at all.
- ///
- /// An enumeration of summaries for the requested messages.
- /// The UIDs.
- /// The message summary items to fetch.
- /// The desired header fields.
- /// The cancellation token.
- IList Fetch (IList uids, MessageSummaryItems items, IEnumerable headers, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Asynchronously fetch the message summaries for the specified message UIDs.
- ///
- ///
- /// Asynchronously fetches the message summaries for the specified message
- /// UIDs.
- /// It should be noted that if another client has modified any message
- /// in the folder, the mail service may choose to return information that was
- /// not explicitly requested. It is therefore important to be prepared to
- /// handle both additional fields on a for
- /// messages that were requested as well as summaries for messages that were
- /// not requested at all.
- ///
- /// An enumeration of summaries for the requested messages.
- /// The UIDs.
- /// The message summary items to fetch.
- /// The desired header fields.
- /// The cancellation token.
- Task> FetchAsync (IList uids, MessageSummaryItems items, IEnumerable headers, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Fetch the message summaries for the specified message UIDs.
- ///
- ///
- /// Fetches the message summaries for the specified message UIDs.
- /// It should be noted that if another client has modified any message
- /// in the folder, the mail service may choose to return information that was
- /// not explicitly requested. It is therefore important to be prepared to
- /// handle both additional fields on a for
- /// messages that were requested as well as summaries for messages that were
- /// not requested at all.
- ///
- /// An enumeration of summaries for the requested messages.
- /// The UIDs.
- /// The message summary items to fetch.
- /// The desired header fields.
- /// The cancellation token.
- IList Fetch (IList uids, MessageSummaryItems items, IEnumerable headers, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Asynchronously fetch the message summaries for the specified message UIDs.
- ///
- ///
- /// Asynchronously fetches the message summaries for the specified message
- /// UIDs.
- /// It should be noted that if another client has modified any message
- /// in the folder, the mail service may choose to return information that was
- /// not explicitly requested. It is therefore important to be prepared to
- /// handle both additional fields on a for
- /// messages that were requested as well as summaries for messages that were
- /// not requested at all.
- ///
- /// An enumeration of summaries for the requested messages.
- /// The UIDs.
- /// The message summary items to fetch.
- /// The desired header fields.
- /// The cancellation token.
- Task> FetchAsync (IList uids, MessageSummaryItems items, IEnumerable headers, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Fetch the message summaries for the specified message UIDs that have a
- /// higher mod-sequence value than the one specified.
- ///
- ///
- /// Fetches the message summaries for the specified message UIDs that
- /// have a higher mod-sequence value than the one specified.
- /// If the mail store supports quick resynchronization and the application has
- /// enabled this feature via ,
- /// then this method will emit events for messages that
- /// have vanished since the specified mod-sequence value.
- /// It should be noted that if another client has modified any message
- /// in the folder, the mail service may choose to return information that was
- /// not explicitly requested. It is therefore important to be prepared to
- /// handle both additional fields on a for
- /// messages that were requested as well as summaries for messages that were
- /// not requested at all.
- ///
- /// An enumeration of summaries for the requested messages.
- /// The UIDs.
- /// The mod-sequence value.
- /// The message summary items to fetch.
- /// The cancellation token.
- IList Fetch (IList uids, ulong modseq, MessageSummaryItems items, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Asynchronously fetch the message summaries for the specified message UIDs that have a
- /// higher mod-sequence value than the one specified.
- ///
- ///
- /// Asynchronously fetches the message summaries for the specified message UIDs that
- /// have a higher mod-sequence value than the one specified.
- /// If the mail store supports quick resynchronization and the application has
- /// enabled this feature via ,
- /// then this method will emit events for messages that
- /// have vanished since the specified mod-sequence value.
- /// It should be noted that if another client has modified any message
- /// in the folder, the mail service may choose to return information that was
- /// not explicitly requested. It is therefore important to be prepared to
- /// handle both additional fields on a for
- /// messages that were requested as well as summaries for messages that were
- /// not requested at all.
- ///
- /// An enumeration of summaries for the requested messages.
- /// The UIDs.
- /// The mod-sequence value.
- /// The message summary items to fetch.
- /// The cancellation token.
- Task> FetchAsync (IList uids, ulong modseq, MessageSummaryItems items, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Fetch the message summaries for the specified message UIDs that have a
- /// higher mod-sequence value than the one specified.
- ///
- ///
- /// Fetches the message summaries for the specified message UIDs that
- /// have a higher mod-sequence value than the one specified.
- /// If the mail store supports quick resynchronization and the application has
- /// enabled this feature via ,
- /// then this method will emit events for messages that
- /// have vanished since the specified mod-sequence value.
- /// It should be noted that if another client has modified any message
- /// in the folder, the mail service may choose to return information that was
- /// not explicitly requested. It is therefore important to be prepared to
- /// handle both additional fields on a for
- /// messages that were requested as well as summaries for messages that were
- /// not requested at all.
- ///
- /// An enumeration of summaries for the requested messages.
- /// The UIDs.
- /// The mod-sequence value.
- /// The message summary items to fetch.
- /// The desired header fields.
- /// The cancellation token.
- IList Fetch (IList uids, ulong modseq, MessageSummaryItems items, IEnumerable headers, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Asynchronously fetch the message summaries for the specified message UIDs that have a
- /// higher mod-sequence value than the one specified.
- ///
- ///
- /// Asynchronously fetches the message summaries for the specified message UIDs that
- /// have a higher mod-sequence value than the one specified.
- /// If the mail store supports quick resynchronization and the application has
- /// enabled this feature via ,
- /// then this method will emit events for messages that
- /// have vanished since the specified mod-sequence value.
- /// It should be noted that if another client has modified any message
- /// in the folder, the mail service may choose to return information that was
- /// not explicitly requested. It is therefore important to be prepared to
- /// handle both additional fields on a for
- /// messages that were requested as well as summaries for messages that were
- /// not requested at all.
- ///
- /// An enumeration of summaries for the requested messages.
- /// The UIDs.
- /// The mod-sequence value.
- /// The message summary items to fetch.
- /// The desired header fields.
- /// The cancellation token.
- Task> FetchAsync (IList uids, ulong modseq, MessageSummaryItems items, IEnumerable headers, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Fetch the message summaries for the specified message UIDs that have a
- /// higher mod-sequence value than the one specified.
- ///
- ///
- /// Fetches the message summaries for the specified message UIDs that
- /// have a higher mod-sequence value than the one specified.
- /// If the mail store supports quick resynchronization and the application has
- /// enabled this feature via ,
- /// then this method will emit events for messages that
- /// have vanished since the specified mod-sequence value.
- /// It should be noted that if another client has modified any message
- /// in the folder, the mail service may choose to return information that was
- /// not explicitly requested. It is therefore important to be prepared to
- /// handle both additional fields on a for
- /// messages that were requested as well as summaries for messages that were
- /// not requested at all.
- ///
- /// An enumeration of summaries for the requested messages.
- /// The UIDs.
- /// The mod-sequence value.
- /// The message summary items to fetch.
- /// The desired header fields.
- /// The cancellation token.
- IList Fetch (IList uids, ulong modseq, MessageSummaryItems items, IEnumerable headers, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Asynchronously fetch the message summaries for the specified message UIDs that have a
- /// higher mod-sequence value than the one specified.
- ///
- ///
- /// Asynchronously fetches the message summaries for the specified message UIDs that
- /// have a higher mod-sequence value than the one specified.
- /// If the mail store supports quick resynchronization and the application has
- /// enabled this feature via ,
- /// then this method will emit events for messages that
- /// have vanished since the specified mod-sequence value.
- /// It should be noted that if another client has modified any message
- /// in the folder, the mail service may choose to return information that was
- /// not explicitly requested. It is therefore important to be prepared to
- /// handle both additional fields on a for
- /// messages that were requested as well as summaries for messages that were
- /// not requested at all.
- ///
- /// An enumeration of summaries for the requested messages.
- /// The UIDs.
- /// The mod-sequence value.
- /// The message summary items to fetch.
- /// The desired header fields.
- /// The cancellation token.
- Task> FetchAsync (IList uids, ulong modseq, MessageSummaryItems items, IEnumerable headers, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Fetch the message summaries for the specified message indexes.
- ///
- ///
- /// Fetches the message summaries for the specified message indexes.
- /// It should be noted that if another client has modified any message
- /// in the folder, the mail service may choose to return information that was
- /// not explicitly requested. It is therefore important to be prepared to
- /// handle both additional fields on a for
- /// messages that were requested as well as summaries for messages that were
- /// not requested at all.
- ///
- /// An enumeration of summaries for the requested messages.
- /// The indexes.
- /// The message summary items to fetch.
- /// The cancellation token.
- IList Fetch (IList indexes, MessageSummaryItems items, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Asynchronously fetch the message summaries for the specified message indexes.
- ///
- ///
- /// Asynchronously fetches the message summaries for the specified message
- /// indexes.
- /// It should be noted that if another client has modified any message
- /// in the folder, the mail service may choose to return information that was
- /// not explicitly requested. It is therefore important to be prepared to
- /// handle both additional fields on a for
- /// messages that were requested as well as summaries for messages that were
- /// not requested at all.
- ///
- /// An enumeration of summaries for the requested messages.
- /// The indexes.
- /// The message summary items to fetch.
- /// The cancellation token.
- Task> FetchAsync (IList indexes, MessageSummaryItems items, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Fetch the message summaries for the specified message indexes.
- ///
- ///
- /// Fetches the message summaries for the specified message indexes.
- /// It should be noted that if another client has modified any message
- /// in the folder, the mail service may choose to return information that was
- /// not explicitly requested. It is therefore important to be prepared to
- /// handle both additional fields on a for
- /// messages that were requested as well as summaries for messages that were
- /// not requested at all.
- ///
- /// An enumeration of summaries for the requested messages.
- /// The indexes.
- /// The message summary items to fetch.
- /// The desired header fields.
- /// The cancellation token.
- IList Fetch (IList indexes, MessageSummaryItems items, IEnumerable headers, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Asynchronously fetch the message summaries for the specified message indexes.
- ///
- ///
- /// Asynchronously fetches the message summaries for the specified message
- /// indexes.
- /// It should be noted that if another client has modified any message
- /// in the folder, the mail service may choose to return information that was
- /// not explicitly requested. It is therefore important to be prepared to
- /// handle both additional fields on a for
- /// messages that were requested as well as summaries for messages that were
- /// not requested at all.
- ///
- /// An enumeration of summaries for the requested messages.
- /// The indexes.
- /// The message summary items to fetch.
- /// The desired header fields.
- /// The cancellation token.
- Task> FetchAsync (IList indexes, MessageSummaryItems items, IEnumerable headers, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Fetch the message summaries for the specified message indexes.
- ///
- ///
- /// Fetches the message summaries for the specified message indexes.
- /// It should be noted that if another client has modified any message
- /// in the folder, the mail service may choose to return information that was
- /// not explicitly requested. It is therefore important to be prepared to
- /// handle both additional fields on a for
- /// messages that were requested as well as summaries for messages that were
- /// not requested at all.
- ///
- /// An enumeration of summaries for the requested messages.
- /// The indexes.
- /// The message summary items to fetch.
- /// The desired header fields.
- /// The cancellation token.
- IList Fetch (IList indexes, MessageSummaryItems items, IEnumerable headers, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Asynchronously fetch the message summaries for the specified message indexes.
- ///
- ///
- /// Asynchronously fetches the message summaries for the specified message
- /// indexes.
- /// It should be noted that if another client has modified any message
- /// in the folder, the mail service may choose to return information that was
- /// not explicitly requested. It is therefore important to be prepared to
- /// handle both additional fields on a for
- /// messages that were requested as well as summaries for messages that were
- /// not requested at all.
- ///
- /// An enumeration of summaries for the requested messages.
- /// The indexes.
- /// The message summary items to fetch.
- /// The desired header fields.
- /// The cancellation token.
- Task> FetchAsync (IList indexes, MessageSummaryItems items, IEnumerable headers, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Fetch the message summaries for the specified message indexes that have a
- /// higher mod-sequence value than the one specified.
- ///
- ///
- /// Fetches the message summaries for the specified message indexes that
- /// have a higher mod-sequence value than the one specified.
- /// It should be noted that if another client has modified any message
- /// in the folder, the mail service may choose to return information that was
- /// not explicitly requested. It is therefore important to be prepared to
- /// handle both additional fields on a for
- /// messages that were requested as well as summaries for messages that were
- /// not requested at all.
- ///
- /// An enumeration of summaries for the requested messages.
- /// The indexes.
- /// The mod-sequence value.
- /// The message summary items to fetch.
- /// The cancellation token.
- IList Fetch (IList indexes, ulong modseq, MessageSummaryItems items, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Asynchronously fetch the message summaries for the specified message indexes that have a
- /// higher mod-sequence value than the one specified.
- ///
- ///
- /// Asynchronously fetches the message summaries for the specified message
- /// indexes that have a higher mod-sequence value than the one specified.
- /// It should be noted that if another client has modified any message
- /// in the folder, the mail service may choose to return information that was
- /// not explicitly requested. It is therefore important to be prepared to
- /// handle both additional fields on a for
- /// messages that were requested as well as summaries for messages that were
- /// not requested at all.
- ///
- /// An enumeration of summaries for the requested messages.
- /// The indexes.
- /// The mod-sequence value.
- /// The message summary items to fetch.
- /// The cancellation token.
- Task> FetchAsync (IList indexes, ulong modseq, MessageSummaryItems items, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Fetch the message summaries for the specified message indexes that have a
- /// higher mod-sequence value than the one specified.
- ///
- ///
- /// Fetches the message summaries for the specified message indexes that
- /// have a higher mod-sequence value than the one specified.
- /// It should be noted that if another client has modified any message
- /// in the folder, the mail service may choose to return information that was
- /// not explicitly requested. It is therefore important to be prepared to
- /// handle both additional fields on a for
- /// messages that were requested as well as summaries for messages that were
- /// not requested at all.
- ///
- /// An enumeration of summaries for the requested messages.
- /// The indexes.
- /// The mod-sequence value.
- /// The message summary items to fetch.
- /// The desired header fields.
- /// The cancellation token.
- IList Fetch (IList indexes, ulong modseq, MessageSummaryItems items, IEnumerable headers, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Asynchronously fetch the message summaries for the specified message indexes
- /// that have a higher mod-sequence value than the one specified.
- ///
- ///
- /// Asynchronously fetches the message summaries for the specified message
- /// indexes that have a higher mod-sequence value than the one specified.
- /// It should be noted that if another client has modified any message
- /// in the folder, the mail service may choose to return information that was
- /// not explicitly requested. It is therefore important to be prepared to
- /// handle both additional fields on a for
- /// messages that were requested as well as summaries for messages that were
- /// not requested at all.
- ///
- /// An enumeration of summaries for the requested messages.
- /// The indexes.
- /// The mod-sequence value.
- /// The message summary items to fetch.
- /// The desired header fields.
- /// The cancellation token.
- Task> FetchAsync (IList indexes, ulong modseq, MessageSummaryItems items, IEnumerable headers, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Fetch the message summaries for the specified message indexes that
- /// have a higher mod-sequence value than the one specified.
- ///
- ///
- /// Fetches the message summaries for the specified message indexes that
- /// have a higher mod-sequence value than the one specified.
- /// It should be noted that if another client has modified any message
- /// in the folder, the mail service may choose to return information that was
- /// not explicitly requested. It is therefore important to be prepared to
- /// handle both additional fields on a for
- /// messages that were requested as well as summaries for messages that were
- /// not requested at all.
- ///
- /// An enumeration of summaries for the requested messages.
- /// The indexes.
- /// The mod-sequence value.
- /// The message summary items to fetch.
- /// The desired header fields.
- /// The cancellation token.
- IList Fetch (IList indexes, ulong modseq, MessageSummaryItems items, IEnumerable headers, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Asynchronously fetch the message summaries for the specified message indexes
- /// that have a higher mod-sequence value than the one specified.
- ///
- ///
- /// Asynchronously fetches the message summaries for the specified message
- /// indexes that have a higher mod-sequence value than the one specified.
- /// It should be noted that if another client has modified any message
- /// in the folder, the mail service may choose to return information that was
- /// not explicitly requested. It is therefore important to be prepared to
- /// handle both additional fields on a for
- /// messages that were requested as well as summaries for messages that were
- /// not requested at all.
- ///
- /// An enumeration of summaries for the requested messages.
- /// The indexes.
- /// The mod-sequence value.
- /// The message summary items to fetch.
- /// The desired header fields.
- /// The cancellation token.
- Task> FetchAsync (IList indexes, ulong modseq, MessageSummaryItems items, IEnumerable headers, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Fetch the message summaries for the messages between the two indexes, inclusive.
- ///
- ///
- /// Fetches the message summaries for the messages between the two
- /// indexes, inclusive.
- /// It should be noted that if another client has modified any message
- /// in the folder, the mail service may choose to return information that was
- /// not explicitly requested. It is therefore important to be prepared to
- /// handle both additional fields on a for
- /// messages that were requested as well as summaries for messages that were
- /// not requested at all.
- ///
- /// An enumeration of summaries for the requested messages.
- /// The minimum index.
- /// The maximum index, or -1 to specify no upper bound.
- /// The message summary items to fetch.
- /// The cancellation token.
- IList Fetch (int min, int max, MessageSummaryItems items, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Asynchronously fetch the message summaries for the messages between the two indexes, inclusive.
- ///
- ///
- /// Asynchronously fetches the message summaries for the messages between
- /// the two indexes, inclusive.
- /// It should be noted that if another client has modified any message
- /// in the folder, the mail service may choose to return information that was
- /// not explicitly requested. It is therefore important to be prepared to
- /// handle both additional fields on a for
- /// messages that were requested as well as summaries for messages that were
- /// not requested at all.
- ///
- /// An enumeration of summaries for the requested messages.
- /// The minimum index.
- /// The maximum index, or -1 to specify no upper bound.
- /// The message summary items to fetch.
- /// The cancellation token.
- Task> FetchAsync (int min, int max, MessageSummaryItems items, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Fetch the message summaries for the messages between the two indexes, inclusive.
- ///
- ///
- /// Fetches the message summaries for the messages between the two
- /// indexes, inclusive.
- /// It should be noted that if another client has modified any message
- /// in the folder, the mail service may choose to return information that was
- /// not explicitly requested. It is therefore important to be prepared to
- /// handle both additional fields on a for
- /// messages that were requested as well as summaries for messages that were
- /// not requested at all.
- ///
- /// An enumeration of summaries for the requested messages.
- /// The minimum index.
- /// The maximum index, or -1 to specify no upper bound.
- /// The message summary items to fetch.
- /// The desired header fields.
- /// The cancellation token.
- IList Fetch (int min, int max, MessageSummaryItems items, IEnumerable headers, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Asynchronously fetch the message summaries for the messages between the two indexes, inclusive.
- ///
- ///
- /// Asynchronously fetches the message summaries for the messages between
- /// the two indexes, inclusive.
- /// It should be noted that if another client has modified any message
- /// in the folder, the mail service may choose to return information that was
- /// not explicitly requested. It is therefore important to be prepared to
- /// handle both additional fields on a for
- /// messages that were requested as well as summaries for messages that were
- /// not requested at all.
- ///
- /// An enumeration of summaries for the requested messages.
- /// The minimum index.
- /// The maximum index, or -1 to specify no upper bound.
- /// The message summary items to fetch.
- /// The desired header fields.
- /// The cancellation token.
- Task> FetchAsync (int min, int max, MessageSummaryItems items, IEnumerable headers, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Fetch the message summaries for the messages between the two indexes, inclusive.
- ///
- ///
- /// Fetches the message summaries for the messages between the two
- /// indexes, inclusive.
- /// It should be noted that if another client has modified any message
- /// in the folder, the mail service may choose to return information that was
- /// not explicitly requested. It is therefore important to be prepared to
- /// handle both additional fields on a for
- /// messages that were requested as well as summaries for messages that were
- /// not requested at all.
- ///
- /// An enumeration of summaries for the requested messages.
- /// The minimum index.
- /// The maximum index, or -1 to specify no upper bound.
- /// The message summary items to fetch.
- /// The desired header fields.
- /// The cancellation token.
- IList Fetch (int min, int max, MessageSummaryItems items, IEnumerable headers, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Asynchronously fetch the message summaries for the messages between the two indexes, inclusive.
- ///
- ///
- /// Asynchronously fetches the message summaries for the messages between
- /// the two indexes, inclusive.
- /// It should be noted that if another client has modified any message
- /// in the folder, the mail service may choose to return information that was
- /// not explicitly requested. It is therefore important to be prepared to
- /// handle both additional fields on a for
- /// messages that were requested as well as summaries for messages that were
- /// not requested at all.
- ///
- /// An enumeration of summaries for the requested messages.
- /// The minimum index.
- /// The maximum index, or -1 to specify no upper bound.
- /// The message summary items to fetch.
- /// The desired header fields.
- /// The cancellation token.
- Task> FetchAsync (int min, int max, MessageSummaryItems items, IEnumerable headers, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Fetch the message summaries for the messages between the two indexes (inclusive)
- /// that have a higher mod-sequence value than the one specified.
- ///
- ///
- /// Fetches the message summaries for the messages between the two
- /// indexes (inclusive) that have a higher mod-sequence value than the one
- /// specified.
- /// It should be noted that if another client has modified any message
- /// in the folder, the mail service may choose to return information that was
- /// not explicitly requested. It is therefore important to be prepared to
- /// handle both additional fields on a for
- /// messages that were requested as well as summaries for messages that were
- /// not requested at all.
- ///
- /// An enumeration of summaries for the requested messages.
- /// The minimum index.
- /// The maximum index, or -1 to specify no upper bound.
- /// The mod-sequence value.
- /// The message summary items to fetch.
- /// The cancellation token.
- IList Fetch (int min, int max, ulong modseq, MessageSummaryItems items, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Asynchronously fetch the message summaries for the messages between the two indexes
- /// (inclusive) that have a higher mod-sequence value than the one specified.
- ///
- ///
- /// Asynchronously fetches the message summaries for the messages between
- /// the two indexes (inclusive) that have a higher mod-sequence value than the
- /// one specified.
- /// It should be noted that if another client has modified any message
- /// in the folder, the mail service may choose to return information that was
- /// not explicitly requested. It is therefore important to be prepared to
- /// handle both additional fields on a for
- /// messages that were requested as well as summaries for messages that were
- /// not requested at all.
- ///
- /// An enumeration of summaries for the requested messages.
- /// The minimum index.
- /// The maximum index, or -1 to specify no upper bound.
- /// The mod-sequence value.
- /// The message summary items to fetch.
- /// The cancellation token.
- Task> FetchAsync (int min, int max, ulong modseq, MessageSummaryItems items, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Fetch the message summaries for the messages between the two indexes (inclusive)
- /// that have a higher mod-sequence value than the one specified.
- ///
- ///
- /// Fetches the message summaries for the messages between the two
- /// indexes (inclusive) that have a higher mod-sequence value than the one
- /// specified.
- /// It should be noted that if another client has modified any message
- /// in the folder, the mail service may choose to return information that was
- /// not explicitly requested. It is therefore important to be prepared to
- /// handle both additional fields on a for
- /// messages that were requested as well as summaries for messages that were
- /// not requested at all.
- ///
- /// An enumeration of summaries for the requested messages.
- /// The minimum index.
- /// The maximum index, or -1 to specify no upper bound.
- /// The mod-sequence value.
- /// The message summary items to fetch.
- /// The desired header fields.
- /// The cancellation token.
- IList Fetch (int min, int max, ulong modseq, MessageSummaryItems items, IEnumerable headers, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Asynchronously fetch the message summaries for the messages between the two indexes
- /// (inclusive) that have a higher mod-sequence value than the one specified.
- ///
- ///
- /// Asynchronously fetches the message summaries for the messages between
- /// the two indexes (inclusive) that have a higher mod-sequence value than the
- /// one specified.
- /// It should be noted that if another client has modified any message
- /// in the folder, the mail service may choose to return information that was
- /// not explicitly requested. It is therefore important to be prepared to
- /// handle both additional fields on a for
- /// messages that were requested as well as summaries for messages that were
- /// not requested at all.
- ///
- /// An enumeration of summaries for the requested messages.
- /// The minimum index.
- /// The maximum index, or -1 to specify no upper bound.
- /// The mod-sequence value.
- /// The message summary items to fetch.
- /// The desired header fields.
- /// The cancellation token.
- Task> FetchAsync (int min, int max, ulong modseq, MessageSummaryItems items, IEnumerable headers, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Fetch the message summaries for the messages between the two indexes (inclusive)
- /// that have a higher mod-sequence value than the one specified.
- ///
- ///
- /// Fetches the message summaries for the messages between the two
- /// indexes (inclusive) that have a higher mod-sequence value than the one
- /// specified.
- /// It should be noted that if another client has modified any message
- /// in the folder, the mail service may choose to return information that was
- /// not explicitly requested. It is therefore important to be prepared to
- /// handle both additional fields on a for
- /// messages that were requested as well as summaries for messages that were
- /// not requested at all.
- ///
- /// An enumeration of summaries for the requested messages.
- /// The minimum index.
- /// The maximum index, or -1 to specify no upper bound.
- /// The mod-sequence value.
- /// The message summary items to fetch.
- /// The desired header fields.
- /// The cancellation token.
- IList Fetch (int min, int max, ulong modseq, MessageSummaryItems items, IEnumerable headers, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Asynchronously fetch the message summaries for the messages between the two indexes
- /// (inclusive) that have a higher mod-sequence value than the one specified.
- ///
- ///
- /// Asynchronously fetches the message summaries for the messages between
- /// the two indexes (inclusive) that have a higher mod-sequence value than the
- /// one specified.
- /// It should be noted that if another client has modified any message
- /// in the folder, the mail service may choose to return information that was
- /// not explicitly requested. It is therefore important to be prepared to
- /// handle both additional fields on a for
- /// messages that were requested as well as summaries for messages that were
- /// not requested at all.
- ///
- /// An enumeration of summaries for the requested messages.
- /// The minimum index.
- /// The maximum index, or -1 to specify no upper bound.
- /// The mod-sequence value.
- /// The message summary items to fetch.
- /// The desired header fields.
- /// The cancellation token.
- Task> FetchAsync (int min, int max, ulong modseq, MessageSummaryItems items, IEnumerable headers, CancellationToken cancellationToken = default (CancellationToken));
-
- ///
- /// Get the specified message headers.
- ///
- ///
- /// Gets the specified message headers.
- ///
- /// The message headers.
- /// The UID of the message.
- /// The cancellation token.
- /// The progress reporting mechanism.
- HeaderList GetHeaders (UniqueId uid, CancellationToken cancellationToken = default (CancellationToken), ITransferProgress progress = null);
-
- ///
- /// Asynchronously get the specified message headers.
- ///
- ///
- /// Asynchronously gets the specified message headers.
- ///
- /// The message headers.
- /// The UID of the message.
- /// The cancellation token.
- /// The progress reporting mechanism.
- Task GetHeadersAsync (UniqueId uid, CancellationToken cancellationToken = default (CancellationToken), ITransferProgress progress = null);
-
- ///
- /// Get the specified body part headers.
- ///
- ///
- /// Gets the specified body part headers.
- ///
- /// The body part headers.
- /// The UID of the message.
- /// The body part.
- /// The cancellation token.
- /// The progress reporting mechanism.
- HeaderList GetHeaders (UniqueId uid, BodyPart part, CancellationToken cancellationToken = default (CancellationToken), ITransferProgress progress = null);
-
- ///
- /// Asynchronously get the specified body part headers.
- ///
- ///
- /// Asynchronously gets the specified body part headers.
- ///
- /// The body part headers.
- /// The UID of the message.
- /// The body part.
- /// The cancellation token.
- /// The progress reporting mechanism.
- Task GetHeadersAsync (UniqueId uid, BodyPart part, CancellationToken cancellationToken = default (CancellationToken), ITransferProgress progress = null);
-
- ///
- /// Get the specified message headers.
- ///
- ///
- /// Gets the specified message headers.
- ///
- /// The message headers.
- /// The index of the message.
- /// The cancellation token.
- /// The progress reporting mechanism.
- HeaderList GetHeaders (int index, CancellationToken cancellationToken = default (CancellationToken), ITransferProgress progress = null);
-
- ///
- /// Asynchronously get the specified message headers.
- ///
- ///
- /// Asynchronously gets the specified message headers.
- ///
- /// The message headers.
- /// The index of the message.
- /// The cancellation token.
- /// The progress reporting mechanism.
- Task GetHeadersAsync (int index, CancellationToken cancellationToken = default (CancellationToken), ITransferProgress progress = null);
-
- ///