Re: quota rules for mail users

2016-06-16 Thread mkawada

Yacine-san,

Oops, excuse me that I mistyped your name.

Once again, thanks a million Yacine-san.

Masaharu Kawada

On 2016年06月16日 13:40, mkaw...@redhat.com wrote:

Yachine-san,

I very much appreciate you giving me the very useful information on my 
question.


Masaharu Kawada

On 2016年06月15日 19:36, chaouche yacine wrote:
I personnaly use courier's maildirmake, which is a real binary unlike 
dovecote's maildirmake which is a thin bash wrapper around the linux 
mkdir command. Courier's maildirmake on the other hand has this nice 
-q option that let you specify a quota, at creation time of afterwards.


I'm using it in a script like this :

root@messagerie[CHROOT][10.10.10.20] ~/SCRIPTS/MAIL # cat 
setupquota.single


if [[ "$#" = 0 ]]
then
 echo "usage : $0 bo...@domain.com [quota en megas]"
 exit 1
fi

quota=$((1024*1024*1024)) #1Go
inbox="${1%@*}"
maildir="/var/vmail/example.domain/$inbox"
backup="/var/vmail/backup.example.domain/$inbox"

if [[ "$#" = 2 ]]
then
 quota=$((1024*1024*$2))
fi



function set_quota {
 local quota="$1"
 local dst="$2"
 echo maildirmake.courier -q "$quota"S "$dst"
 maildirmake.courier -q "$quota"S "$dst"
 echo chown vmail:vmail -R "$dst"
 chown vmail:vmail -R "$dst"
}

set_quota "$quota" "$maildir"
quota=$(( 1024 * 1024 * 1024 *  5 )) # 5Go
set_quota "$quota" "$backup"
echo 
"-"

root@messagerie[CHROOT][10.10.10.20] ~/SCRIPTS/MAIL #


And use it like this :

root@messagerie[CHROOT][10.10.10.19] ~/SCRIPTS/MAIL # 
./setupquota.single h.messamri@example.domain 1024





   From: "mkaw...@redhat.com" 
  To: dovecot@dovecot.org
  Sent: Wednesday, June 15, 2016 1:20 AM
  Subject: quota rules for mail users
Dear All,

