Re: [Dovecot] namespace delivery question

2013-07-04 Thread Steffen Kaiser

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Wed, 3 Jul 2013, Laszlo Kiraly wrote:


I think you should reject incoming mails from outside to vmail and
handle all deliveries to public through local SMTP aliases. Because
"vmail" is no valid recipient anyway, isn't it?


Do you think reject in SMTP time in exim? I think, I do exactly the same.
I have a list with public mails and rewrite rules for them. I use this list in
an acl to check it's a public mailbox or not.


did you tested it ;-)


I have now a fully working system. :)


fine!

- -- 
Steffen Kaiser

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)

iQEVAwUBUdU/vF3r2wJMiz2NAQLlKgf7Bzm6I5v2TIHEamt2J/viRBlZA8etNbPI
gEkiCYpkj6tsySgDlRVCpWwF60HH2Hg1nCy8KEm28JTEaSn8xocxpE800d0KgKmo
FgbElbUE3L8IQKpVAS1ny7/Rg0lr91/e5bzll3XcGZKtstvjbeiqJcThROpZWewy
3NIyntdQLnKVjHZqvpYpd8W2ZwzaltaQJg0RLKj1nZZMHfv2xWu/ulasMZ0YBprG
ixKJRrIPwTHeEGqk8hT6kudkks+ptltVzeoL4vXT7T03gXxzJtLlSRO+7Ztpic5J
B3KxuhMqOunVjZkrZAvJnryeERac4HRqusUxB6tr4gYo+7P+BAYMbQ==
=ApuF
-END PGP SIGNATURE-


Re: [Dovecot] namespace delivery question

2013-07-03 Thread Laszlo Kiraly
> > If I rewrite i...@domain.com to vmail+public/i...@domain.com, then it saved 
> > to
> > /home/vmail/public/mailboxes/info however if I get mail to
> > vmail+public/i...@anotherdomain.com then it's saved to the same mailbox.
> >
> > How can I set dovecot to save to different mailboxes?
> 
> if both users vm...@domain.com and vm...@anotherdomain.com have 
> "append" permission to public/info,
>  vmail+public/i...@anotherdomain.com will save the message there,
>  because that's the idea of lmtp_save_to_detail_mailbox . 
> vmail+public/i...@anotherdomain.com means: do not save to INBOX of 
> vm...@anotherdomain.com, but to public/info with the permission of 
> user vm...@anotherdomain.com. That applies to all other users as well.
> 
> If you want to store i...@anotherdomain.com somewhere else, create 
> another SMTP alias to another mailbox, e.g.:
> 
> i...@anotherdomain.com -> 
> vmail+public/info-anotherdom...@anotherdomain.com

Thanks, that is the trick.

 
> I think you should reject incoming mails from outside to vmail and 
> handle all deliveries to public through local SMTP aliases. Because 
> "vmail" is no valid recipient anyway, isn't it?

Do you think reject in SMTP time in exim? I think, I do exactly the same.
I have a list with public mails and rewrite rules for them. I use this list in
an acl to check it's a public mailbox or not.
Of course vmail isn't a valid recipient.

I have now a fully working system. :)


Thank you all for the very useful answers.

Regards: Laszlo Kiraly



Re: [Dovecot] namespace delivery question

2013-07-03 Thread Steffen Kaiser

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Wed, 3 Jul 2013, Laszlo Kiraly wrote:


It mostly works.



location = sdbox:/home/vmail/public/



If I rewrite i...@domain.com to vmail+public/i...@domain.com, then it saved to
/home/vmail/public/mailboxes/info however if I get mail to
vmail+public/i...@anotherdomain.com then it's saved to the same mailbox.

How can I set dovecot to save to different mailboxes?


if both users vm...@domain.com and vm...@anotherdomain.com have "append" 
permission to public/info, vmail+public/i...@anotherdomain.com will save 
the message there, because that's the idea of lmtp_save_to_detail_mailbox 
. vmail+public/i...@anotherdomain.com means: do not save to INBOX of 
vm...@anotherdomain.com, but to public/info with the permission of user 
vm...@anotherdomain.com. That applies to all other users as well.


If you want to store i...@anotherdomain.com somewhere else, create another 
SMTP alias to another mailbox, e.g.:


i...@anotherdomain.com -> 
vmail+public/info-anotherdom...@anotherdomain.com


