[Mimedefang] Multiplexor errors

Jon Rowlan jon.rowlan at sads.com
Sun Apr 27 06:00:09 EDT 2008


Hi all,

In my filter script, in function filter_begin I am trying to replace
this which works

    system('mkdir', "/mailstore/$recipient");
    system('cp', 'INPUTMSG', "/mailstore/$recipient/$MsgID");

with this
    
    system('/etc/mail/archivemail.sh',"/mailstore/$recipient");
    system('cp', 'INPUTMSG', "/mailstore/$recipient/$MsgID");

My shell script is :

#!/bin/sh

# echo "Creating " $1

if [ -e $1 ] ; then
        # File exists - lets see if its a directory
        if [ ! -d $1 ]  ; then
                echo "File exists but is not a directory"
                exit 1
        fi
else
        mkdir $1
fi

# echo "Exit"

There are two problems. Firstly, anything I echo in my shell script is
reported as an error in the mail log and the script seems to exit
immediately. 

Secondly, I get the following errors:

Error from multiplexor: error: Cannot
chdir(/var/spool/MIMEDefang/mdefang-m3R9oZVt011922)

and

Apr 27 10:50:57 britney mimedefang-multiplexor[11212]: Slave 0 stderr:
shell-init: error retrieving current directory: getcwd: cannot access
parent directories: No such file or directory
Apr 27 10:50:57 britney mimedefang-multiplexor[11212]: Slave 0 stderr:
cp:
Apr 27 10:50:57 britney mimedefang-multiplexor[11212]: Slave 0 stderr:
cannot stat `INPUTMSG'
Apr 27 10:50:57 britney mimedefang-multiplexor[11212]: Slave 0 stderr: :
No such file or directory

I suspect that this is something to do with the way that the shell
script is running.

Can anyone shed some light on this problem at all?

Many thanks all,

jON




More information about the MIMEDefang mailing list