Is it possible to make quota rules under $HOME/Maildir/* mailboxes with
a specific command such as 'edquota' when the first email arrives at the
$HOME/Maildir/{new,cur,tmp} of a user. In the below example, the 
is the one who gets an email for the first time.

&é"edquota  -p   

---man edquot---
-p, --prototype=protoname
Duplicate the quotas of the prototypical user specified for each user
specified. This is the normal mechanism used to initialize quotas for
groups of users.
---

To configure quotas in postfix/dovecot environment, it seems that you
need to use dovecot-lda plugin, and then my exact question is as 
follows:


Is it possible to automatically run any commands or scripts in order to
set a quota rule to $HOME/Maildir/* mailboxes when users receive an
email for the first time? I just found the post-login service allows you
to execute scripts after authentication in the following URL, but I have
not found the exact way to make it.

http://www.dovecot.org/list/dovecot/2009-November/044279.html

Any comments/suggestions would be greatly appreciated.







--
Masaharu Kawada


Re: quota rules for mail users

2016-06-15 Thread mkawada

Yachine-san,

I very much appreciate you giving me the very useful information on my 
question.


Masaharu Kawada

On 2016年06月15日 19:36, chaouche yacine wrote:

I personnaly use courier's maildirmake, which is a real binary unlike 
dovecote's maildirmake which is a thin bash wrapper around the linux mkdir 
command. Courier's maildirmake on the other hand has this nice -q option that 
let you specify a quota, at creation time of afterwards.

I'm using it in a script like this :

root@messagerie[CHROOT][10.10.10.20] ~/SCRIPTS/MAIL # cat setupquota.single

if [[ "$#" = 0 ]]
then
 echo "usage : $0 bo...@domain.com [quota en megas]"
 exit 1
fi

quota=$((1024*1024*1024)) #1Go
inbox="${1%@*}"
maildir="/var/vmail/example.domain/$inbox"
backup="/var/vmail/backup.example.domain/$inbox"

if [[ "$#" = 2 ]]
then
 quota=$((1024*1024*$2))
fi



function set_quota {
 local quota="$1"
 local dst="$2"
 echo maildirmake.courier -q "$quota"S "$dst"
 maildirmake.courier -q "$quota"S "$dst"
 echo chown vmail:vmail -R "$dst"
 chown vmail:vmail -R "$dst"
}

set_quota "$quota" "$maildir"
quota=$(( 1024 * 1024 * 1024 *  5 )) # 5Go
set_quota "$quota" "$backup"
echo "-"
root@messagerie[CHROOT][10.10.10.20] ~/SCRIPTS/MAIL #


And use it like this :

root@messagerie[CHROOT][10.10.10.19] ~/SCRIPTS/MAIL # ./setupquota.single 
h.messamri@example.domain 1024




   From: "mkaw...@redhat.com" 
  To: dovecot@dovecot.org
  Sent: Wednesday, June 15, 2016 1:20 AM
  Subject: quota rules for mail users

Dear All,


Is it possible to make quota rules under $HOME/Maildir/* mailboxes with
a specific command such as 'edquota' when the first email arrives at the
$HOME/Maildir/{new,cur,tmp} of a user. In the below example, the 
is the one who gets an email for the first time.

&é"edquota  -p   

---man edquot---
-p, --prototype=protoname
Duplicate the quotas of the prototypical user specified for each user
specified. This is the normal mechanism used to initialize quotas for
groups of users.
---

To configure quotas in postfix/dovecot environment, it seems that you
need to use dovecot-lda plugin, and then my exact question is as follows:

Is it possible to automatically run any commands or scripts in order to
set a quota rule to $HOME/Maildir/* mailboxes when users receive an
email for the first time? I just found the post-login service allows you
to execute scripts after authentication in the following URL, but I have
not found the exact way to make it.

http://www.dovecot.org/list/dovecot/2009-November/044279.html

Any comments/suggestions would be greatly appreciated.




--
Masaharu Kawada


quota rules for mail users

2016-06-14 Thread mkawada

Dear All,

Is it possible to make quota rules under $HOME/Maildir/* mailboxes with 
a specific command such as 'edquota' when the first email arrives at the 
$HOME/Maildir/{new,cur,tmp} of a user. In the below example, the  
is the one who gets an email for the first time.


edquota  -p   

---man edquot---
-p, --prototype=protoname
Duplicate the quotas of the prototypical user specified for each user 
specified. This is the normal mechanism used to initialize quotas for 
groups of users.

---

To configure quotas in postfix/dovecot environment, it seems that you 
need to use dovecot-lda plugin, and then my exact question is as follows:


Is it possible to automatically run any commands or scripts in order to 
set a quota rule to $HOME/Maildir/* mailboxes when users receive an 
email for the first time? I just found the post-login service allows you 
to execute scripts after authentication in the following URL, but I have 
not found the exact way to make it.


http://www.dovecot.org/list/dovecot/2009-November/044279.html

Any comments/suggestions would be greatly appreciated.

--
Masaharu Kawada


Re: password expire warning for dovecot users in IMAP/POP login

2016-06-08 Thread mkawada

Hi list,

I very much appreciate you all who gave me a help on my question.

Will check and try the stuff based on the given info from you guys.

Thanks a million!

Masaharu Kawada


On 2016年06月09日 00:26, KT Walrus wrote:

I think the easiest solution it to send a mail to the user that the password 
will expire. A cron job and a shell script should do the work.
I don't know any mechanism to send this kind of message via POP.

I agree with you. Don’t bother trying to alert the user when he logs in (where 
there is no universal client support for such alerts). But, simply send a 
notification message from a cron script to their mailbox (a couple days before 
expiration). You could mark the message as high priority/urgent just in case 
their client displays such messages more prominently than normal inbox new 
messages. IMAP or POP login is usually done by the email client in the 
background and the user isn’t necessarily even around to handle the alert. But, 
clients are used to alerting the user that they have new mail.

So, simply sending a notification message, from a cron job, to their INBOX is 
definitely the way I would go.

Kevin


On Jun 8, 2016, at 9:31 AM, Juan Bernhard  wrote:


El 08/06/2016 a las 03:37 a.m., mkaw...@redhat.com  
escribió:

Dear list,

Is it possible to give a notification about password exprire warning to
users authenticated by OpenLDAP when the users login via dovecot using
IMAP or POP? For example, when you ssh to a server and/or run
ldapsearch, you can be warned with password expire warning like below:

# ssh testuser@localhost
testuser@localhost's password:
Your password will expire in 31 minute(s).<==
Last login: Wed Jun  8 12:22:08 2016 from localhost.localdomain

]$ ldapsearch -LLL -D uid=testuser,ou=People,dc=example,dc=com -w
redhat  "cn=testuser" -e ppolicy
ldap_bind: Success (0) (Password expires in 1808 seconds)<==
dn: uid=testuser,ou=People,dc=example,dc=com

Does the same can be done for dovecot users authenticated by OpenLDAP in
IMAP/POP?


Thanks,


I think the easiest solution it to send a mail to the user that the password 
will expire. A cron job and a shell script should do the work.
I don't know any mechanism to send this kind of message via POP.

Saludos, Juan.



--
Masaharu Kawada


Re: password expire warning for dovecot users in IMAP/POP login

2016-06-08 Thread mkawada

Alec-san,

Eexcuse me for my misconception.

Anyway, appreciate your comment.

Thanks,
Masaharu Kawada


On 2016年06月08日 17:51, A.L.E.C wrote:

On 06/08/2016 10:39 AM, mkaw...@redhat.com wrote:

To make it happen, no need to add any other configurations on LDAP end
once possword policy is correctly set?

You've got me wrong. I just responded to Aki's question. ALERT feature
could be used to send the message to the client, but there's no code to
handle such LDAP password policies/notices yet.




--
Masaharu Kawada
Technical Support Engineer
Red Hat K K
Ebisu Neonato 8F
1-18 Ebisu 4-chome, Shibuya-ku
Tokyo 150-0013, Japan
Direct: +81-3-5798-8347


Re: password expire warning for dovecot users in IMAP/POP login

2016-06-08 Thread mkawada

Alec-san,

Thanks for your comment.

Please lemme make sure one more thing.

>IMAP has ALERT response which is supported by some clients.

To make it happen, no need to add any other configurations on LDAP end 
once possword policy is correctly set?


Thanks,
Masaharu Kawada

On 2016年06月08日 17:27, A.L.E.C wrote:

On 06/08/2016 10:05 AM, mkaw...@redhat.com wrote:

Whatever ways will do.  For instance, in a thunderbird mail client, a
pop-up message or notification email telling client that the password
will be expired in XX days, something like this, would be nice.

IMAP has ALERT response which is supported by some clients. I think
Thunderbird supports that. I don't think POP has such a feature, but I
wouldn't care about POP.




--
Masaharu Kawada


Re: password expire warning for dovecot users in IMAP/POP login

2016-06-08 Thread mkawada

Aki-san,

Thanks for your feedback.

Whatever ways will do.  For instance, in a thunderbird mail client, a 
pop-up message or notification email telling client that the password 
will be expired in XX days, something like this, would be nice.


Thanks,
Masaharu Kawada

On 2016年06月08日 15:49, Aki Tuomi wrote:


On 08.06.2016 09:37, mkaw...@redhat.com wrote:

Dear list,

Is it possible to give a notification about password exprire warning
to users authenticated by OpenLDAP when the users login via dovecot
using IMAP or POP? For example, when you ssh to a server and/or run
ldapsearch, you can be warned with password expire warning like below:

# ssh testuser@localhost
testuser@localhost's password:
Your password will expire in 31 minute(s).<==
Last login: Wed Jun  8 12:22:08 2016 from localhost.localdomain

]$ ldapsearch -LLL -D uid=testuser,ou=People,dc=example,dc=com -w
redhat  "cn=testuser" -e ppolicy
ldap_bind: Success (0) (Password expires in 1808 seconds)<==
dn: uid=testuser,ou=People,dc=example,dc=com

Does the same can be done for dovecot users authenticated by OpenLDAP
in IMAP/POP?


Thanks,


How would this warning get shown to people?

Aki



--
Masaharu Kawada


password expire warning for dovecot users in IMAP/POP login

2016-06-08 Thread mkawada

Dear list,

Is it possible to give a notification about password exprire warning to 
users authenticated by OpenLDAP when the users login via dovecot using 
IMAP or POP? For example, when you ssh to a server and/or run 
ldapsearch, you can be warned with password expire warning like below:


# ssh testuser@localhost
testuser@localhost's password:
Your password will expire in 31 minute(s).<==
Last login: Wed Jun  8 12:22:08 2016 from localhost.localdomain

]$ ldapsearch -LLL -D uid=testuser,ou=People,dc=example,dc=com -w 
redhat  "cn=testuser" -e ppolicy

ldap_bind: Success (0) (Password expires in 1808 seconds)<==
dn: uid=testuser,ou=People,dc=example,dc=com

Does the same can be done for dovecot users authenticated by OpenLDAP in 
IMAP/POP?



Thanks,

--
Masaharu Kawada


X-UID in mail header is removed?

2015-05-28 Thread mkawada

Dear Dovecot Mailing List,

I have 2 questions regarding dovecot and would very much appreciate if 
you would kindly give me helps.


Question 1
Is 'X-UID' no longer shown in mail header via pop3? I have checked with 
the following 3 version of dovecot packages in order to make sure if a 
message sent by dovecot have 'X-UID' in its mail header, and the result 
is that only dovecot-0.99.11-10.EL4 shows 'X-UID' and the other ones 
do not(Please see the result written in the second half of this mail).


Question 2
Is 'X-UID' used for checking if a message has already been sent to a 
user so that he never gets any duplicated mails that are already in his 
mbox? The reason why I am asking this here is that I am working on a 
problem that a user sometimes gets a duplicated mail from dovecot if the 
user keeps mails on the server as its settings. I actually thought this 
kind of thing would happen if the 'UIDL' gets corrupted or changed for 
some reasons. However, it is said that this issue never happened in 
using dovecot-0.99.11-10.EL4 which shows 'X-UID' in mail header and in 
using dovecot-2.0.9-8.el6_6.4 which does not show 'X-UID', the issue 
happens sometimes. Thus, I would like information indicating what is 
exactly used to avoid getting any duplicated messages while downloading 
a message via pop3 from dovecot.



Here is the test result I checked:

(dovecot-0.99.11-10.EL4)
]# telnet localhost 110
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
+OK dovecot ready.
user test
+OK
pass password
+OK Logged in.
list
+OK 1 messages:
1 786
.
RETR 1
+OK 786 octets
Return-Path: root@localhost.localdomain
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by localhost.localdomain (8.13.1/8.13.1) with ESMTP id t4S4dBcu006057
for test@localhost.localdomain; Thu, 28 May 2015 13:39:11 +0900
Received: (from root@localhost)
by localhost.localdomain (8.13.1/8.13.1/Submit) id t4S4dB6u006056
for test; Thu, 28 May 2015 13:39:11 +0900
Date: Thu, 28 May 2015 13:39:11 +0900
From: root root@localhost.localdomain
Message-Id: 201505280439.t4S4dB6u006056@localhost.localdomain
To: test@localhost.localdomain
Subject: test mail
X-IMAPbase: 1432787986 1
Status: O
X-UID: 1 --X-UID shown here
Content-Length: 5
X-Keywords:

test
.
UIDL
+OK
1 1432787986.1


(dovecot-1.0.7-9.el5_11.4)
]# telnet localhost 110
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
+OK Dovecot ready.
user test
+OK
pass password
+OK Logged in.
list
+OK 1 messages:
1 606
.
RETR 1
+OK 606 octets
Return-Path: root@localhost.localdomain
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by localhost.localdomain (8.13.8/8.13.8) with ESMTP id t4S27gBo007199
for test@localhost.localdomain; Thu, 28 May 2015 11:07:42 +0900
Received: (from root@localhost)
by localhost.localdomain (8.13.8/8.13.8/Submit) id t4S27fXd007197
for test; Thu, 28 May 2015 11:07:41 +0900
Date: Thu, 28 May 2015 11:07:41 +0900
From: root root@localhost.localdomain
Message-Id: 201505280207.t4S27fXd007197@localhost.localdomain
To: test@localhost.localdomain
Subject: testmail

test
.
UIDL
+OK
1 000155667888
.

(dovecot-2.0.9-8.el6_6.4)
]# telnet localhost 110
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
+OK Dovecot ready.
user test
+OK
pass password
+OK Logged in.
list
+OK 1 messages:
1 605
.
RETR 1
+OK 605 octets
Return-Path: root@localhost.localdomain
X-Original-To: test
Delivered-To: test@localhost.localdomain
Received: by localhost.localdomain (Postfix, from userid 0)
id 3629F4336A; Wed, 27 May 2015 11:34:39 +0900 (JST)
Date: Wed, 27 May 2015 11:34:39 +0900
To: test@localhost.localdomain
Subject: test mail
User-Agent: Heirloom mailx 12.4 7/29/08
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Message-Id: 20150527023439.3629F4336A@localhost.localdomain
From: root@localhost.localdomain (root)

test
.
UIDL
+OK
1 000155652c77

Thanks,
Masaharu Kawada


Re: dovecot migration

2015-01-27 Thread mkawada

Hi, Joseba-san,

I very much appreciate your help!

Thanks,

(2015年01月27日 18:06), Joseba Torre wrote:

El 27/01/15 a las 03:54, mkaw...@redhat.com escribió:

Dear List,

To migrate a dovecot server from dovecot-1.x to dovecot-2.x, then I
wonder if the UIDL format pop3_uidl_format setting is required in the
configuration file for clients not to re-download the same mails from
the migrated mail server. Currently, no UIDL format is set in
/etc/dovecot file of the one using dovecot-1.x server which means it is
commented out as default like below.

]# grep pop3_uidl_format /etc/dovecot.conf

#pop3_uidl_format = %08Xu%08Xv 

Does this mean the pop3_uidl_format is in use as %08Xu%08Xv by
default? I see the same in /etc/dovecot/conf.d/20-imap.conf of the one
using dovecot-2.x, and have not been able to find any information saying
it's the defualt setting.

Here are the questions:

1.Can we say the pop3_uidl_format = %08Xu%08Xv is the enabled default
setting? Or any ways to check the default?


You can get the current configuration with

dovecot -a

In order to get only diferences from the defaults, dovecot -n.



2.Do they need to specify anything for the pop3_uidl_format = field
for their migration in this case?


Better safe than sorry: get the current value and add the 
pop3_uidl_format line in your conf.


Env infomation:
dovecot-1.x
dovecot-2.x
mail_location = mbox

Any information/clues would be greatly appreciated.

Thanks,



Re: dovecot migration

2015-01-27 Thread mkawada

Hi, Steffen-san,

I very much appreciate your help!

Thanks,

(2015年01月27日 22:46), Steffen Kaiser wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Tue, 27 Jan 2015, mkaw...@redhat.com wrote:


To migrate a dovecot server from dovecot-1.x to dovecot-2.x, then I
wonder if the UIDL format pop3_uidl_format setting is required in the
configuration file for clients not to re-download the same mails from
the migrated mail server. Currently, no UIDL format is set in
/etc/dovecot file of the one using dovecot-1.x server which means it is
commented out as default like below.

]# grep pop3_uidl_format /etc/dovecot.conf

#pop3_uidl_format = %08Xu%08Xv 

Does this mean the pop3_uidl_format is in use as %08Xu%08Xv by
default? I see the same in /etc/dovecot/conf.d/20-imap.conf of the one
using dovecot-2.x, and have not been able to find any information saying
it's the defualt setting.

Here are the questions:

1.Can we say the pop3_uidl_format = %08Xu%08Xv is the enabled default
setting? Or any ways to check the default?


It is the default, you can verify it by

doveconf -a

(Note the -a, not -n)


2.Do they need to specify anything for the pop3_uidl_format = field
for their migration in this case?


No, usually not.

- -- Steffen Kaiser
-BEGIN PGP SIGNATURE-
Version: GnuPG v1

iQEVAwUBVMeWrnz1H7kL/d9rAQJvXAf/Y+qpqEpCwqXCYJyhm5SvtC/XazZXL/rg
XBjIEF/TGryk62rN6W6F9e4JbrLgZY90/OwmzGyFoUq4qOwsUVxgI5lQaPrTqIGO
MeMJieen5kwrLfaaVkbFhz069n58c6cp5BmFqJVp8CTF7e3cQ/1KM4qTntzDJGB6
uFmZSOTwVgZshbTlC5KvYEdMskhSg+lCEmo8FbpRGxQoMGaHOGz40KECe9DbKxHJ
ieTPtbDIZJlBIYZ1mc2olvFwtRFGT5ymFir3RB16GG8zVQZnN3Cn1LIrIJ6LwiIU
fRsww2BfNxH8cPZtqq9eOouRqNjPQJMH0VsaSQPF/lPG1DVCysqUiQ==
=yx0J
-END PGP SIGNATURE-


dovecot migration

2015-01-26 Thread mkawada
Dear List,

To migrate a dovecot server from dovecot-1.x to dovecot-2.x, then I
wonder if the UIDL format pop3_uidl_format setting is required in the
configuration file for clients not to re-download the same mails from
the migrated mail server. Currently, no UIDL format is set in
/etc/dovecot file of the one using dovecot-1.x server which means it is
commented out as default like below.

]# grep pop3_uidl_format /etc/dovecot.conf

#pop3_uidl_format = %08Xu%08Xv 

Does this mean the pop3_uidl_format is in use as %08Xu%08Xv by
default? I see the same in /etc/dovecot/conf.d/20-imap.conf of the one
using dovecot-2.x, and have not been able to find any information saying
it's the defualt setting.

Here are the questions:

1.Can we say the pop3_uidl_format = %08Xu%08Xv is the enabled default
setting? Or any ways to check the default?

2.Do they need to specify anything for the pop3_uidl_format = field
for their migration in this case?

Env infomation:
dovecot-1.x
dovecot-2.x
mail_location = mbox

Any information/clues would be greatly appreciated.

Thanks,