-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: Best way to report missing responses #387
Comments
The most simple and reliable way is to read the entire bounce message at your milter code because each response message in a Sisimai calls Another way? The following dirty hack code might help you, perhaps... #!/usr/bin/env perl
use strict;
use warnings;
use Sisimai;
use Sisimai::Data;
use Sisimai::Rhost;
use Sisimai::SMTP::Error;
while(<>) {
# For only a maillog of Postfix
my $logmessage = $1 if $_ =~ /status=bounced (.+)$/ || next;
my $remotehost = $1 if $_ =~ /[(]host[ ]([0-9A-Za-z.-]+?)\[/ || next;
my $diagnostic = $1 if $_ =~ /[ ]said:[ ](.+)$/ || next;
my $logcommand = $1 if $_ =~ /[ ](MAIL|RCPT|DATA)[ ]/;
my $parameters = {
'reason' => '',
'diagnosticcode' => $diagnostic,
'deliverystatus' => Sisimai::SMTP::Status->find($logmessage),
'replycode' => Sisimai::SMTP::Reply->find($logmessage),
'rhost' => $remotehost,
'smtpcommand' => $logcommand,
};
my $dataobject = bless($parameters, 'Sisimai::Data');
my $reasonname = Sisimai::Rhost->get($dataobject) || Sisimai->match($logmessage);
$dataobject->{'reason'} = $reasonname || '';
printf("%s\n", $dataobject->reason);
}
Regards, |
That's perfect. |
Following the question on #385 , I'm doing an analysis of some responses from a Postfix instance:
I'm having some responses that assumed to be already covered, like
My questions are:
I'm writing a milter to parse the full bounce message but this is only done to have an idea on how may messages will be detected and classified.
Regards
The text was updated successfully, but these errors were encountered: