bug-mailutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-mailutils] [Error] fileinto: cannot save to mailbox: Function n


From: Sergey Poznyakoff
Subject: Re: [bug-mailutils] [Error] fileinto: cannot save to mailbox: Function not implemented
Date: Fri, 24 Jun 2005 16:02:48 +0300

Kostas Zorbadelos <address@hidden> wrote:

> I recompiled and linked (dynamically) my program with the new
> libraries (attached is the Makefile) and...magic! The fileinto action
> worked OK. 

Wow:)
  
> The behaviour is now OK. However this keeps us from discovering the
> problem in the standard Debian packages. I will send you gdb traces
> with the standard Debian libraries if that will help.

Yes, please do. 
 
> - How can I fileinto a maildir directory? Is there any special syntax
> in the mailbox specification after the fileinto in sieve?

Fileinto uses usual mailbox URL. I.e., to divert a message to a maildir
folder, do:

        fileinto "maildir://path/to/the/folder";

There is a minor quirk here: you should use full pathname after protocol
specification (maildir://). This will be fixed in future.

> Ideally I would like the fileinto action to "understand" the type of
> mailbox if it already exists and create a default if no mailbox
> exists.

Well, there is a limited auto-detection feature for local mailboxes. If
you specify full mailbox file name without a protocol prefix, mailutils
will try do determine its type (whether it is a UNIX mailbox, MH or
Maildir folder).  

> - Where in the sources can I find the procedure that implements the
> fileinto action?

See libsieve/actions.c. The function name is sieve_action_fileinto.

> More generally: can I provide my own callback procedures (possibly
> overiding the defaults) for the sieve actions?

You cannot redefine standard Sieve actions. However, you can define your
own actions, tests and comparators. See examples/numaddr.c as a simple
example and libsieve/extensions/*.c as more sophisticated ones. The
vacation action you ask about is implemented in this manner. The
sieve functions are documented in the mailutils manual (see node
libsieve). The documentation is a bit terse, so feel free to ask if you
need any clarifications.

> - I can see a new vacation action is implemented in this version. Is
> this somewhere documented? How can I use it?

It is not yet documented. I'll certainly provide docs by the next
release. In the meantime, here is a short description:

Vacation returns a message to the sender of a message telling them that
you are currently not reading your mail. However, there are certain
conditions under which no message will be sent. These are:

1. Your mail address (or an alias, see :aliases below) is not part
of either `To:' or `Cc:' headers of the incoming message.

2. The message sender address matches one of the following regular expressions

    "address@hidden",
    "address@hidden",
    "address@hidden",
    "^OWNER-.*",
    "address@hidden",
    "address@hidden",
    "address@hidden",
    "address@hidden",

You can add more regexps to this list, see description of :addresses below.
    
3. The incoming message contains `Precedence:  bulk' or
`Precedence: junk' among its headers.

4. The message sender has already been notified by vacation within the
last 7 days. This number is configurable, see description of :days
below.

The action keeps database of senders in a DBM database in file ".vacation"
in your home directory (the file can have different suffixes, depending
on the DBM library in use), so, to use it you should configure mailutils
with one of the following switches depending on the kind of DBM library
you are using:  

  --with-gdbm   GNU DBM
  --with-db2    Berkeley DB
  --with-ndbm   NDBM
  --with-dbm    Old-style DBM

The action should be required. Add following line to your sieve source:

require "vacation";

In the simplest case, the action is used with one positional parameter,
a text of the answer to the sender. For example:

vacation "Sorry, I am on vacation now.";

The subject of the message is selected using following rules:

a. If tagged parameter :subject is given, its value is used:

vacation :subject "I am unavailable" "Sorry, I am on vacation now.";

b. Otherwise, if tagged parameter :reply_regex is present and the subject
line of the incoming message matches its value (a regular expression
match), the subject of the incoming message is used. E.g.:

vacation :reply_regex
           "^(re|odp|aw|sv|ang|sv)(\\[[0-9]+\\])?:[[:blank:]]"  ...

c. Otherwise, the reply prefix is prepended to the incoming subject. The
reply prefix can be set using tagged parameter :reply_prefix. By default
it is "Re: ".

A list of your mail aliases can be set via tagged parameter :aliases,
e.g.:

vacation :reply_prefix [ "address@hidden", "address@hidden",
                         "address@hidden" ]


To prevent vacation from answering mail coming from specific addresses,
use tagged parameter :addresses. Its value is a list of regular
expressions, for example:

vacation :addresses [ "address@hidden", "address@hidden" ];

Finally, to set the number of days during which vacation will remember
that it has already answered to a given sender, use :days tagged
parameter. Its value shoud be within 1 and 60 days.

> Sorry for the many questions.

No problem. Feel free to ask anytime.

> If there is anything I can contribute back (even in documentation or
> anything please let me know).

Thank you. Contributions are always welcome. Documentation is
actually our weak point, so if you can help improving it, it will be
highly appreciated.

> I 'll be working with mailutils for the
> development of a delivery agent to suit our custom needs so I will
> also test other sieve actions (namely reject,redirect, discard and the
> new vacation) and other Mailutils' functionalities. I intend to use as
> much of your good framework as possible. 

Great. Please keep us informed.

Regards,
Sergey




reply via email to

[Prev in Thread] Current Thread [Next in Thread]