custom sieve script

Discussion in 'ISPConfig 3 Priority Support' started by DylanPedro, Sep 5, 2018.

  1. DylanPedro

    DylanPedro Member

    Hi,

    I am trying to write a custom sieve script that sends a copy of a particular email and then files it into a folder using the following:
    Code:
    redirect :copy "[email protected]";
    fileinto "MyFolders.Other.Some Company.Invoices";
    stop;
    but keep getting the following error:
    Code:
    ispconfig: line 506: error: unknown tagged argument ':copy' for the redirect command (reported only once at first occurrence).
    ispconfig: error: validation failed.
    sieve-filter(root): Error: failed to compile sieve script '/var/vmail/example.co.uk/mail/sieve/ispconfig.sieve'
    info: filtering: [Wed, 26 Jan 2011 09:32:30 -0500; 7707 bytes] `paper bag, box, poster'.
    ./1_Scripts/sieve/bb.sh: line 3: 17896 Segmentation fault      sieve-filter -e -W -v -C -u [email protected] /var/vmail/example.co.uk/mail/sieve/ispconfig.sieve 'INBOX'
    
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Try to leave out the :copy in the line, so that it just reads:

    redirect "[email protected]";
     
  3. DylanPedro

    DylanPedro Member

    When removing the :copy part it says the following:
    Code:
    redirect action has no means to send mail..
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    That's in the sieve log? ISPCopy uses the redirect line like this when you use the 'send copy to function' of a mailbox and it works fine, so it should work like this. Or you maybe use some other sieve interpreter and not the one from dovecot that is used on ISPConfig mail servers, you added:

    redirect "[email protected]";
    fileinto "MyFolders.Other.Some Company.Invoices";
    stop;

    in the custom mailfilter field of the mailbox in ispconfig, right?
     
  5. DylanPedro

    DylanPedro Member

    Yes I added it to the custom mail filters section, then ran the filters using the following command at the terminal:
    Code:
    sieve-filter -e -W -v -C -u [email protected] /var/vmail/example.co.uk/mail/sieve/ispconfig.sieve 'INBOX'
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    That's the reason for the error message, you can not test the redirect like this. Just put the filter into the custom filter section and then send an email to the mailbox to test it.
     

Share This Page