Re: [Dovecot] Plugins: virtuals vs acls

2016-09-20 Thread Leho Kraav
>On Fri, 2011-09-16 at 14:48 +0300, Leho Kraav wrote:
>
>How can I make `LargeMailbox` readable from a virtual without giving the
>mail client the ability to read all of `LargeMailbox` on its own?


Symlinking a hidden "secret key" mailbox name works:

1. Symlink LargeMailbox -> 
LargeMailbox.sa0yaiy9Nah0thoo5do9iew1ciJaeXahphoox4si (secret key)

2. Start using `vfile:/etc/dovecot/global-acl`

LargeMailbox.sa0yaiy9Nah0thoo5do9iew1ciJaeXahphoox4si user=Moi rwsi (hide 
mailbox, but allow modifications)
LargeMailbox.Virtual.30d user=Moi lrwsip (full list + modification permissions)

3. `LargeMailbox.Virtual.30d/dovecot-virtual`

!LargeMailbox.sa0yaiy9Nah0thoo5do9iew1ciJaeXahphoox4si (save to backing mailbox)
  all younger 2592000


Remaining excercise questions:

* any more sensible / simpler techniques available?

* any holes - is it possible for user=Moi to somehow learn the
  "secret key" name of the backing mailbox?


Re: [Dovecot] Plugins: virtuals vs acls

2016-09-19 Thread Leho Kraav
On Fri, Sep 16, 2011 at 03:03:47PM +0300, Timo Sirainen wrote:
..On Fri, 2011-09-16 at 14:48 +0300, Leho Kraav wrote:
..
..> dovecot-virtual:
..> *
..>all
..> 
..> when dovecot-acl files restrict some subset of * for a user, does 
..> dovecot respect these ACLs when collecting messages for virtual folder? 
..
..If they aren't respected, it's a bug.

(dovecot-2.2.19)

So, 5 years later, I got to implementing `dovecot-virtual` :)

I'd like to set up a `LargeMailbox/Virtual/30d` mailbox that restricts
the view of a hidden, and otherwise inaccessible `LargeMailbox` to "last
30 days" rolling window.

`dovecot-virtual` for that is simple enough, but ACL-s get in the way.

LargeMailbox ACL user=Moi none
LargeMailbox/Virtual/30d ACL user=Moi lrwsip

It looks like `docevot` is correctly restricting reading
`LargeMailbox` - user Moi is able to subscribe the mailbox, but sees
zero messages in there.

How can I make `LargeMailbox` readable from a virtual without giving the
mail client the ability to read all of `LargeMailbox` on its own?

-- 
Leho Kraav, senior technology & marketing architect
Mobile: +372-56-603673
G+: lkoogliz...@gmail.com


Re: [Dovecot] Plugins: virtuals vs acls

2011-09-16 Thread Timo Sirainen
On Fri, 2011-09-16 at 14:48 +0300, Leho Kraav wrote:

> dovecot-virtual:
> *
>all
> 
> when dovecot-acl files restrict some subset of * for a user, does 
> dovecot respect these ACLs when collecting messages for virtual folder? 

If they aren't respected, it's a bug.




[Dovecot] Plugins: virtuals vs acls

2011-09-16 Thread Leho Kraav

Hi all

dovecot-virtual:
*
  all

when dovecot-acl files restrict some subset of * for a user, does 
dovecot respect these ACLs when collecting messages for virtual folder? 
I'd like a confirmation about what I should be seeing when I start 
implementing this setup.


Re: [Dovecot] Plugins on a NFS

2010-12-16 Thread Timo Sirainen
On Thu, 2010-12-16 at 10:41 -0200, Alex Baule wrote:

> I Search in lib to see how the nfs_flush* works , and i see this too.
> 
> int nfs_safe_stat(const char *path, struct stat *buf);
> 
> can i use this too ? it's get a better handle with this + nfs_flush* before
> ?!

The nfs_safe_stat() is about automatically retrying if stat() returns
ESTALE error. They don't really happen nowadays much, if ever. It anyway
won't help at all with your problems.




Re: [Dovecot] Plugins on a NFS

2010-12-16 Thread Alex Baule
Hi timo...

I Search in lib to see how the nfs_flush* works , and i see this too.

int nfs_safe_stat(const char *path, struct stat *buf);

can i use this too ? it's get a better handle with this + nfs_flush* before
?!

Tks !


2010/12/16 Timo Sirainen 

> On Thu, 2010-12-16 at 09:30 -0200, Alex Baule wrote:
>
> > I Made a plugin that's works fine in a Normal Partition and a GlusterFS
> > enviroment too.
> > in NFS it's intermitent, some times works, some times don't.
> > Only the expunge part have this issue, i use stat to get the amont of
> hard
> > link in a file.
> > There is because of that (stat, hard link count) ?
>
> No, hard links work fine with NFS. If you have multiple servers
> accessing the same storage via NFS, then it's possible that stat()
> result is cached and the hard link count may be out of date. You could
> try running nfs_flush_attr_cache_unlocked() before the stat(), but that
> doesn't work perfectly.
>
>
>


Re: [Dovecot] Plugins on a NFS

2010-12-16 Thread Timo Sirainen
On Thu, 2010-12-16 at 09:30 -0200, Alex Baule wrote:

