diff --git a/src/smtp/commands.rs b/src/smtp/commands.rs index 0704afc..83db688 100644 --- a/src/smtp/commands.rs +++ b/src/smtp/commands.rs @@ -7,12 +7,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -/*! SMTP commands [1] and ESMTP features [2] library - -[1] https://tools.ietf.org/html/rfc5321#section-4.1 -[2] http://tools.ietf.org/html/rfc1869 - -*/ +//! SMTP commands and ESMTP features library use std::fmt::{Show, Formatter, Result}; use std::io::net::ip::Port; @@ -24,6 +19,7 @@ pub static SMTP_PORT: Port = 25; //pub static SUBMISSION_PORT: Port = 587; /// SMTP commands +/// /// We do not implement the following SMTP commands, as they were deprecated in RFC 5321 /// and must not be used by clients : /// SEND, SOML, SAML, TURN @@ -88,9 +84,11 @@ impl Show for SmtpCommand { #[deriving(Eq,Clone)] pub enum EsmtpParameter { /// 8BITMIME keyword + /// /// RFC 6152 : https://tools.ietf.org/html/rfc6152 EightBitMime, /// SIZE keyword + /// /// RFC 1427 : https://tools.ietf.org/html/rfc1427 Size(uint) } diff --git a/src/smtp/common.rs b/src/smtp/common.rs index aa95457..a46e5d1 100644 --- a/src/smtp/common.rs +++ b/src/smtp/common.rs @@ -7,11 +7,9 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -/*! Common definitions for SMTP - -Needs to be organized later. - -*/ +//! Common definitions for SMTP +//! +//! Needs to be organized later. use std::strbuf::StrBuf; diff --git a/src/smtp/lib.rs b/src/smtp/lib.rs index 05ba5f0..2502a8d 100644 --- a/src/smtp/lib.rs +++ b/src/smtp/lib.rs @@ -7,39 +7,30 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -/*! SMTP library - -This library implements a simple SMTP client. - -# What this client is NOT made for - -*Send emails to public email servers.* It is not designed to smartly handle servers responses, -to rate-limit emails, to make retries, and all that complicated stuff needed to politely talk to public -servers. - -What this client does is basically try once to send the email, and say if it worked. It should be -used to transfer emails to a relay server, - -The client tends to follow RFC 5321 (https://tools.ietf.org/html/rfc5321). - -This is an SMTP client, and thus does NOT manages email content but only the enveloppe. - -It also implements the following extensions : - 8BITMIME (RFC 6152 : https://tools.ietf.org/html/rfc6152) - SIZE (RFC 1427 : https://tools.ietf.org/html/rfc1427) - -# Usage - -``` -let mut email_client: SmtpClient = SmtpClient::new(StrBuf::from_str("localhost"), None, None); -email_client.send_mail(StrBuf::from_str(""), vec!(StrBuf::from_str("")), StrBuf::from_str("Test email")); -``` - -# Next steps: - Add SSL/TLS support - Add AUTH support - -*/ +//! # Rust SMTP client +//! +//! The client does its best to follow RFC 5321 (https://tools.ietf.org/html/rfc5321). +//! +//! It also implements the following extensions : +//! +//! * 8BITMIME (RFC 6152 : https://tools.ietf.org/html/rfc6152) +//! * SIZE (RFC 1427 : https://tools.ietf.org/html/rfc1427) +//! +//! ## What this client is NOT made for +//! +//! Send emails to public email servers. It is not designed to smartly handle servers responses, +//! to rate-limit emails, to make retries, and all that complicated stuff needed to politely talk to +//! public servers. +//! +//! What this client does is basically try once to send the email, and say if it worked. It should only be +//! used to transfer emails to a relay server. +//! +//! ## Usage +//! +//! ``` +//! let mut email_client: SmtpClient = SmtpClient::new(StrBuf::from_str("localhost"), None, None); +//! email_client.send_mail(StrBuf::from_str(""), vec!(StrBuf::from_str("")), StrBuf::from_str("Test email")); +//! ``` #![crate_id = "smtp#0.1-pre"] @@ -48,7 +39,6 @@ email_client.send_mail(StrBuf::from_str(""), vec!(StrBuf::from #![license = "MIT/ASL2"] #![crate_type = "lib"] -#![doc(html_root_url = "http://www.rust-ci.org/amousset/rust-smtp/doc/")] #![feature(macro_rules)] #![deny(non_camel_case_types)]