dbmail_acl.sh

Version 0.7: by Adam Kosmin<br> Version 0.8: by Stef Bon

Features

dbmail_acl.sh is a bash script which provides the following features:

  • Grant a specific user ACLs/subscription against a specified mailbox like INBOX, Sent, Spam and/or Thrash
  • Delete a specific user's ACL(s)/subscription from a specified mailbox
  • List mailboxes a specific user apart from the onwer has rights to, if no user is specified all shared mailboxes are shown
  • List all mailboxes onwed by a specific user, if no user is specified all mailboxes are listed.

Changes

Stef Bon: I've changed the script to add subscription not only to the “default” folder “INBOX”, but to every folder owned by mailowner.

The reason for this is that I missed the possibility to subscribe to other folders than the “INBOX”, like the “Sent” folder.

When I've uploaded it, this will be version 0.8.

Futher this version can present more information (about present mailboxes) and ACL's, and is imho more flexible.

Last, I've changed the name of the script from dbmail_acl.sh to dbmail-acl.sh, to look like the other tools like dbmail-users.

Updates

Version Date Notes
0.7 2006-09-22 Now uses column for formatting.
0.8 2008-08-27 Access to other mailbox than INBOX

To Do

  • Work with PostgreSQL
  • Work with different roles. Now full access is given to the specified user. Roles like guest, backup, owner and admin is possible. But: is it wanted???

Download

Demo

Listing acl's and mailboxes

-bash-3.00# dbmail-acl.sh list
OWNER     MAILBOX    USERID  LOOKUP  READ  SEEN  WRITE  INSERT  POST  CREATE  DELETE  ADMIN
spam      INBOX      admin   1       1     0     0      0       0     0       1       0
sbon      INBOX      admin   1       1     1     1      1       1     1       1       1
sofia     spam       admin   1       1     1     1      1       1     1       1       1
sbon      Sent  items   admin   1     1     1      1       1     1       1       1      1
sbon      spam       admin   1       1     0     0      0       0     0       1       0
sbon      Trash      admin   1       1     1     1      1       1     1       1       1
-bash-3.00# dbmail-acl.sh list acl sbon
OWNER     MAILBOX    USERID  LOOKUP  READ  SEEN  WRITE  INSERT  POST  CREATE  DELETE  ADMIN
sbon      INBOX      admin   1       1     1     1      1       1     1       1       1
sbon      Sent  items   admin   1     1     1      1       1     1       1       1      1
sbon      spam       admin   1       1     0     0      0       0     0       1       0
sbon      Trash      admin   1       1     1     1      1       1     1       1       1
-bash-3.00# dbmail-acl.sh list mailbox sbon
Concepten
Drafts
INBOX
Sent
spam
Tele2
Trash
Sent
items

(here a known bug with space in the name of the mailbox: Sent items on two lines)

Adding and removing acl's

-bash-3.00# dbmail-acl.sh add admin sofia '*'
Adding (full) acl rights for 4011 to 35.
Adding subscription of 4011 to 35.
Adding (full) acl rights for 4011 to 14.
Adding subscription of 4011 to 14.
Adding (full) acl rights for 4011 to 28.
Adding subscription of 4011 to 28.
Adding (full) acl rights for 4011 to 34.
Adding subscription of 4011 to 34.
-bash-3.00# dbmail-acl.sh list acl sofia
OWNER  MAILBOX    USERID  LOOKUP  READ  SEEN  WRITE  INSERT  POST  CREATE  DELETE  ADMIN
sofia  INBOX      admin   1       1     1     1      1       1     1       1       1
sofia  spam       admin   1       1     1     1      1       1     1       1       1
sofia  Sent  items   admin   1     1     1      1       1     1       1       1      1
sofia  Concepten  admin   1       1     1     1      1       1     1       1       1
-bash-3.00# dbmail-acl.sh del admin sofia Concepten
Removing (full) acl rights for 4011 to 35.
Deleting subscription of 4011 from 35.
-bash-3.00# dbmail-acl.sh list acl sofia
OWNER  MAILBOX    USERID  LOOKUP  READ  SEEN  WRITE  INSERT  POST  CREATE  DELETE  ADMIN
sofia  INBOX      admin   1       1     1     1      1       1     1       1       1
sofia  spam       admin   1       1     1     1      1       1     1       1       1
sofia  Sent  items   admin   1     1     1      1       1     1       1       1      1
 
dbmail_acl.sh.txt · Last modified: 2011/08/29 05:56 by michaelbibby
 
DBMail is developed by Paul J Stevens together with developers world-wide