Amavisd error mail_dispatch: no recognized protocol name - postfix-mta

OS: FreeBSD-11.1
Name: amavisd-new-2.11.0_2,1
We recently began getting these errors from amavisd reported in our maillog:
. . .
proxy-reject: END-OF-MESSAGE: 451 4.5.0 Error in processing,
id=29937-07, quar+notif FAILED:
mail_dispatch: no recognized protocol name: -2
at /usr/local/sbin/amavisd line 9638.;
. . .
Each one of these errors results from processing messages from a single domain. However, not all of the traffic from that domain generates an error.
The code section in amavisd referred to in the message reads:
9619 my $any_deliveries = 0;
9620 my $per_recip_data = $msginfo->per_recip_data;
9621 my $num_recips_notdone =
9622 scalar(grep(!$_->recip_done && (!$filter || &$filter($_)),
9623 #$per_recip_data));
9624 while ($num_recips_notdone > 0) {
9625 # a delivery method may be a scalar of a form protocol:socket_specs, or
9626 # a listref of such elements; if a list is provided, it is expected that
9627 # each entry will be using the same protocol name, otherwise behaviour
9628 # is unspecified - so just obtain the protocol name from the first entry
9629 #
9630 my(%protocols, $any_tempfail);
9631 for my $r (#$per_recip_data) {
9632 if (!$dsn_per_recip_capable) {
9633 my $recip_smtp_response = $r->recip_smtp_response; # any 4xx code ?
9634 if (defined($recip_smtp_response) && $recip_smtp_response =~ /^4/) {
9635 $any_tempfail = $recip_smtp_response . ' (' . $r->recip_addr . ')';
9636 }
9637 }
9638 if (!$r->recip_done && (!$filter || &$filter($r))) {
9639 my $proto_sockname = $r->delivery_method;
9640 defined $proto_sockname
9641 or die "mail_dispatch: undefined delivery_method";
9642 !ref $proto_sockname || ref $proto_sockname eq 'ARRAY'
9643 or die "mail_dispatch: not a scalar or array ref: $proto_sockname";
9644 for (ref $proto_sockname ? #$proto_sockname : $proto_sockname) {
9645 local($1);
9646 if (/^([a-z][a-z0-9.+-]*):/si) { $protocols{lc($1)} = 1 }
9647 else { die "mail_dispatch: no recognized protocol name: $_" }
9648 }
9649 }
9650 }
But I have no idea where the protocol name sought is obtained. Because of the error the offending message is not placed in the quarantine folder so I cannot examine it.
Is this a configuration error on our part or is this the result of a malformed email transmission? In either case, what can I do to resolve this matter?

Related

Simple zeek script

I am totally new to zeek scripting, and I am trying to to a very basic DNS tunnel detector.
Here is my code so far :
export {
const conn_packets_limit = 10;
const conn_time_limit = 30secs;
}
event dns_message(c: connection, is_orig: bool, msg: dns_msg, len: count) {
if (c$duration > conn_time_limit) {
print fmt("Long DNS connexion for %s by %s/%s",c$id$resp_h,c$id$resp_h,c$id$orig_p);
}
}
When i try to run it with zeek -C -r ../capture.pcap ../zeek_scripts/dns/dns.zeek I get the following error : error in ./../zeek_scripts/dns/dns.zeek, line 11: syntax error, at or near "}"
I do not know what I am doing wrong with the print line, could you help me ?
Thank you !

Perl 6 error: Malformed UTF-8

right now, I'm learning Perl 6; my first project is to make an HTTP client .. I get an error and I do not understand why
Malformed UTF-8 at line 1 col 45
in method new at main.p6 line 13
in block <unit> at main.p6 line 43
I think it comes from the port variable, but I'm not sure
Here is all of my perl6 code:
class Request
{
has $!method;
has $!path;
has $!version;
has #!headers;
has $!socket;
has $.response is rw;
method new(:$method, :$path, :$host, :$port, :$version = "HTTP/1.1")
{
my $socket = IO::Socket::INET.new(:$host, :$port);
return self.bless(:$method, :$path, :$version, :$socket);
}
submethod BUILD(:$!method, :$!path, :$!version, :$!socket){}
method setHeader($name, $value)
{
my %header = name => $name, value => $value;
#!headers.push({%header});
}
method toString
{
my $request = "$!method $!path $!version\r\n";
for #!headers -> %_ {
$request ~= %_{'name'} ~ ": " ~ %_{'value'} ~ "\r\n";
}
$request ~ "\r\n";
}
method send($i = 1)
{
say "Request send!";
$!socket.print($.toString());
say $!socket.recv for 0..$i;
}
}
my $host = "127.0.0.1";
my Int $port = 58002;
my $request = Request.new(:method("GET"), :path("/"), :$host, :$port);
$request.setHeader("host", $host);
$request.setHeader("Accept-Language", "fr");
$request.send(2);
This answer may not be helpful, might be annoying, but I can delete it later today if it was and it's all I've got and I have to run.
I don't know if you understand the error message, but let's cover that first.
Malformed UTF-8 at line 1 col 45
in method new at main.p6 line 13
in block <unit> at main.p6 line 43
This means that during execution of the last line in the message, line 43 of your code, something went wrong:
my $request = Request.new(:method("GET"), :path("/"), :$host, :$port);
The compiler noticed that execution of that last line involved a path that went through another line in your code, line 13:
return self.bless(:$method, :$path, :$version, :$socket);
So that helps better pinpoint the line during execution of which the error occurred.
.bless is a method call. It's called on self which refers to the invocant passed to the method which you can assume is an object of the class in which the method call appears, namely the class you're defining Request.
Your code doesn't specify what class Request inherits from (using is) so it inherits from Any. The bless for Any is inherited from Mu's.
which is this code in the Rakudo compiler:
method bless(*%attrinit) {
nqp::create(self).BUILDALL(Empty, %attrinit);
}
So during execution of that code, Perl 6 attempted to read some UTF8 and encountered an invalid character at col 45 of the very first line of some data it tried to read.
So that's the best I can say about why, without seeing your data.

Invoke-Webrequest ASP.Net Error

I have a script which I use to load a webpage, retrieve information from said webpage, then output said information to a file. It had been working perfectly until today, when I have been getting an error which reads:
invoke-webrequest : Response object error 'ASP 0251 : 80004005'
Response Buffer Limit Exceeded
/foo/Reports/SearchLocation.asp, line 0
Execution of the ASP page caused the Response Buffer to exceed its configured limit.
At C:\path.ps1:7 char:12
+ $url = invoke-webrequest "http://url/ ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebException
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
I do not believe there have been any changes to the site which it is pulling its data from, and the file it is getting the input information from has no formatting errors.
Some googling around leads me to believe that the issue is that the page has more than 4 mb worth of data to load, and the default buffer size is 4 mb, but I can't find any instructions for how to change the buffer size in PowerShell.
I came across the clear-webconfiguration cmdlet, but I'm not certain whether or not that is what I need, or how exactly to implement it within my script. Here is the main portion of my code:
foreach($c in $csv){
[array]$tags = $null
$url = invoke-webrequest "http://url.com" -UseDefaultCredentials
$table = $url.ParsedHTML.getElementsByTagName('table')[7]
$rows = $table.getElementsByTagName('tr')
if($c.'Was this user on the old file?' -eq 'Yes'){
if($table.innerText -like "*N/A*" ){
$man = $c.'Manager Name' -replace ',',';'
$badusers += $c.'User ID' + "," + $c.Name + "," + $man + "," + $c.'CC'
}
else{
foreach($row in $rows){
$bcol = $row.getElementsByTagName('td') | Where-Object{$_.cellIndex -eq 1} | select -First 1
$ccol = $row.getElementsByTagName('td') | Where-Object{$_.cellIndex -eq 7} | select -First 1
$bcol = $bcol.innerText
$ccol = $ccol.innerText
if($ccol -ne $c.'CC'){
$tags += $bcol + ",," + $c.'CC' + "," + $c.'User ID'
}
}
if($tags -ne $null){
$results += $tags
}
}
}
}
Any help on solving this issue is much appreciated.

Error by read the file size PHP

I want to get the file size of an attachment of my wordpress post.
But when I run the site, I get this error ...
Can anyone help me?
"Warning: filesize(): stat failed for http://XXX.de/webdev/wp-content/uploads/2013/03/example.zip in C:\Users\XXX\Desktop\XAMPP\htdocs\webdev\wp-content\themes\web dev-theme\modul-page.php on line 27"
<?php
$a = filesize($img['url']);
echo$a;
?>
Thanks!
First check and see if the files/dirs are read/writeable.
I would do this inside of a file exist just for best practices. It is hard to determine what is wrong because you have not specified what line 27 is.
if ( file_exists($img['url']) ) {
$the_file_size = filesize($img['url']);
if ( $the_file_size >= 0 ) {
echo $the_file_size . ' bytes';
} else {
echo "File size could not be determined";
}
}

wordpress _e function

it shows"-- Debug: Undefined variable: wordscut on line 168 of /wp-content/theme"
function cutstr($string, $length) {
$string =strip_tags($string);
preg_match_all("/[x01-x7f]|[xc2-xdf][x80-xbf]|xe0[xa0-xbf][x80-xbf]|
[xe1-xef][x80-xbf][x80-xbf]|xf0[x90-xbf][x80-xbf][x80-xbf]|[xf1-xf7][x80-xbf][x80-xbf][x80-xbf]/", $string, $info);
for($i=0; $i<count($info[0]); $i++) {
$wordscut.= $info[0][$i];
$j= ord($info[0][$i]) > 127 ? $j + 2 : $j + 1;
if ($j > $length - 3) {
return $wordscut." ...";
}
}
return join('', $info[0]);
}
the above is my function. i know in php, it's right if a variable doesn't be declared before it is used.why it shows"Undefined variable: wordscut, j..... thank you.
2,* REQUIRED: Non-printable characters were found in the '''functions.php''' file. You may want to check this file for errors.
what is Non-printable characters .how to correct it? thank you.
This is one one classic bug.
When PHP started your script, $wordscut is not defined. When you run
$wordscut .= "sometext";
The code actually do
$wordscut = $wordscut . "sometext";
At this point, $wordscut is not available, thus Undefined Variable error occurred.
To fix it, add
$wordscut = '';
before
for($i=0; $i<count($info[0]); $i++) {

Resources