[Dovecot] Delivery notifications
I'm working on an application that is backed by Postfix 2.3.8 and
Dovecot 1.0.13, configured with virtual domains, for handling messaging.
I need to be able to send the notification (such as "You've received a
new message on SomeAwesomeService. Click here to check it out", It's
evil, I know) to a different email address, such as a mobile device.
Eventually, we want to do other things like clear web page caches when
a message is received, or sending IM notifications, but that's for
another day.
So basically, we want to notify our application whenever a new mail is
received, and it can do all the magical things that it needs to do.
I was hoping to get some feedback on the different approaches I'm
looking at. From what I can tell, there's not a way to deliver to
multiple virtual transports in postfix, so here's the options I see:
Content filter I could set up a "content filter" that just delivers the mail to the
application, and then re-injects it back into postfix. This seems like
more work than the other options just because I have to worry about re- injecting the messageIntercept delivery Replace the dovecot deliver command with a custom one that calls the
dovecot deliver and then passes the message on to the application.
I've written a little proof of concept for this and it seems to work,
but just seem shady.Sieve Dovecot supports Sieve, so I could just have a global sieve script
that sends the notifications. This is definitely the solution I'm
leaning towards.
Are there any better options? Do you think this will have a
significant impact on performance? Am I crazy?
Thanks, Brandon
on 7-24-2008 9:03 AM Brandon Keepers spake the following:
I'm working on an application that is backed by Postfix 2.3.8 and Dovecot 1.0.13, configured with virtual domains, for handling messaging.
I need to be able to send the notification (such as "You've received a new message on SomeAwesomeService. Click here to check it out", It's evil, I know) to a different email address, such as a mobile device. Eventually, we want to do other things like clear web page caches when a message is received, or sending IM notifications, but that's for another day.
So basically, we want to notify our application whenever a new mail is received, and it can do all the magical things that it needs to do.
I was hoping to get some feedback on the different approaches I'm looking at. From what I can tell, there's not a way to deliver to multiple virtual transports in postfix, so here's the options I see:
Content filter I could set up a "content filter" that just delivers the mail to the application, and then re-injects it back into postfix. This seems like more work than the other options just because I have to worry about re-injecting the message
Intercept delivery Replace the dovecot deliver command with a custom one that calls the dovecot deliver and then passes the message on to the application. I've written a little proof of concept for this and it seems to work, but just seem shady.
Sieve Dovecot supports Sieve, so I could just have a global sieve script that sends the notifications. This is definitely the solution I'm leaning towards.
Are there any better options? Do you think this will have a significant impact on performance? Am I crazy?
Thanks, Brandon In my opinion (which is worth every penny you didn't pay for it) If I want notices of my new messages on a phone or other mobile device, I might as well just get the message sent or copied there.
-- MailScanner is like deodorant... You hope everybody uses it, and you notice quickly if they don't!!!!
On Jul 24, 2008, at 12:09 PM, Scott Silva wrote:
on 7-24-2008 9:03 AM Brandon Keepers spake the following:
In my opinion (which is worth every penny you didn't pay for it) If
I want notices of my new messages on a phone or other mobile
device, I might as well just get the message sent or copied there.
I agree 100%, unfortunately I haven't convinced my client of that yet,
so I'm doing my due diligence in researching the options.
Brandon Keepers wrote:
I'm working on an application that is backed by Postfix 2.3.8 and Dovecot 1.0.13, configured with virtual domains, for handling messaging.
I need to be able to send the notification (such as "You've received a new message on SomeAwesomeService. Click here to check it out", It's evil, I know) to a different email address, such as a mobile device. Eventually, we want to do other things like clear web page caches when a message is received, or sending IM notifications, but that's for another day.
as you say, it's evil... you can try to reduce the "evilness" by not doing the notification in real time. I mean take few minutes so that you send one notification if you get multiple messages during a short period of time.
So basically, we want to notify our application whenever a new mail is received, and it can do all the magical things that it needs to do.
I was hoping to get some feedback on the different approaches I'm looking at. From what I can tell, there's not a way to deliver to multiple virtual transports in postfix, so here's the options I see:
you can use virtual_alias_maps or one of the bcc options to deliver a copy of the message to a mailbox that does what you want.
Content filter I could set up a "content filter" that just delivers the mail to the application, and then re-injects it back into postfix. This seems like more work than the other options just because I have to worry about re-injecting the message
Intercept delivery Replace the dovecot deliver command with a custom one that calls the dovecot deliver and then passes the message on to the application. I've written a little proof of concept for this and it seems to work, but just seem shady.
This is better. just make sure to pass arguments "securely". once you do your notification, simply run dovecot with the same command line args as you would use in master.cf.
- Sieve Dovecot supports Sieve, so I could just have a global sieve script that sends the notifications. This is definitely the solution I'm leaning towards.
I don't know if you can exec from dovecot-sieve.
Are there any better options? Do you think this will have a significant impact on performance? Am I crazy?
depends on how much they pay :)
Brandon Keepers wrote:
Are there any better options? Do you think this will have a significant impact on performance? Am I crazy?
Simple solution - in case you are useing maildir: incron (http://inotify.aiken.cz/?section=incron&page=about&lang=en) it's inotify based cron daimon; you can hande new message events this way.
Thanks, Brandon Uldis
participants (4)
-
Brandon Keepers
-
mouss
-
Scott Silva
-
Uldis Pakuls