Ken Jones wrote:
Here is what I've come up with so far for the vpopmaild daemon.
Looking good! Can I get an early copy? I'd like to try to build the PHP object to connect with it using sockets. I think most of what you have done looks great.
You don't show any authentication commands. How do I login to the daemon?
How will the daemon report what access level the user has? I'm sure the program using the daemon will have to adapt to the rights of the current user.
How are you planning to authenticate SA users? (Where are the passwords kept.)
adduser auth: SA - no restrictions auth: DA - must match DA domain usage: adduser <[EMAIL PROTECTED]> <password> OK - on success ERROR <error code> <error message>
A SA user should be able to use
adduser <user> <password>
to create a new SA user through the interface. Or something similar, I would like to manage system users within the application.
mkdir auth: SA - restricted to vpopmail domain directories auth: DA - restricted to DA domain directory auth: U - restricted to users directory usage: mkdir <directory> OK - on success ERROR <error code> <error message>
What is <directory>, and how do I specify them. I think my favorite would be:
SA - prepend ~vpopmail/domains/ to <directory>
DA - prepend ~vpopmail/domains/mydomain/ to <directory>
U - prepend ~vpopmail/domains/mydomain/myuser/ to <directory>
On the other hand that requires the programmer on the PHP side to describe the directory differently depending on the access level of the user that is logged in. Maybe it is better to just prepend ~vpopmail/domains to the directory and require the user to send the directory part below no matter what access is available. That way I don't have to change how I specify a directory based on the user's rights.
Is there _any_ reason the daemon should ever access any file or directory above ~vpopmail/domains?
Please be sure to look up vpopmail's home directory, and not just assume it is /home/vpopmail! (Compile time is fine.)
Error Codes: Not yet defined
Where possible, pass existing error codes on, and make up all new codes so they have unique values. (Check against vpopmail and ezmlm for existing codes.)
listdomain auth: SA - list all domains auth: DA - no access, return an error auth: U - no access, return an error usage listdomain List of all domains, in alpha order, followed by an empty line, followed by OK.
NOTE: The base code for this should be placed in vpopmail itself. I am specifying alpha order because it is so easy for all of the database back ends to do, and not that much harder to do for CDB. (Yes I will handle the CDB interface to allow this. It is much like my patch to list aliases in order.)
listuser auth: SA - can list any domain auth: DA - can list own domain auth: u - no access, return an error usage listuser <domain> List all users (accounts with a maildir, and pop/imap access) in alpha order, within the domain, followed by a blank line then OK.
listalias auth: SA - can list any domain auth: DA - can list own domain auth: u - no access, return an error usage listalias <domain> List all aliases (.qmail files, or aliases stored in a database) in alpha order, using the new valias capabilities of vpopmail.
NOTE: Tom's valias support handles most of this. Add my patch for CDB and a 'ORDER BY' statement in the SQL code for the database plugins to have vpopmail return the values in the correct order.
This will use the vpopmail functions valias_select and valias_select_next.
listlist auth: SA - can list any domain auth: DA - can list own domain auth: u - no access, return an error usage listalias <domain> List all mailing lists, in alpha order within the domain. This will probably involve searching for symlinks in the Domain's directory.
I would like to get my hands on the following vpopmail functions:
Alias Handling valias_insert valias_delete valias_remove
There is no current support in vpopmail for it, but it would be very nice to have a set of functions that store and retrieve aliases in a user specified order. This does not have to be done now, but should be on the long term plan.
IP Mapping vget_ip_map vadd_ip_map vdel_ip_map vshow_ip_map
Domain Limits vget_limits vset_limits vdel_limits
Last Authentication vget_lastauth vget_lastauthip vset_lastauth
You might want to call vset_lastauth yourself, and not make it something that can be requested by the daemon. At least SA and DA users should be able to view lastauth info on their users.
And then there are mailing lists...
Right now my policy on ezmlm is to ignore it till the rest of my QmailAdmin project is complete. Sorry, I don't know much about how mailing lists are handled now, but I do feel they are important to manage from PHP.
If someone knows more about what is required, please chime in!