spf-milter 0.6.0

Milter for SPF verification
Documentation
// SPF Milter – milter for SPF verification
// Copyright © 2020–2022 David Bürgin <dbuergin@gluet.ch>
//
// This program is free software: you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free Software
// Foundation, either version 3 of the License, or (at your option) any later
// version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
// details.
//
// You should have received a copy of the GNU General Public License along with
// this program. If not, see <https://www.gnu.org/licenses/>.

pub mod auth_results;
pub mod format;
pub mod received_spf;

use std::fmt::Display;

/// A trait for header fields.
pub trait HeaderField: Display {
    fn name(&self) -> &'static str;

    /// Returns a formatted representation of the header field body (the header
    /// ‘value’), typically with some line wrapping applied.
    fn format_body(&self) -> String;
}

// See RFC 5322, 2.1.1.
const HEADER_LINE_WIDTH: usize = 78;