HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Tips/Tricks/Mods (http://www.howtoforge.com/forums/forumdisplay.php?f=19)
-   -   piping email to a script (http://www.howtoforge.com/forums/showthread.php?t=28469)

rboschin 6th November 2008 13:53

piping email to a script
 
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?

till 6th November 2008 14:37

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

rboschin 6th November 2008 15:52

I mean ISPConfig 3

till 6th November 2008 16:01

Please try:

to "|/path/to/script"

rboschin 6th November 2008 20:36

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

abdi 27th October 2012 03:33

Quote:

Originally Posted by till (Post 153917)
Please try:

to "|/path/to/script"

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

till 28th October 2012 18:43

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.

abdi 28th October 2012 18:53

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

till 28th October 2012 18:59

Please see my answer above:

Quote:

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


All times are GMT +2. The time now is 22:25.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.