Re: [Exim] Forward files

Góra strony
Delete this message
Reply to this message
Autor: Steven Lobbezoo
Data:  
Dla: exim-users
Temat: Re: [Exim] Forward files
--
[ Picked text/plain from multipart/alternative ]
(with a big RED head)
Yess, Aaaarrrrgggg!
Teaches me to READ docs.
Again sorry about this.
I now have :
--------------------------------------------------------------------------------------------------------
# Exim filter

logfile "$home/filter.log"
logwrite "One mail to ${original_local_part}@${original_domain}"
logwrite "At $tod_log"

# just as a precaution:

if error_message
then
    mail to la-franc@???
         text "$error_message \n\
               caused by message to
${original_local_part}@${original_domain} \n\
           received at $tod_log \n\
           with id $message_id:"
    seen finish
endif


if not $original_local_part is ""
then
    save    "$home/mail${lookup {${original_local_part}@${original_domain}}
lsearch*@ {$home/vmails} {/$value}\
            {${lookup {${original_domain}} lsearch {$home/vmails} {/$value}
{}}}}/inbox"
else
    save    "$home/mail${lookup {${local_part:${sg{${extract{for}{tabmaker
${sg{$h_received:}{\n}{
}}}{$value}{${extract{for}{${sg{$h_received:}{\n}{
}}}}}}}{;}{}}}@${domain:${sg{${extract{for}{tabmaker
${sg{$h_received:}{\n}{
}}}{$value}{${extract{for}{${sg{$h_received:}{\n}{ }}}}}}}{;}{}}}}
lsearch*@ {$home/vmails} {/$value}\
        {${lookup {${domain:${sg{${extract{for}{tabmaker
${sg{$h_received:}{\n}{
}}}{$value}{${extract{for}{${sg{$h_received:}{\n}{ }}}}}}}{;}{}}}}
lsearch {$home/vmails} {/$value} {}}}}/inbox"
endif


# if nothing done, then save to me!
if not delivered
then
    save $home/mail/inbox
endif
-----------------------------------------------------------------------------------------------------------------------
which seems to work fine (exept for logging, but thats normal in this
case).


Thanks a LOT for your help.

Steven


le jeu 16-05-2002 à 15:15, Philip Hazel a écrit :

    On 16 May 2002, Steven Lobbezoo wrote:


    > No, that does not wotk they are:
    >
    > $original_local_part : "la-franc" and
    > $original_domain : "server681.savantnoc.com"


    > The test message i use with /usr/lib/sendmail -bf forward < inbox is:


    Aarrgghh!! I didn't realize you were doing all this with -bf. I thought
    you were trying real deliveries. You must have missed this bit of
    documentation about -bf:


    -----------------------------------------------------------------------
    When testing a filter in this way, Exim makes up an 'envelope' for the
    message. The recipient is by default the user running the command, and so
    is the sender, but the command can be run with the -f option to supply a
    different sender. For example,


    /usr/sbin/sendmail -bf myfilter -f islington@neverwhere <test-message


    Alternatively, if the -f option is not used, but the first line of the
    supplied message is a 'From' separator from a message folder file (not the
    same thing as a "From:" header line), the sender is taken from there. If -f
    is present, the contents of any 'From' line are ignored.


    The 'return path' is the same as the envelope sender, unless the message
    contains a "Return-path:" header, in which case it is taken from there. You
    need not worry about any of this unless you want to test out features of a
    filter file that rely on the sender address or the return path.


    It is possible to change the envelope recipient by specifying further
    options. The -bfd option changes the domain of the recipient address, while
    the -bfl option changes the 'local part', that is, the part before the @
    sign. An adviser could make use of these to test someone else's filter
    file.


    The -bfp and -bfs options specify the prefix or suffix for the local part.
    These are relevant only when support for multiple personal mailboxes is
    implemented; see the description in section 30 below.
    -----------------------------------------------------------------------


    Notice the second-last paragraph.


    The -bf facility cannot do everything. It is basically intended for
    checking syntax and the simplest things that a filter can do.


    You can use the -N option to run "real" deliveries that aren't in fact
    delivered. You can also use -d to get extra debugging output while doing
    so.


    --
    Philip Hazel            University of Cambridge Computing Service,
    ph10@???      Cambridge, England. Phone: +44 1223 334714.




    --


    ## List details at http://www.exim.org/mailman/listinfo/exim-users Exim details at http://www.exim.org/ ##





--