// // IPop3Client.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.Threading; using System.Threading.Tasks; using System.Collections.Generic; namespace MailKit.Net.Pop3 { /// /// An interface for a POP3 client. /// /// /// Implemented by . /// public interface IPop3Client : IMailSpool { /// /// Gets the capabilities supported by the POP3 server. /// /// /// The capabilities will not be known until a successful connection has been made /// and may change once the client is authenticated. /// /// /// /// /// The capabilities. /// /// Capabilities cannot be enabled, they may only be disabled. /// Pop3Capabilities Capabilities { get; set; } /// /// Gets the expiration policy. /// /// /// If the server supports the EXPIRE capability (), the value /// of the property will reflect the value advertized by the server. /// A value of -1 indicates that messages will never expire. /// A value of 0 indicates that messages that have been retrieved during the current session /// will be purged immediately after the connection is closed via the QUIT command. /// Values larger than 0 indicate the minimum number of days that the server will retain /// messages which have been retrieved. /// /// /// /// /// The expiration policy. int ExpirePolicy { get; } /// /// Gets the implementation details of the server. /// /// /// If the server advertizes its implementation details, this value will be set to a string containing the /// information details provided by the server. /// /// The implementation details. string Implementation { get; } /// /// Gets the minimum delay, in milliseconds, between logins. /// /// /// If the server supports the LOGIN-DELAY capability (), this value /// will be set to the minimum number of milliseconds that the client must wait between logins. /// /// /// /// /// The login delay. int LoginDelay { get; } /// /// Enable UTF8 mode. /// /// /// The POP3 UTF8 extension allows the client to retrieve messages in the UTF-8 encoding and /// may also allow the user to authenticate using a UTF-8 encoded username or password. /// /// The cancellation token. /// /// The has been disposed. /// /// /// The is not connected. /// /// /// The has already been authenticated. /// /// /// The operation was canceled via the cancellation token. /// /// /// The POP3 server does not support the UTF8 extension. /// /// /// An I/O error occurred. /// /// /// The POP3 command failed. /// /// /// A POP3 protocol error occurred. /// void EnableUTF8 (CancellationToken cancellationToken = default (CancellationToken)); /// /// Asynchronously enable UTF8 mode. /// /// /// The POP3 UTF8 extension allows the client to retrieve messages in the UTF-8 encoding and /// may also allow the user to authenticate using a UTF-8 encoded username or password. /// /// An asynchronous task context. /// The cancellation token. /// /// The has been disposed. /// /// /// The is not connected. /// /// /// The has already been authenticated. /// /// /// The operation was canceled via the cancellation token. /// /// /// The POP3 server does not support the UTF8 extension. /// /// /// An I/O error occurred. /// /// /// The POP3 command failed. /// /// /// A POP3 protocol error occurred. /// Task EnableUTF8Async (CancellationToken cancellationToken = default (CancellationToken)); /// /// Get the list of languages supported by the POP3 server. /// /// /// If the POP3 server supports the LANG extension, it is possible to /// query the list of languages supported by the POP3 server that can /// be used for error messages. /// /// The supported languages. /// The cancellation token. /// /// The has been disposed. /// /// /// The is not connected. /// /// /// The operation was canceled via the cancellation token. /// /// /// The POP3 server does not support the LANG extension. /// /// /// An I/O error occurred. /// /// /// The POP3 command failed. /// /// /// A POP3 protocol error occurred. /// IList GetLanguages (CancellationToken cancellationToken = default (CancellationToken)); /// /// Asynchronously get the list of languages supported by the POP3 server. /// /// /// If the POP3 server supports the LANG extension, it is possible to /// query the list of languages supported by the POP3 server that can /// be used for error messages. /// /// The supported languages. /// The cancellation token. /// /// The has been disposed. /// /// /// The is not connected. /// /// /// The operation was canceled via the cancellation token. /// /// /// The POP3 server does not support the LANG extension. /// /// /// An I/O error occurred. /// /// /// The POP3 command failed. /// /// /// A POP3 protocol error occurred. /// Task> GetLanguagesAsync (CancellationToken cancellationToken = default (CancellationToken)); /// /// Set the language used by the POP3 server for error messages. /// /// /// If the POP3 server supports the LANG extension, it is possible to /// set the language used by the POP3 server for error messages. /// /// The language code. /// The cancellation token. /// /// is null. /// /// /// is empty. /// /// /// The has been disposed. /// /// /// The is not connected. /// /// /// The operation was canceled via the cancellation token. /// /// /// The POP3 server does not support the LANG extension. /// /// /// An I/O error occurred. /// /// /// The POP3 command failed. /// /// /// A POP3 protocol error occurred. /// void SetLanguage (string lang, CancellationToken cancellationToken = default (CancellationToken)); /// /// Asynchronously set the language used by the POP3 server for error messages. /// /// /// If the POP3 server supports the LANG extension, it is possible to /// set the language used by the POP3 server for error messages. /// /// An asynchronous task context. /// The language code. /// The cancellation token. /// /// is null. /// /// /// is empty. /// /// /// The has been disposed. /// /// /// The is not connected. /// /// /// The operation was canceled via the cancellation token. /// /// /// The POP3 server does not support the LANG extension. /// /// /// An I/O error occurred. /// /// /// The POP3 command failed. /// /// /// A POP3 protocol error occurred. /// Task SetLanguageAsync (string lang, CancellationToken cancellationToken = default (CancellationToken)); } }