I think you should reject incoming mails from outside to vmail and handle 
all deliveries to public through local SMTP aliases. Because "vmail" is no 
valid recipient anyway, isn't it?


- -- 
Steffen Kaiser

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)

iQEVAwUBUdQo2F3r2wJMiz2NAQIO8ggAsnaAZaJjtClKzIYOXK2y5SvQzKdnOI03
UOeSf5e99AXWZKZSP+fC+pXra9pNQzicYYQoOabeLPCodvkGt8m2lDslksTSjN6P
fzx0HSxxns1wWgUQtLjkBrgdCoKie4irgyCMfByFDmmLjeYVCWtME1cFazUWScLq
n+x3qDSFUSHNJbN30X2/UnsIqS/HxMD/VX+8dplhX385z6ZR6XxgZHbjM28LOugS
mgfaf42eaqTf/jDgIBJzF23zhITrMb3C4cjWi3pssv/DVc1cuKFchJttdSrTEsMt
vgo791cjS+w+kuCZnZKAXiyLKzApk7akRD+kDtzcFpEeoXd5P6YhaA==
=ILOl
-END PGP SIGNATURE-


Re: [Dovecot] namespace delivery question

2013-07-03 Thread Laszlo Kiraly
Thanks Steffen,

It mostly works.

my public namespace config:
--
namespace {
type = public
prefix = public/
separator = /
location = sdbox:/home/vmail/public/
list = no
subscriptions = no
}
--

If I rewrite i...@domain.com to vmail+public/i...@domain.com, then it saved to
/home/vmail/public/mailboxes/info however if I get mail to
vmail+public/i...@anotherdomain.com then it's saved to the same mailbox.

How can I set dovecot to save to different mailboxes?


Regards: Király László


-- Original Message ---
From: Steffen Kaiser 
To: k...@madalbal.hu
Cc: dovecot@dovecot.org
Sent: Tue, 2 Jul 2013 14:28:41 +0200 (CEST)
Subject: Re: [Dovecot] namespace delivery question

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
> 
> On Thu, 27 Jun 2013, Laszlo Kiraly wrote:
> 
> > i...@domain.com <- public, readable by user2
> > us...@domain.com <- private
> > us...@domain.com <- private
> >
> > The mailboxes are virtual, authentication through pam (kerberos).
> > The public mailbox doesn't have valid kerberos account.
> >
> > I couldn't find solution in the documentation, how can I manage the email
> > delivery to the public namespace?
> >
> > There is a -m option in the lda delivery where you can give namespace 
> > prefix.
> > Maybe it's good for this, but I couldn't find any information how can I do
> > this with lmtp?
> 
> If you set:
> 
> lmtp_save_to_detail_mailbox = yes
> recipient_delimiter = #
> 
> you could alias i...@domain.com to 
> #public.mailbox.fol...@domain.com . 1st option tells LMTP to 
> use the detail (subaddress) as default mailbox, which is essentially 
> the same as the -m option of the LDA. 2nd options sets the delimiter 
> of user and detail.  must habe write permission to the folder.
> 
> Regards,
> 
> - -- 
> Steffen Kaiser



Re: [Dovecot] namespace delivery question

2013-07-02 Thread Steffen Kaiser

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Tue, 2 Jul 2013, Laszlo Kiraly wrote:


There is a -m option in the lda delivery where you can give namespace

prefix.

Maybe it's good for this, but I couldn't find any information how can I do
this with lmtp?


If you set:

lmtp_save_to_detail_mailbox = yes
recipient_delimiter = #

you could alias i...@domain.com to


What kind of alias do you think? At smtp time, like in the /etc/aliases?
Eventually, i can configure exim to accept the "#" and "/" chars in the email
address.


Yes, SMTP time aliases - exim aliases for a local address. I do this 
often.
Actually, exim might use '+' or '-' as delimiter already, I'm not sure. No 
need to use # exactly.



#public.mailbox.fol...@domain.com . 1st option tells LMTP to
use the detail (subaddress) as default mailbox, which is essentially
the same as the -m option of the LDA. 2nd options sets the delimiter
of user and detail.  must habe write permission to the folder.


- -- 
Steffen Kaiser

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)

