mirror of
https://github.com/Cocoanetics/SwiftMail.git
synced 2026-03-17 20:02:25 +00:00
31 lines
879 B
Swift
31 lines
879 B
Swift
import Foundation
|
|
import NIOCore
|
|
|
|
/**
|
|
Command to send QUIT and cleanly end the SMTP session
|
|
*/
|
|
public struct QuitCommand: SMTPCommand {
|
|
/// The result type is a simple success Boolean
|
|
public typealias ResultType = Bool
|
|
|
|
/// The handler type that will process responses for this command
|
|
public typealias HandlerType = QuitHandler
|
|
|
|
/// Timeout in seconds for QUIT command (typically quick to respond)
|
|
public let timeoutSeconds: Int = 10
|
|
|
|
/// Initialize a new QUIT command
|
|
public init() {
|
|
// No parameters needed for QUIT
|
|
}
|
|
|
|
/// Convert the command to a string that can be sent to the server
|
|
public func toCommandString() -> String {
|
|
return "QUIT"
|
|
}
|
|
|
|
/// Validation is not required for QUIT command
|
|
public func validate() throws {
|
|
// No validation needed for QUIT command
|
|
}
|
|
} |