Hi,

I’m moving a mail server from SuSE Linux 9 to SuSE 10 and I’m having
great difficulties with amavisd-new.

amavis[13946]: (13946-02) ESMTP::10024 /var/amavis/tmp/amavis-20060310T22=
0700-13946: <user@domain.tld> ->
<user2@mailhub.domain2.tld> Received: SIZE=3D9081 BODY=3D8BITMIME from ma=
ilhub.domain2.tld ([127.0.0.1]) by localhost
(mailhub.domain2.tld [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id=
13946-02 for <user2@mailhub.domain2.tld>; Fri,
10 Mar 2006 22:07:00 +0100 (CET)
amavis[13946]: (13946-02) Checking: nqyj6sdDg7fD <user@domain.tld> -> <us=
er2@mailhub.domain2.tld>
amavis[13950]: (13946-02) run_command: child process [13950]: Error closi=
ng main::stdin: Bad file descriptor at
/usr/sbin/amavisd line 1872.\n
amavis[13946]: (13946-02) TROUBLE in check_mail: parts_decode_ext FAILED:=
parsing file(1) results – missing last 1
results at (eval 57) line 154.
amavis[13946]: (13946-02) PRESERVING EVIDENCE in /var/amavis/tmp/amavis-2=
0060310T220700-13946
postfix/smtp[13926]: 53E0927E9C: host 127.0.0.1[127.0.0.1] said: 451 4.5.=
0 Error in processing, id=3D13946-02,
parts_decode_ext FAILED: parsing file(1) results – missing last 1 results=
at (eval 57) line 154. (in reply to end of
DATA command)

I searched the web for information, but apart from some hints to check
the permissions on /var/amavis, I failed to find anything useful so far.
The first difference between the server platforms that comes to my mind
is the installed PERL version. Could PERL 5.8.7 on the new machine cause
trouble? Unfortunately I’m no PERL guru, so I can’t tell.

Thanks for your help!

–=20
Mit freundlichen Gr=FC=DFen / Sincerely
Dipl. Inform. Ralph Seichter

________________________________________
_______

Ralph,

> I’m moving a mail server from SuSE Linux 9 to SuSE 10 and I’m having
> great difficulties with amavisd-new.


> amavis[13950]: (13946-02) run_command: child
> process [13950]: Error closing main::stdin: Bad file descriptor
> at /usr/sbin/amavisd line 1872.


> I searched the web for information, but apart from some hints to check
> the permissions on /var/amavis, I failed to find anything useful so far.
> The first difference between the server platforms that comes to my mind
> is the installed PERL version. Could PERL 5.8.7 on the new machine cause
> trouble? Unfortunately I’m no PERL guru, so I can’t tell.
I don’t remember seeing such problem report before
(others about “parsing file(1) results – missing last 1 results” were
probably for different reasons). It is probably not due to PERL 5.8.7 itself,
which probably now runs on a majority of hosts and is quite good – although
it could be a particular installation of it.Since it complains about main::stdin file descriptor, it is probably worth
starting investigation there. Does it make any difference when amavisd
is started manually from a command line, or when started by your
startup script? Or is there a difference when a startup script is run
automatically at boot time, or later manually?

You could try just ignoring the status result at line 1872,
replacing the:
close(main::stdin) or die “Error closing main::stdin: $!”;
with:
close(main::stdin);

If the problem does not pop up now some place else,
it’s probably not too bad just ignoring the status. Certainly it would
be nice to investigate further. Perhaps a strace -f could shed some light.

Mark

________________________________________
_______

Ralph,

> Matt Jackson suggested using Net::Server 0.90 instead of the current
> version 0.91, and with V0.90 the error does not pop up. Thanks once more
> for the hint, Matt!
I see, there has been some changes in Net::Server 0.91 on handling STDIN.

>
> I changed the line of code as you suggested. Amavisd-new seems to run
> nicely after the change, even in conjuction with Net::Server 0.91.
For now, removing the status test or sticking to 0.90 is a workaround.
Will investigate later on.

change:
close(main::stdin) or die “Error closing main::stdin: $!”;
to:
close(main::stdin);

> I will ask the customer if it is OK to install strace on the server and
> to forward a trace file to you.

No need, the 0.90/0.91 hint is good enough, thanks.

Mark

________________________________________
_______

Heute (11.03.2006/15:47 Uhr) schrieb Mark Martinec (Mark.Martinec+amavis@ijs.si),

> Ralph,


[vbcol=seagreen]
> I see, there has been some changes in Net::Server 0.91 on handling STDIN.


[vbcol=seagreen]
> For now, removing the status test or sticking to 0.90 is a workaround.
> Will investigate later on.


> change:
> close(main::stdin) or die “Error closing main::stdin: $!”;
> to:
> close(main::stdin);
yeah, solved. Thank you.

[vbcol=seagreen]
> No need, the 0.90/0.91 hint is good enough, thanks.


> myself wrote:

It is more tricky than it appeared to make the same code work correctly
under 0.90 as well as under 0.91. The post_process_request_hook fails
to close socket under 0.91, so smtp QUIT command no longer drops the
session. Luckily Postfix does not mind, but it is wrong anyway.
I’ll get more results hopefully tomorrow.
[vbcol=seagreen]
> I think I’ll keep using Net::Server 0.91 and disable the status test.
> Please let me know what you come up with; this problem has cost me some
> tufts of hair from my head (and some sleep aswell). 😉

For now disabling the check or keeping 0.90 is still a good workaround.

Mark

________________________________________
_______

Jim,

[vbcol=seagreen]
> is in that the fix from Net::Server 0.91 included
Will be (at least for 0.92 and 0.90), but I’m waiting for a final say
from the author of Net::Server. It seems there will be a 0.92 pretty soon Mark

________________________________________
_______

Ralph and others,

>
> It is more tricky than it appeared to make the same code work correctly
> under 0.90 as well as under 0.91. The post_process_request_hook fails
> to close socket under 0.91, so smtp QUIT command no longer drops the
> session. Luckily Postfix does not mind, but it is wrong anyway.
A workaround for this bug in 0.91 (not closing a connection) is quite
straightforward (the bug will be fixed in 0.92), but as a next obstacle
there are some conflicts between the new use of file descriptors
in Net::Server 0.91 and the way file descriptors are assigned when
spawning external programs, both by amavisd itself and by SpamAssassin.
This is not a bug in Net::Server, just a compatibility issue.
The “Error closing main::stdin: Bad file descriptor” is just
a (trivially fixed) tip of the iceberg.The fix is nontrivial, so my intention is to get the 2.4.0
out on the street pretty fast, and not to bother with preparing,
testing and releasing a patched 2.3.3. People that want to
stick with 2.3.3 should not upgrade Net::Server beyond 0.90,
which is the last version under which 2.3.3 works reliably
in all setups. Port maintainers are of course free to patch
older port if they so desire.

Mark

________________________________________
_______

S