iQEVAwUBUdLZd13r2wJMiz2NAQIICAf7BsJ2o8uUutSFCxk5gftAfRbFBWbnLrEz
i4/NVueVZLl1AyOZ5GujLDmPhvPPNS8mL9+wMs1qKT1rrJz7q5BatDCj/LMp0YVr
8d/HM6g/8U4pwjZxq54S15fs0nZDR+XmPg+q4RcB8lAU+ns36rXEDb6EZ7M2b/RM
vdNqJYWs9kVZe9WkUKrWv/scZh04dI3iutgdCkc+iMcJsSJw4TWM61RgolzN2+wd
iowUbc6X9HTNnDWziaPt78HMLNVh70BOE8uMiJtcPytxpCmMWZo48lds79i3CKdc
SLFI3oXH5P0hkHbUymCVNhI3aSJQwlu514VlVEVp9lTleH//f5C5JQ==
=9ZIT
-END PGP SIGNATURE-


Re: [Dovecot] namespace delivery question

2013-07-02 Thread Laszlo Kiraly
> > There is a -m option in the lda delivery where you can give namespace 
prefix.
> > Maybe it's good for this, but I couldn't find any information how can I do
> > this with lmtp?
> 
> If you set:
> 
> lmtp_save_to_detail_mailbox = yes
> recipient_delimiter = #
> 
> you could alias i...@domain.com to 

What kind of alias do you think? At smtp time, like in the /etc/aliases?
Eventually, i can configure exim to accept the "#" and "/" chars in the email 
address.

> #public.mailbox.fol...@domain.com . 1st option tells LMTP to 
> use the detail (subaddress) as default mailbox, which is essentially 
> the same as the -m option of the LDA. 2nd options sets the delimiter 
> of user and detail.  must habe write permission to the folder.
> 
> Regards,
> 
> - -- 
> Steffen Kaiser

Best regards: Király László


Re: [Dovecot] namespace delivery question

2013-07-02 Thread Steffen Kaiser

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Thu, 27 Jun 2013, Laszlo Kiraly wrote:


i...@domain.com <- public, readable by user2
us...@domain.com <- private
us...@domain.com <- private

The mailboxes are virtual, authentication through pam (kerberos).
The public mailbox doesn't have valid kerberos account.

I couldn't find solution in the documentation, how can I manage the email
delivery to the public namespace?

There is a -m option in the lda delivery where you can give namespace prefix.
Maybe it's good for this, but I couldn't find any information how can I do
this with lmtp?


If you set:

lmtp_save_to_detail_mailbox = yes
recipient_delimiter = #

you could alias i...@domain.com to #public.mailbox.fol...@domain.com 
. 1st option tells LMTP to use the detail (subaddress) as default mailbox, 
which is essentially the same as the -m option of the LDA. 2nd options 
sets the delimiter of user and detail.  must habe write permission 
to the folder.


Regards,

- -- 
Steffen Kaiser

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)

iQEVAwUBUdLHeV3r2wJMiz2NAQJp/Qf+JG6RYpMbgP9K+POoaP4mFHPNr2NXcLlK
RhO7GtOimZpyQZPeofStxJQwY4clRdKpKsmpMlhb1muXyvoHkB6Tn5TDO18Anqlq
/Yp8li53rsx4hVptqI84tiZrPiPX52U7FJmM/j95a+gFelTOgOPFwNoTaIIMAQau
qn1rVa4BYIhMUQTP4WJDnj+gs8Fd1LapajBcVR0yaMGkWKRLKjsOrgFzDaxQqpxk
8erJnGV68p+wEl0jnWEF2+U8XubvhqHJTbkrcBC7DsqONBzlXC7mc+xyycb+0okD
54dHI6YcSLvzDEI3uaOqoBxad4e2fvziEgYJ7Ph78aH80psAWNmu3A==
=rJPs
-END PGP SIGNATURE-


Re: [Dovecot] namespace delivery question

2013-07-01 Thread Laszlo Kiraly
Otherwise asking: can I set sieve filter per namespace?

I mean, one which is only for the public namespace.

Thanks again,
László Király

> Thank you everyone for your help, it works.
> 
> I have now one more question:
> 
> If I send mail to: i...@domain.com , cc: l.kir...@domain.com, I get 
> two emails to i...@domain.com, because of sieve_before executes this 
> script for all the mailboxes.
> 
>  How can I persuade dovecot to deliver the mail all the
> adresses (to, cc, bcc)?
> 
> Thanks again,
> László Király
> 
> -- Original Message ---
> From: Daniel Parthey 
> To: k...@madalbal.hu,dovecot@dovecot.org
> Sent: Sun, 30 Jun 2013 16:38:21 +0200
> Subject: Re: [Dovecot] namespace delivery question
> 
> > Add the :create flag to your SIEVE rule in order to automatically 
> > create mailboxes if nonexistent.
> > 
> > require "fileinto";
> > 
> > if address :is ["To","CC"] "i...@domain.com"
> > {
> > fileinto :create "public/info";
> > }
> > 
> > Regards
> > Daniel
> --- End of Original Message ---
--- End of Original Message ---



