//! mailer-core: Email model, validation, and RFC 5322 primitives.

pub mod bounce;
pub mod email;
pub mod error;
pub mod mime;
pub mod validation;

// Re-exports for convenience
pub use bounce::{
    detect_bounce_type, extract_bounce_recipient, is_bounce_subject, BounceCategory,
    BounceDetection, BounceType,
};
pub use email::{extract_email_address, Attachment, Email, EmailAddress, Priority};
pub use error::{MailerError, Result};
pub use mime::build_rfc822;
pub use validation::{is_valid_email_format, validate_email, EmailValidationResult};

/// Re-export mailparse for MIME parsing.
pub use mailparse;

/// Crate version.
pub fn version() -> &'static str {
    env!("CARGO_PKG_VERSION")
}

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn test_version() {
        assert!(!version().is_empty());
    }
}
