<commit_before>package Sisimai::MTA;
use feature ':5.10';
use strict;
use warnings;
use Sisimai::RFC5322;

sub SMTPCOMMAND {
    # Detector for SMTP commands in a bounce mail message
    # @private
    # @return   [Hash] SMTP command regular expressions
    return {
        'helo' => qr/\b(?:HELO|EHLO)\b/,
        'mail' => qr/\bMAIL F(?:ROM|rom)\b/,
        'rcpt' => qr/\bRCPT T[Oo]\b/,
        'data' => qr/\bDATA\b/,
    };
}
sub EOM {
    # End of email message as a sentinel for parsing bounce messages
    # @private
    # @deprecated
    # @return   [String] Fixed length string like a constant
    my $class = shift;
    my $klass = 'Sisimai::String';
    warn sprintf( "***warning: %s->EOM deprecated method. Use %s->EOM() instead.", $class, $klass );
    return '__END_OF_EMAIL_MESSAGE__';
}
sub DELIVERYSTATUS {
    # Data structure for parsed bounce messages
    # @private
    # @return [Hash] Data structure for delivery status
    return {
        'spec'         => '',   # Protocl specification
        'date'         => '',   # The value of Last-Attempt-Date header
        'rhost'        => '',   # The value of Remote-MTA header
        'lhost'        => '',   # The value of Received-From-MTA header
        'alias'        => '',   # The value of alias entry(RHS)
        'agent'        => '',   # MTA name
        'action'       => '',   # The value of Action header
        'status'       => '',   # The value of Status header
        'reason'       => '',   # Temporary reason of bounce
        'command'      => '',   # SMTP command in the message body
        'diagnosis'    => '',   # The value of Diagnostic-Code header
        'recipient'    => '',   # The value of Final-Recipient header
        'softbounce'   => '',   # Soft bounce or not
        'feedbacktype' => '',   # FeedBack Type
    };
}

sub LONGFIELDS {
    # Fields that might be long
    # @private
    # @deprecated
    # @return   [Hash] Long filed(email header) list
    return [ keys %{ Sisimai::RFC5322->LONGFIELDS } ];
}

sub RFC822HEADERS { 
    # Grouped RFC822 headers
    # @private
    # @deprecated
    # @param    [String] group  RFC822 Header group name
    # @return   [Array,Hash]    RFC822 Header list
    my $class = shift;
    my $group = shift // return [ keys %{ Sisimai::RFC5322->HEADERFIELDS } ];
    my $index = Sisimai::RFC5322->HEADERFIELDS( $group );
    return $index;
}

sub INDICATORS {
    # Flags for position variable for
    # @private
    # @return   [Hash] Position flag data
    # @since    v4.13.0
    return {
        'deliverystatus' => ( 1 << 1 ),
        'message-rfc822' => ( 1 << 2 ),
    };
}

sub index {
    # MTA list
    # @return   [Array] MTA list with order
    my $class = shift;
    my $index = [
        'Sendmail', 'Postfix', 'qmail', 'OpenSMTPD', 'Exim', 'Courier',
        'Exchange', 'MessagingServer', 'V5sendmail', 'ApacheJames', 'McAfee', 
        'Domino', 'Notes', 'MXLogic', 'MailFoundry', 'IMailServer', 'mFILTER', 
        'Activehunter', 'InterScanMSS', 'SurfControl', 'MailMarshalSMTP',
        'X1', 'X2', 'X3', 'X4', 'X5',
    ];

    return $index;
}<commit_msg>Changed default order: V5sendmail is after X5<commit_after>package Sisimai::MTA;
use feature ':5.10';
use strict;
use warnings;
use Sisimai::RFC5322;

sub SMTPCOMMAND {
    # Detector for SMTP commands in a bounce mail message
    # @private
    # @return   [Hash] SMTP command regular expressions
    return {
        'helo' => qr/\b(?:HELO|EHLO)\b/,
        'mail' => qr/\bMAIL F(?:ROM|rom)\b/,
        'rcpt' => qr/\bRCPT T[Oo]\b/,
        'data' => qr/\bDATA\b/,
    };
}
sub EOM {
    # End of email message as a sentinel for parsing bounce messages
    # @private
    # @deprecated
    # @return   [String] Fixed length string like a constant
    my $class = shift;
    my $klass = 'Sisimai::String';
    warn sprintf( "***warning: %s->EOM deprecated method. Use %s->EOM() instead.", $class, $klass );
    return '__END_OF_EMAIL_MESSAGE__';
}
sub DELIVERYSTATUS {
    # Data structure for parsed bounce messages
    # @private
    # @return [Hash] Data structure for delivery status
    return {
        'spec'         => '',   # Protocl specification
        'date'         => '',   # The value of Last-Attempt-Date header
        'rhost'        => '',   # The value of Remote-MTA header
        'lhost'        => '',   # The value of Received-From-MTA header
        'alias'        => '',   # The value of alias entry(RHS)
        'agent'        => '',   # MTA name
        'action'       => '',   # The value of Action header
        'status'       => '',   # The value of Status header
        'reason'       => '',   # Temporary reason of bounce
        'command'      => '',   # SMTP command in the message body
        'diagnosis'    => '',   # The value of Diagnostic-Code header
        'recipient'    => '',   # The value of Final-Recipient header
        'softbounce'   => '',   # Soft bounce or not
        'feedbacktype' => '',   # FeedBack Type
    };
}

sub LONGFIELDS {
    # Fields that might be long
    # @private
    # @deprecated
    # @return   [Hash] Long filed(email header) list
    return [ keys %{ Sisimai::RFC5322->LONGFIELDS } ];
}

sub RFC822HEADERS { 
    # Grouped RFC822 headers
    # @private
    # @deprecated
    # @param    [String] group  RFC822 Header group name
    # @return   [Array,Hash]    RFC822 Header list
    my $class = shift;
    my $group = shift // return [ keys %{ Sisimai::RFC5322->HEADERFIELDS } ];
    my $index = Sisimai::RFC5322->HEADERFIELDS( $group );
    return $index;
}

sub INDICATORS {
    # Flags for position variable for
    # @private
    # @return   [Hash] Position flag data
    # @since    v4.13.0
    return {
        'deliverystatus' => ( 1 << 1 ),
        'message-rfc822' => ( 1 << 2 ),
    };
}

sub index {
    # MTA list
    # @return   [Array] MTA list with order
    my $class = shift;
    my $index = [
        'Sendmail', 'Postfix', 'qmail', 'Exim', 'Courier', 'OpenSMTPD', 
        'Exchange', 'MessagingServer', 'Domino', 'Notes', 'ApacheJames', 
        'McAfee', 'MXLogic', 'MailFoundry', 'IMailServer', 'mFILTER', 
        'Activehunter', 'InterScanMSS', 'SurfControl', 'MailMarshalSMTP',
        'X1', 'X2', 'X3', 'X4', 'X5', 'V5sendmail', 
    ];
    return $index;
}
{'fraction_non_alphanumeric': 0.14444621007468617, 'fraction_numerical': 0.01557285873192436, 'mean_word_length': 2.2849686847599164, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 53, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '187745', 'n_tokens_mistral': 2169, 'n_tokens_neox': 2084, 'n_words': 586}