> I Made a plugin that's works fine in a Normal Partition and a GlusterFS
> enviroment too.
> in NFS it's intermitent, some times works, some times don't.
> Only the expunge part have this issue, i use stat to get the amont of hard
> link in a file.
> There is because of that (stat, hard link count) ?

No, hard links work fine with NFS. If you have multiple servers
accessing the same storage via NFS, then it's possible that stat()
result is cached and the hard link count may be out of date. You could
try running nfs_flush_attr_cache_unlocked() before the stat(), but that
doesn't work perfectly.




[Dovecot] Plugins on a NFS

2010-12-16 Thread Alex Baule
Hi timo.

I Made a plugin that's works fine in a Normal Partition and a GlusterFS
enviroment too.
in NFS it's intermitent, some times works, some times don't.
Only the expunge part have this issue, i use stat to get the amont of hard
link in a file.
There is because of that (stat, hard link count) ?

If is, there is some workarround to do !?

Tks Timo !!!


Re: [Dovecot] Plugins/Virtual for save searches & last 30 days incomming Email

2010-07-19 Thread Timo Sirainen
On Sat, 2010-07-17 at 21:16 +0200, No body ist Perfect wrote:
> How can i configure the virtal-dovecot (virtal folder) file for search 
> the complete Mailbox for email not older as 30 Days ?

Haven't tried, but this should work:

*
 younger 2592000

(30 days * 24 hours * 60 mins * 60 secs = 2592000 secs)




[Dovecot] Plugins/Virtual for save searches & last 30 days incomming Email

2010-07-17 Thread No body ist Perfect

Hello!
How can i configure the virtal-dovecot (virtal folder) file for search 
the complete Mailbox for email not older as 30 Days ?

Thanks a lot



Re: [Dovecot] Plugins and message file access

2010-05-26 Thread Timo Sirainen
On Mon, 2010-05-03 at 10:52 -0300, Reinaldo Matukuma wrote:
> My interest is to use the message's file name in a specific function that 
> will add some lines on it  and, after that, calculate a md5 hash of the 
> modified file.

That's not going to work. Once message is saved to a file, it must not
change in any way. You should rather change the input stream that
Dovecot's internal code sees.

> As the size flags will not correspond to the effective message size/vsize, 
> then I could change the flags using the filename too, right?

And cache file would contain broken data too. And who knows what other
problems.

> I cannot simply to pass the extra text directly on the message being received 
> because I need to do some extra validations over the full content of the 
> message before add my data on the message.

Your plugin could first save the mail to a temporary file, do its stuff,
then send the output to Dovecot.




[Dovecot] Plugins and message file access

2010-05-03 Thread Reinaldo Matukuma

Hello.

I need to know how I can get the final message file name inside a plugin like 
the zlib 2.0 plugin.

I saw another threads about zlib plugin, but don't see no one asking about this.

My interest is to use the message's file name in a specific function that will 
add some lines on it  and, after that, calculate a md5 hash of the modified 
file.

As the size flags will not correspond to the effective message size/vsize, then 
I could change the flags using the filename too, right?

This is my first approach.

But... There are another way to do this directly on message been received by 
the plugin, like pre-allocating the size/vsize flags?

I cannot simply to pass the extra text directly on the message being received 
because I need to do some extra validations over the full content of the 
message before add my data on the message.
 
Thank's Everybody
  
_
O seu navegador também te ajuda a ficar longe de vírus. Leia mais sobre 
segurança.
http://www.microsoft.com/brasil/windows/internet-explorer/?WT.mc_id=1500

Re: [Dovecot] Plugins

2009-12-14 Thread Timo Sirainen
On Mon, 2009-12-14 at 17:36 -0200, Alex Baule wrote:
> i try to do a plugin... and i see there is a lot of "hook_*" calls in
> various places
> 
> There is some documentation about this hooks ?

Like Tony said, currently no and other plugins could serve as examples.
But I'm going to write documentation about this stuff to
http://wiki.dovecot.org/Design, and there already is something about
more lowlevel stuff. Things have changed in v2.0 though and it's
somewhat easier to use and the documentation will be only about v2.0, so
you might want to consider using v2.0 :)



signature.asc
Description: This is a digitally signed message part


Re: [Dovecot] Plugins

2009-12-14 Thread Tony Rutherford
The documentation is very scarce from what I could tell.  What I ended up
doing was hunting through the example plugins...not optimal, but the best I
could do.  Besides the "hook_*" calls, the "vfuncs" defined in the
"*-private.h" files are a key as well as these are the functions you can
override.

Tony

-Original Message-
From: dovecot-bounces+tony=bluetie@dovecot.org
[mailto:dovecot-bounces+tony=bluetie@dovecot.org] On Behalf Of Alex
Baule
Sent: Monday, December 14, 2009 2:37 PM
To: dovecot@dovecot.org
Subject: [Dovecot] Plugins

Hello everyone again.

i try to do a plugin... and i see there is a lot of "hook_*" calls in
various places

There is some documentation about this hooks ?

like:

hook_mail_storage_created = is calling when the email is

and go on


Tks.




[Dovecot] Plugins

2009-12-14 Thread Alex Baule
Hello everyone again.

i try to do a plugin... and i see there is a lot of "hook_*" calls in
various places

There is some documentation about this hooks ?

like:

hook_mail_storage_created = is calling when the email is

and go on


Tks.