[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[Fwd: [AMaViS-user] Amavis-ng + exim -- help please.]

I'm forwarding the message below that I sent to the amavis-user list
because I haven't gotten even so much as a request for more info about
the problem there.

If anyone has any ideas please let me know.


-------- Original Message --------
Subject: [AMaViS-user] Amavis-ng + exim -- help please.
From: "Gerald V. Livingston II" <debuser@sysmatrix.net>
Date: Sat, October 19, 2002 2:22
To: <amavis-user@lists.sourceforge.net>

exim 3.36

The error seems to occur when Exim.pm attempts to feed the scanned
message back to the real exim MTA.

When the error occurs the messages are left in /var/tmp where amavis
opens them up for scanning. I could probably feed them back to exim
by hand and have them delivered after disabling amavis.

Any idea why it's griping about a PATH environment being insecure
and where it's getting that particular environment setting? I'm no
programmer and have dug around about a week now trying to track it
down. I had one more thought that I haven't yet tried and that is to
set amavis to run as UID/GID mail/mail, the same as exim. I'm
working from remote right now (I'm at work and the box is at home).
May ssh into the box later and kill fetchmail to try re-setting the
UID/GID in the config files.

This is on a Debian distribution system with amavis running
uid=amavis gid=amavis



Begin error email genertaed by exim:

Date: Mon, 14 Oct 2002 09:33:54 -0500
From: Mail Delivery System <Mailer-Daemon@sysmatrix.net>
To: xxxxx@xxxxxxxxxxxx
Subject: Mail delivery failed: returning message to sender

This message was created automatically by mail delivery software

A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es)


The following text was generated during the delivery attempt:

------ xxxxxxxxxx@localhost ------

binmode() on unopened filehandle GEN2 at
/usr/share/perl5/File/MMagic.pm line 354.
Insecure $ENV{PATH} while running with -T switch at
/usr/share/perl5/AMAVIS/MTA/Exim.pm line 140.


This is the section of MMagic.pm that contains the failing line:

sub new {
    my $self = {};
    my $proto = shift;
    my $class = ref($proto) || $proto;
    $self->{MF} = [];
    $self->{magic} = [];
    if (! @_) {
        my $fh = *File::MMagic::DATA{IO};
        bless $fh, 'FileHandle' if ref $fh ne 'FileHandle';
        $dataLoc = $fh->tell() if (! defined $dataLoc);
        $fh->seek($dataLoc, 0);
        &readMagicHandle($self, $fh);
    } else {
        my $filename = shift;
        my $fh = new FileHandle;
354--->        binmode($fh);
        if ($fh->open("< $filename")) {
            &readMagicHandle($self, $fh);
        } else {
            warn __PACKAGE__ . " couldn't load specified file

This is the section of Exim.pm that has the failing line:

# Generate a copy of the scanned message and pipe it to mailer.
sub accept_message {
  my $self = shift;
  my $args = shift;
  writelog($args,LOG_INFO, __PACKAGE__.": Accepting message");
  my @cfg_exim_args;

  push @cfg_exim_args, split(/\s+/,$cfg_exim_args);
  push @cfg_exim_args, $$args{'sender'};
  push @cfg_exim_args, @{$$args{'recipients'}};

140 --->  open(MAIL, "|-") || exec($cfg_exim_binary,
  if ($cfg_x_header) {
    print MAIL "$cfg_x_header_tag: $cfg_x_header_line\n";
  while (my $line=$$args{'filehandle'}->getline()) {
    print MAIL $line;

  if ($? != 0) {
    writelog($args,LOG_ERR, __PACKAGE__.": $cfg_exim_binary exited
with ".($?>>8));

  $$args{'status'} = 'accept';

  # Return successfully
  return 1;

AMaViS-user mailing list

Reply to: