aclemons / emailrelay

emailrelay migrated to git (unofficial) - https://svn.code.sf.net/p/emailrelay/code/ mirrored in git
http://emailrelay.sourceforge.net/
Other
32 stars 4 forks source link

filtering mails procces in 2.4.1v #4

Closed newicody closed 1 year ago

newicody commented 1 year ago

Hello, I use the emailrelay 2.4.1v. I am making a filter to processing incoming emails by home users directory (in bash).

So incoming mails coming in $spooldirectory with ".new" file extension. next my filter coming :

#!/bin/ash

envelope=$2
content=$1
path="/mnt/sdb1/spool/"

var=$(awk '{if ($1=="X-MailRelay-Authentication:"){print $2;exit}}' $envelope)

if [ -z "${var}" ];
then
    exit 1;
else
    file_envelope=$(basename $envelope .new)
    #file_envelope=$envelope
    cp -rp "$envelope" "$path""$var""/""$file_envelope"
    if [ $? -ne 0 ]
    then
        exit 1;
    else
         rm "$file_envelope"
    fi
    cp -rp "$content" "$path""$var""/"
    if [ $? -ne 0 ]
    then
        exit 1;
    else
        rm "$content"
    fi
fi
exit 0;

It's copy mail.envelope and mail.content in home directory and remove them from spool, and clean the spool, but it's stay file.envelope cause emailrelay need to rename file.envelope.new in file.envelope at the end of the filter and so return a failed error (1).

(using openwrt 23.05.0-rc4)

Its not a bug but I don't know where is the place for this.

aclemons commented 1 year ago

Hi @newicody, this repo is just a mirror of emailrelay in git. Could you please open an issue for Graeme here: https://sourceforge.net/projects/emailrelay/support

Thanks