piping email to a script

Discussion in 'Tips/Tricks/Mods' started by rboschin, Nov 6, 2008.

  1. rboschin

    rboschin New Member

    Hi,
    is there someone who could explain me how to pass an email to a script when it arrives?
    I know how to do it with procmail but don't know about dropmail (which is the mailfilter used in ISPConfig).
    I've tried to open the custom rules box end entering a line as 'to /path/to/the/script' but this doesn't work and the email gets sent into the inbox as always.

    Any hints?
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Do you talk about ispconfig 2 or ispconfig 3? This are two different software and they work completely different.
     
  3. rboschin

    rboschin New Member

    I mean ISPConfig 3
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Please try:

    to "|/path/to/script"
     
  5. rboschin

    rboschin New Member

    It doesn't seem to work.
    I've tried with:
    to "|/var/clients/client1/web1/.filter.php"
    and with:
    to "|/usr/bin/php -q /var/clients/client1/web1/.filter.php"
    but the email continues to be inserted into the mailbox.
    This script simply creates a file, and if I execute it by hand it does it, but not when an email arrives.

    Maybe I should look at the mail log ? (where is it?)
    or maybe I should verify if ispconfig really creates the dropmail filter, since version 3 is not completely stable??

    rob
     
  6. abdi

    abdi Member

    Till, I have exactly this:

    to "|/var/www/domain.com/web/includes/getEmail.php"

    But it will not work for me, infact the I get the error

    # tail -f /var/vmail/domain.com/billing/.sieve.log
    sieve: info: started log at Oct 27 00:17:49.
    main_script: line 5: error: unknown command 'to' (only reported once at first occurence).
    main_script: error: validation failed.
    sieve: info: started log at Oct 27 00:20:53.
    main_scrip
     
  7. till

    till Super Moderator Staff Member ISPConfig Developer

    You mix up courier maildrop and dovecot sieve email filter rules. The above rule is for a courier email server with maildrop filtering, but you use a dovecot server with sieve filtering. Maildrop and sieve are two different filter languages, so you can not use a command from courier on a dovecot server.

    Dovecot and sieve that you use on your server do not support piping of emails to a shell script.
     
  8. abdi

    abdi Member

    Till could then please give me the equivalent of that with Dovecot and Sieve as adviced. Thanks alot
     
  9. till

    till Super Moderator Staff Member ISPConfig Developer

    Please see my answer above:

     

Share This Page