[Dovecot] How to create rules?
Hi, I have dovecot installed and working fine. I would like (server
side) a rule runs on all messages and if it finds certain words in
the message it will run a script which will send a new email.
How can I create these rules? Do I need another piece of software?
Thank you,
Romeo
Romeo Theriault wrote:
In order to use sieve with dovecot, you must
- be running a very recent version (1.0.RC2 recommended)
- build dovecot with deliver (--with-deliver)
- build the sieve plugin out of cvs
- configure dovecot to use the sieve plugin
- create a sieve script for the user
- configure your LDA to use dovecot's deliver
You don't have to be running any special software to do #4; the sieve scripts are normal textfiles which will be compiled when deliver first attempts a deliver to that user. See
http://wiki.dovecot.org/LDA
for more details...
John
-- John Peacock Director of Information Research and Technology Rowman & Littlefield Publishing Group 4501 Forbes Boulevard Suite H Lanham, MD 20706 301-459-3366 x.5010 fax 301-429-5748
Thanks. I'm still a noob when it comes to building my own software
and using cvs and such. What I need to do is pretty simple so I
changed dovecot's mail storage format from mbox to Maildir, and I
think I'll just have a small perl script running from cron, to check
for what I'm looking for.
One question though: My perl script will check for the existence of a
particular string in and email and if it finds it will send a new
email and them move the old email into an IMAP folder called Old. I
think this will work fine, but I noticed that dovecot seems to keep
track of where the messages are through files called dovecot- uidlist
. Will moving around these files on dovecot without updating
these files screw it up?
Thanks,
Romeo
On Jul 12, 2006, at 3:06 PM, John Peacock wrote:
On Thu, 13 Jul 2006, Romeo Theriault wrote:
messages are through files called
dovecot-uidlist
. Will moving around these files on dovecot without updating these files screw it up?
Maildir is designed for this. You might see same warnings in the logs, e.g. consider your script moves away Dovecot tries to access concurrently.
BTW: There is a nice feature with Maildir: If you mail a local recipient, you can just drop a file into the "new" subfolder :-) That's way you can "mail" the over quota status to an user as root.
Bye,
-- Steffen Kaiser
Hello Romeo,
Romeo Theriault, 13.07.2006 (d.m.y):
Keep it simple and let procmail or maildrop do this just when the "trigger mail" arrives.
Regards, Christian Schmidt
-- Die Natur ist gnädig: Wer viel verspricht, dem schenkt sie zum Ausgleich ein schlechtes Gedächtnis. -- Bob Hope
Romeo Theriault wrote:
This sounds like a good option. Where would I set "trigger mail" up?
Romeo
will show you the way
On 2006-07-13 12:52:34 -0500, Eric wrote:
the truth is here: http://wiki.dovecot.org/LDA
sieve is more readable than procmailrc aswell
darix
-- openSUSE - SUSE Linux is my linux openSUSE is good for you www.opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Fri, 14 Jul 2006, Christian Schmidt wrote:
But AFAIK you can't run external scripts with sieve.
What's a Good Thing.
Bye,
Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux)
iD8DBQFEt4Dx+Z9vVHEIZbQRAs6QAJ9CrreyfnPjBQx5l1OmWce+lMMiaQCgistI 6c0OnnoYVGFH86VHKAovTVU= =G0d3 -----END PGP SIGNATURE-----
On Wed, 12 Jul 2006, Romeo Theriault wrote:
It depends on what the "new email" is and what to do if a mail has more than one recipient and if you also want to do something, if an user uploads a message via IMAP.
If the latter is required, go with an script, but use some heuristic, in order to skip already processed mails, unless you have only few users. (Might be good to favour Maildir over mbox, too.)
Otherwise, I'd tend to perform this action during or even before delivery. New Dovecot LDA has Sieve support, procmail is capable of doing anything (except to prepare coffee), Sendmail/MIMEDefang combo can do so during SMTP time. If you already run a SPAM detection filter, maybe you can configure it accordingly.
Actually, you can use any script or program, that can run as filter, in chain before any LDA, hence, the possibilities are wide open.
Bye,
-- Steffen Kaiser
participants (7)
-
Christian Schmidt
-
Eric
-
John Peacock
-
Marcus Rueckert
-
Peter Fern
-
Romeo Theriault
-
Steffen Kaiser