Re: [Dovecot] AIX mail quota plugin problems + dotlock problem resolved

2007-06-05 Thread Timo Sirainen
On Tue, 2007-06-05 at 14:29 -0400, Stewart Dean wrote:
 1) The AIX quotactl subroutine is defined here(put it in the search box)
 http://publib.boulder.ibm.com/infocenter/pseries/v5r3/index.jsp
 Partial cut and paste of it:
..
 Did the trace hold any more information?

It only confirms that it should work the way I'm using it.

   Note that I didn't attach it 
 the first time I sent it to you, the second time I did.  I also resent 
 the note with the trace attached to mailing list, but the mailman 
 software said it was too big, so I canceled the second post.

I didn't notice anything wrong in the trace either. You could try
running truss for some command that reports the current user's quota and
see what's different between it and how Dovecot calls quotactl().



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


Re: [Dovecot] AIX mail quota plugin problems + dotlock problem resolved

2007-06-05 Thread Stewart Dean

1) The AIX quotactl subroutine is defined here(put it in the search box)
http://publib.boulder.ibm.com/infocenter/pseries/v5r3/index.jsp
Partial cut and paste of it:

*#include jfs/quota.h*

*int quotactl (*/Path/*,*/ Cmd/*,*/ ID/*,*/ Addr/*)*
*int*  /Cmd/ 
http://publib.boulder.ibm.com/infocenter/pseries/v5r3/topic/com.ibm.aix.basetechref/doc/basetrf2/quotactl.htm#a2qk21b0bob*,*  /ID/ 
http://publib.boulder.ibm.com/infocenter/pseries/v5r3/topic/com.ibm.aix.basetechref/doc/basetrf2/quotactl.htm#bqk2d0bob*;*
*char ** /Addr/ 
http://publib.boulder.ibm.com/infocenter/pseries/v5r3/topic/com.ibm.aix.basetechref/doc/basetrf2/quotactl.htm#oqk2310bob*, 
** /Path/ 
http://publib.boulder.ibm.com/infocenter/pseries/v5r3/topic/com.ibm.aix.basetechref/doc/basetrf2/quotactl.htm#xpk2250bob*;*



  Description

The *quotactl* subroutine enables, disables, and manipulates disk 
quotas for file systems on which quotas have been enabled.


On AIX, disk quotas are supported by the legacy Journaled File System 
(JFS) and the enhanced Journaled File System (JFS2).


The /Cmd/ parameter is constructed through use of the 
*QCMD(*/Qcmd/*,*/ type/*)* macro contained within the 
*sys/fs/quota_common.h* file. The /Qcmd/ parameter specifies the quota 
control command. The /type/ parameter specifies either user 
(*USRQUOTA*) or group (*GRPQUOTA*) quota type.


The valid values for the /Cmd/ parameter in all supported file system 
types sare:


*Q_QUOTAON*
Enables disk quotas for the file system specified by the /Path/
parameter. The /Addr/ parameter specifies a file from which to
take the quotas. The quota file must exist; it is normally created
with the *quotacheck*

http://publib.boulder.ibm.com/infocenter/pseries/v5r3/topic/com.ibm.aix.cmds/doc/aixcmds4/quotacheck.htm#a84c12e
command. The /ID/ parameter is unused. Root user authority is
required to enable quotas. By specifying the new quota file path
in the /Addr/ parameter, the *quotactl* command can also be used
to change the quota file that is being used without first
disabling disk quotas. 
*Q_QUOTAOFF*

Disables disk quotas for the file system specified by the /Path/
parameter. The /Addr/ and /ID/ arguments are unused. Root user
authority is required to disable quotas. 


Additional JFS specific values for the /Cmd/ parameter are as follows:

*Q_GETQUOTA*
Gets disk quota limits and current usage for a user or group
specified by the /ID/ parameter. The /Addr/ parameter points to a
*dqblk* buffer to hold the returned information. The *dqblk*
structure is defined in the *jfs/quota.h* file. Root user
authority is required if the /ID/ value is not the current ID of
the caller.

Did the trace hold any more information?  Note that I didn't attach it 
the first time I sent it to you, the second time I did.  I also resent 
the note with the trace attached to mailing list, but the mailman 
software said it was too big, so I canceled the second post.


2) No, nothing is remote here:
1) dovecot is running here on mercury
2) mercury is where all the inboxes and home/folder dirs physically reside
3) These /are/ exported to other machines by mercury.
4) The quotaing is running on here mercury itself as part of O/S and 
FSes; it is enabled during boot
5) rquotad runs to provide quota info to the remote machines where the 
inboxes and home/folder dirs are NFS client imported and mounted



Timo Sirainen wrote:

On Tue, 2007-06-05 at 12:30 -0400, Stewart Dean wrote:
  

quotactl(Q_GETQUOTA, /) failed: Invalid argument



So apparently this quotactl() call is wrong with AIX:

if (quotactl(root-mount-mount_path, QCMD(Q_GETQUOTA, USRQUOTA),
 root-uid, (void *)dqblk)  0) {

I don't know why though. You could try changing root-mount-mount_path
to some actual mbox file path to see if it returns errors then.

Except weren't your mailboxes NFS mounted? quotactl() doesn't work for
NFS mounts at all. For NFS you could try this instead
http://dovecot.org/patches/quota-rquotad.c

  


--

Stewart Dean, Unix System Admin, Henderson Computer Resources 
Center of Bard College, Annandale-on-Hudson, New York  12504  
[EMAIL PROTECTED]  voice: 845-758-7475, fax: 845-758-7035




Re: [Dovecot] AIX mail quota plugin problems

2007-06-03 Thread Timo Sirainen
On Wed, 2007-05-30 at 12:46 -0400, Stewart Dean wrote:
  4272 [EMAIL PROTECTED]:/usr/local/lib/dovecot/imap ## dovecot
  ILoading modules from directory: /usr/local/lib/dovecot/imap
  IModule loaded: /usr/local/lib/dovecot/imap/lib10_quota_plugin.so
  FPlugin imap_quota not found from directory /usr/local/lib/dovecot/imap
  Error: imap dump-capability process returned 89

quota is loaded OK, imap_quota isn't.

 [EMAIL PROTECTED]:/usr/local/lib/dovecot/imap ## ls -al
..
 -rwxr-xr-x   1 root system28645 May 22 15:12 
 052207-1455-64bit-ssl.lib11_imap_quota_plugin.so*

So it should be loading this.

 lrwxrwxrwx   1 root system   76 May 24 12:36 
 lib11_imap_quota_plugins.so@ - /usr/local/lib/dovecot/i

Why is it plugins? It should be plugin.



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


[Dovecot] AIX mail quota plugin problems

2007-05-30 Thread Stewart Dean

 From reading the wiki for a filesystem quota, I took my shot at
1) building my binaries using the mods in AIXPluginsSupport
2) changing dovecot.conf and
3) putting the plugins in the library
But I'm getting this error message when I invoke dovecot:

Plugin imap_quota not found from directory /usr/local/lib/dovecot
Error: imap dump-capability process returned 89

It would seem that
a) I have the syntax or the parameters wrong
b) I didn't get the changes to the AIX build environment right

I've attached the dovecot -n output.

Here are the details of what I did.

1) dovecot.conf

 === within the imap config section ===
  # Support for dynamically loadable plugins. mail_plugins is a space 
separated

  # list of plugins to load.
  #mail_plugins =
  #mail_plugin_dir = /usr/lib/dovecot/imap
  # SD 5/24/07 tryout FS quota plugin
  mail_plugins = quota imap_quota
  mail_plugin_dir = /usr/local/lib/dovecot/imap


plugin {
  # Here you can give some extra environment variables to mail processes.
  # This is mostly meant for passing parameters to plugins. %variable
  # expansion is done for all values.

  # Quota plugin. Multiple backends are supported:
  #   dirsize: Find and sum all the files found from mail directory.
  #Extremely SLOW with Maildir. It'll eat your CPU and disk 
I/O.

  #   dict: Keep quota stored in dictionary (eg. SQL)
  #   maildir: Maildir++ quota
  #   fs: Read-only support for filesystem quota
  #quota = maildir
  # SD 5/24/07 Try FS quota support
  quota = fs

I've tried it as both

mail_plugin_dir = /usr/local/lib/dovecot/imap

and

mail_plugin_dir = /usr/local/lib/dovecot

2) Both ways I see this error message:

4229 [EMAIL PROTECTED]:/usr/local/etc ## dovecot
ILoading modules from directory: /usr/local/lib/dovecot
IModule loaded: /usr/local/lib/dovecot/lib10_quota_plugin.so
FPlugin imap_quota not found from directory /usr/local/lib/dovecot
Error: imap dump-capability process returned 89

4272 [EMAIL PROTECTED]:/usr/local/lib/dovecot/imap ## dovecot
ILoading modules from directory: /usr/local/lib/dovecot/imap
IModule loaded: /usr/local/lib/dovecot/imap/lib10_quota_plugin.so
FPlugin imap_quota not found from directory /usr/local/lib/dovecot/imap
Error: imap dump-capability process returned 89
  

3) These directories have the following contents:

4292 [EMAIL PROTECTED]:/usr/local/lib/dovecot ## ls -al
total 1168
drwxr-xr-x   3 root system  512 May 24 12:36 ./
drwxr-xr-x   7 root system  512 May 21 14:31 ../
-rw-r--r--   1 root sys  292522 May 22 15:12 
052207-1455-64bit-ssl.lib10_quota_plugin.a
-rwxr-xr-x   1 root sys 904 May 22 15:12 
052207-1455-64bit-ssl.lib10_quota_plugin.la*
-rwxr-xr-x   1 root sys  270499 May 22 15:12 
052207-1455-64bit-ssl.lib10_quota_plugin.so*

drwxr-xr-x   2 root system  512 May 24 12:41 imap/
lrwxrwxrwx   1 root system   65 May 24 12:36 
lib10_quota_plugin.a@ - /usr/local/lib/dovecot/052207-1

455-64bit-ssl.lib10_quota_plugin.a
lrwxrwxrwx   1 root system   66 May 24 12:36 
lib10_quota_plugin.la@ - /usr/local/lib/dovecot/052207-

1455-64bit-ssl.lib10_quota_plugin.la*
lrwxrwxrwx   1 root system   66 May 24 12:36 
lib10_quota_plugin.so@ - /usr/local/lib/dovecot/052207-

1455-64bit-ssl.lib10_quota_plugin.so*

[EMAIL PROTECTED]:/usr/local/lib/dovecot/imap ## ls -al
total 152
drwxr-xr-x   2 root system  512 May 24 12:41 ./
drwxr-xr-x   3 root system  512 May 24 12:36 ../
-rw-r--r--   1 root system19250 May 22 15:12 
052207-1455-64bit-ssl.lib11_imap_quota_plugin.a
-rwxr-xr-x   1 root system  944 May 22 15:12 
052207-1455-64bit-ssl.lib11_imap_quota_plugin.la*
-rwxr-xr-x   1 root system28645 May 22 15:12 
052207-1455-64bit-ssl.lib11_imap_quota_plugin.so*
lrwxrwxrwx   1 root system   66 May 24 12:36 
lib10_quota_plugin.so@ - /usr/local/lib/dovecot/052207-

1455-64bit-ssl.lib10_quota_plugin.so*
lrwxrwxrwx   1 root system   75 May 24 12:36 
lib11_imap_quota_plugin.a@ - /usr/local/lib/dovecot/ima

p/052207-1455-64bit-ssl.lib11_imap_quota_plugin.a
lrwxrwxrwx   1 root system   76 May 24 12:36 
lib11_imap_quota_plugin.la@ - /usr/local/lib/dovecot/im

ap/052207-1455-64bit-ssl.lib11_imap_quota_plugin.la*
lrwxrwxrwx   1 root system   76 May 24 12:36 
lib11_imap_quota_plugins.so@ - /usr/local/lib/dovecot/i


Any suggestions?

--

Stewart Dean, Unix System Admin, Henderson Computer Resources
Center of Bard College, Annandale-on-Hudson, New York  12504
[EMAIL PROTECTED]  voice: 845-758-7475, fax: 845-758-7035


---BeginMessage---
# /usr/local/etc/dovecot.conf
listen: *:10143
ssl_listen: *:10943
disable_plaintext_auth: no
login_dir: /var/run/dovecot/login
login_executable: /usr/local/libexec/dovecot/imap-login
login_processes_count: 12
login_max_processes_count: 774
verbose_proctitle: yes
first_valid_uid: 200
mail_location: