[Dovecot] Quick question...
Hi,
Here's the scenario.
I want to set up a mailbox so that when mail sent to the address is piped to a processing application, instead of going to a mailbox.
One way I can do this is to set up a mailbox and then have an application that checks to see if there's mail and then processes it. (Old school Unix script)
Is there a way to set it up with dovecot? (Cleaner solution)
Thx
-Mike
If you don't need the message in the actual mailbox you can do that with your MTA instead.
In postfix for example you setup a custom transport in the master.cf file that calls your application. Then you setup a transport record for that particular address which is delivered to your custom transport.
-----Original Message----- From: dovecot-bounces+jkrejci=usinternet.com@dovecot.org [mailto:dovecot-bounces+jkrejci=usinternet.com@dovecot.org] On Behalf Of dovecot@segel.com Sent: Wednesday, February 25, 2009 2:29 PM To: dovecot@dovecot.org Subject: [Dovecot] Quick question...
Hi,
Here's the scenario.
I want to set up a mailbox so that when mail sent to the address is piped to a processing application, instead of going to a mailbox.
One way I can do this is to set up a mailbox and then have an application that checks to see if there's mail and then processes it. (Old school Unix script)
Is there a way to set it up with dovecot? (Cleaner solution)
Thx
-Mike
dovecot@segel.com wrote:
Hi,
Here's the scenario.
I want to set up a mailbox so that when mail sent to the address is piped to a processing application, instead of going to a mailbox.
One way I can do this is to set up a mailbox and then have an application that checks to see if there's mail and then processes it. (Old school Unix script)
Is there a way to set it up with dovecot? (Cleaner solution)
Thx
-Mike
I am sure this can be done with sieve but I am starting to learn it now ....
With procmail it's just trivial .... After making sure it is a mail destined to your application, you just pipe it there
# Last delivering recepie after spam cheks etc .... :0 | /path/to/my/processing/application
You might also have a look at ripmime ( rips mime attachements from a mail ) ... so you can combine all ....
Cheers Harry.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Wed, Feb 25, 2009 at 02:28:50PM -0600, dovecot@segel.com wrote:
Hi,
Here's the scenario.
I want to set up a mailbox so that when mail sent to the address is piped to a processing application, instead of going to a mailbox.
Conceptually, when a mail arrives there are two processes involved: the mail transfer agent (MTA) and the mail delivery agent (MDA). The mail transfer agent takes the mail from "the net" (typically from another MTA) and decides whether the mail has to be delivered locally (then it passes it on to the MDA) or remotely (then it passes it on to another MTA).
Note that Dovecot doesn't enter this picture at all (yet). Its primary job is serving up mail to end-users when it has already been delivered.
All that said, most MTAs (Postfix, Exim, Sendmail, Qmail, you name it) bring along with them delivery functions (can fill in the role of MDAs). The dovecot distribution brings along with it a delivery agent (deliver) which you can configure to play many tricks on delivery via a language designed explicitly for that (called Sieve), and there are quite powerful "third party" delivery agents (e.g. procmail).
So, to sum up your best bet would be:
if the requirements are simple, like "pipe all mail going to this user through this program", do as Justin said and tell your mail transfer agent to do that. To be able to give you any hints, I should at least know the beast by name ;-)
if the task is more complex (e.g. depending on other headers, time of day, you name it), then just tell the MTA to push it to the MDA (most come preconfigured to do that anyway, if circumstances are right) and tweak the MDA configuration to achieve that.
Hope that helps. Things can be a bit confusing at the beginning.
Regards
- -- tomás
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFJpi4yBcgs9XrR2kYRAmOkAJ9XExiCQYVbD6TrSf38qN4IxXuD5wCcDpEa Af0M7SFSpUwVhreUmozaGEk= =Vni1 -----END PGP SIGNATURE-----
Thanks,
I was thinking of doing this in dovecot because I thought about having to create virtual mailboxes 'on the fly' and then it would be nice to capture the original mail for historical/auditing purposes.
There are two ways that I could do this. I could do this using a database back end for the mailbox and then use an insert trigger, or I could do this prior to the database using deliver to process the e-mail and then store it in the database. (Instead of MySQL, I was looking at the IIUG's version of IBM's Informix. Its free for some uses ;-)
Thanks for the quick response from everyone. I just needed a point in the right direction and I was too busy focused on something else to RTFM. ;-)
-Mike
-----Original Message----- From: tomas@tuxteam.de [mailto:tomas@tuxteam.de] Sent: Wednesday, February 25, 2009 11:53 PM To: msegel@segel.com Cc: dovecot@dovecot.org Subject: Re: [Dovecot] Quick question...
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Hi,
Here's the scenario.
I want to set up a mailbox so that when mail sent to the address is
On Wed, Feb 25, 2009 at 02:28:50PM -0600, dovecot@segel.com wrote: piped to
a processing application, instead of going to a mailbox.
Conceptually, when a mail arrives there are two processes involved: the mail transfer agent (MTA) and the mail delivery agent (MDA). The mail transfer agent takes the mail from "the net" (typically from another MTA) and decides whether the mail has to be delivered locally (then it passes it on to the MDA) or remotely (then it passes it on to another MTA).
Note that Dovecot doesn't enter this picture at all (yet). Its primary job is serving up mail to end-users when it has already been delivered.
All that said, most MTAs (Postfix, Exim, Sendmail, Qmail, you name it) bring along with them delivery functions (can fill in the role of MDAs). The dovecot distribution brings along with it a delivery agent (deliver) which you can configure to play many tricks on delivery via a language designed explicitly for that (called Sieve), and there are quite powerful "third party" delivery agents (e.g. procmail).
So, to sum up your best bet would be:
if the requirements are simple, like "pipe all mail going to this user through this program", do as Justin said and tell your mail transfer agent to do that. To be able to give you any hints, I should at least know the beast by name ;-)
if the task is more complex (e.g. depending on other headers, time of day, you name it), then just tell the MTA to push it to the MDA (most come preconfigured to do that anyway, if circumstances are right) and tweak the MDA configuration to achieve that.
Hope that helps. Things can be a bit confusing at the beginning.
Regards
- -- tomás
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFJpi4yBcgs9XrR2kYRAmOkAJ9XExiCQYVbD6TrSf38qN4IxXuD5wCcDpEa Af0M7SFSpUwVhreUmozaGEk= =Vni1 -----END PGP SIGNATURE-----
participants (5)
-
dovecot@segel.com
-
Harry Lachanas
-
Justin Krejci
-
Michael Segel
-
tomas@tuxteam.de