Re: [Dovecot] namespace delivery question

2013-07-01 Thread Laszlo Kiraly
Thank you everyone for your help, it works.

I have now one more question:

If I send mail to: i...@domain.com , cc: l.kir...@domain.com, I get two emails
to i...@domain.com, because of sieve_before executes this script for all the
mailboxes.

 How can I persuade dovecot to deliver the mail all the
adresses (to, cc, bcc)?

Thanks again,
László Király

-- Original Message ---
From: Daniel Parthey 
To: k...@madalbal.hu,dovecot@dovecot.org
Sent: Sun, 30 Jun 2013 16:38:21 +0200
Subject: Re: [Dovecot] namespace delivery question

> Add the :create flag to your SIEVE rule in order to automatically 
> create mailboxes if nonexistent.
> 
> require "fileinto";
> 
> if address :is ["To","CC"] "i...@domain.com"
> {
> fileinto :create "public/info";
> }
> 
> Regards
> Daniel
--- End of Original Message ---



Re: [Dovecot] namespace delivery question

2013-06-30 Thread Daniel Parthey


Add the :create flag to your SIEVE rule in order to automatically create 
mailboxes if nonexistent.

require "fileinto";

if address :is ["To","CC"] "i...@domain.com"
{
fileinto :create "public/info";
}

Regards
Daniel


Re: [Dovecot] namespace delivery question

2013-06-29 Thread Laszlo Kiraly
15045): Disconnect from local: Client quit 
(in reset)
---


-- Original Message ---
From: Thomas Leuxner 
To: dovecot@dovecot.org
Sent: Fri, 28 Jun 2013 15:37:34 +0200
Subject: Re: [Dovecot] namespace delivery question

> * Laszlo Kiraly  2013.06.27 14:20:
> 
> > I couldn't find solution in the documentation, how can I manage the email 
> > delivery to the public namespace?
> [...]
> > namespace {
> >   location = sdbox:/home/vmail/public/%u
> >   prefix = public.
> >   separator = .
> >   subscriptions = no
> >   type = public
> > }
> 
> You can use sieve for that with LMTP:
> 
> if address :is ["To","CC"] "some...@domain.tld"
> {
> fileinto "Public.Mailbox.Folder";
> }
> 
> I personally use / separators so not 100% the syntax applies to your 
> scenario.
> 
> Thomas
--- End of Original Message ---


Re: [Dovecot] namespace delivery question

2013-06-29 Thread Kiraly Laszlo
Hi Thomas,

Thank you for your answer.
I'm happy with / separators too so I changed them.

Will it work too if I rewrite "rcpt to" at transport time in exim?

For example: i...@domain.com -> Public/i...@domain.com

I have a file with email addresses for exim to distinguish public mails.
In this way I could avoid double adjustments and checks.

Best regards: Király László

-- Original Message ---
From: Thomas Leuxner 
To: dovecot@dovecot.org
Sent: Fri, 28 Jun 2013 15:37:34 +0200
Subject: Re: [Dovecot] namespace delivery question

> * Laszlo Kiraly  2013.06.27 14:20:
> 
> > I couldn't find solution in the documentation, how can I manage the email 
> > delivery to the public namespace?
> [...]
> > namespace {
> >   location = sdbox:/home/vmail/public/%u
> >   prefix = public.
> >   separator = .
> >   subscriptions = no
> >   type = public
> > }
> 
> You can use sieve for that with LMTP:
> 
> if address :is ["To","CC"] "some...@domain.tld"
> {
> fileinto "Public.Mailbox.Folder";
> }
> 
> I personally use / separators so not 100% the syntax applies to your 
> scenario.
> 
> Thomas
--- End of Original Message ---



Re: [Dovecot] namespace delivery question

2013-06-28 Thread Thomas Leuxner
* Laszlo Kiraly  2013.06.28 15:51:

> Will it work too if I rewrite "rcpt to" at transport time in exim?
> 
> For example: i...@domain.com -> Public/i...@domain.com

I only tried via sieve so far. Logic however tells me redirection/storage needs 
to occur after the LMTP stage, so I'd doubt that syntax would work.


signature.asc
Description: Digital signature


Re: [Dovecot] namespace delivery question

2013-06-28 Thread Laszlo Kiraly
Hi Thomas,

Thank you for your answer.
I'm happy with / separators too so I changed them.

Will it work too if I rewrite "rcpt to" at transport time in exim?

For example: i...@domain.com -> Public/i...@domain.com

I have a file with email addresses for exim to distinguish public mails.
In this way I could avoid double adjustments and checks.

Best regards: Király László

-- Original Message ---
From: Thomas Leuxner 
To: dovecot@dovecot.org
Sent: Fri, 28 Jun 2013 15:37:34 +0200
Subject: Re: [Dovecot] namespace delivery question

> * Laszlo Kiraly  2013.06.27 14:20:
> 
> > I couldn't find solution in the documentation, how can I manage the email 
> > delivery to the public namespace?
> [...]
> > namespace {
> >   location = sdbox:/home/vmail/public/%u
> >   prefix = public.
> >   separator = .
> >   subscriptions = no
> >   type = public
> > }
> 
> You can use sieve for that with LMTP:
> 
> if address :is ["To","CC"] "some...@domain.tld"
> {
> fileinto "Public.Mailbox.Folder";
> }
> 
> I personally use / separators so not 100% the syntax applies to your 
> scenario.
> 
> Thomas
--- End of Original Message ---



Re: [Dovecot] namespace delivery question

2013-06-28 Thread Thomas Leuxner
* Laszlo Kiraly  2013.06.27 14:20:

> I couldn't find solution in the documentation, how can I manage the email 
> delivery to the public namespace?
[...]
> namespace {
>   location = sdbox:/home/vmail/public/%u
>   prefix = public.
>   separator = .
>   subscriptions = no
>   type = public
> }

You can use sieve for that with LMTP:

if address :is ["To","CC"] "some...@domain.tld"
{
fileinto "Public.Mailbox.Folder";
}

I personally use / separators so not 100% the syntax applies to your scenario.

Thomas


signature.asc
Description: Digital signature


[Dovecot] namespace delivery question

2013-06-27 Thread Laszlo Kiraly
Hi list,

I like to have public mailboxes in addition to other private in the same 
domain, and manage the public mailbox permissions through acls.

For example:

i...@domain.com <- public, readable by user2
us...@domain.com <- private
us...@domain.com <- private

The mailboxes are virtual, authentication through pam (kerberos).
The public mailbox doesn't have valid kerberos account.

My smtp server is exim 4.80. I set the mail delivery to lmtp.

I couldn't find solution in the documentation, how can I manage the email 
delivery to the public namespace?

There is a -m option in the lda delivery where you can give namespace prefix. 
Maybe it's good for this, but I couldn't find any information how can I do 
this with lmtp?

my dovecot config:

test:~# dovecot -n
# 2.1.7: /etc/dovecot/dovecot.conf
# OS: Linux 3.0.0-1-686-pae i686 Debian squeeze/sid
managesieve_notify_capability = mailto
managesieve_sieve_capability = fileinto reject envelope encoded-character 
vacation subaddress comparator-i;ascii-numeric relational regex imap4flags 
copy include variables body enotify environment mailbox date ihave
namespace {
  location = sdbox:/home/vmail/public/%u
  prefix = public.
  separator = .
  subscriptions = no
  type = public
}
namespace inbox {
  inbox = yes
  location = sdbox:/home/vmail/private/%n
  mailbox Drafts {
auto = subscribe
special_use = \Drafts
  }
  mailbox Junk {
special_use = \Junk
  }
  mailbox Sent {
auto = subscribe
special_use = \Sent
  }
  mailbox "Sent Messages" {
special_use = \Sent
  }
  mailbox Spam {
auto = subscribe
special_use = \Junk
  }
  mailbox Trash {
auto = subscribe
special_use = \Trash
  }
  prefix =
  separator = .
}
passdb {
  driver = pam
}
plugin {
  acl = vfile
  sieve = /home/vmail/%n/.dovecot.sieve
  sieve_dir = /home/vmail/%n
  sieve_global_dir = /home/vmail/sieve
}
protocols = " imap lmtp sieve"
service managesieve-login {
  inet_listener sieve {
port = 4190
  }
  service_count = 1
}
ssl_cert =