1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
|
$Cambridge: hermes/src/prayer/docs/ACCOUNTD,v 1.2 2008/09/16 09:59:56 dpc22 Exp $
Accountd uses a simple line based protocol similar to POP or IMAP.
Data types
==========
There are two basic data types:
Tokens:
Arbitary ASCII text. URL style encoding are used for anything other
than alphanumerics e.g: Hello%20World.
Literals:
Bastardised version of IMAP literal strings used to insert arbitrary
amounts of data into a line. Example:
SOMETHING {5}CRLF
Hello {5}CRLF
World
is equivalent to SOMETHING "Hello World" in IMAP.
IMAP allows you do use literals and other string encoding interchangeably.
This isn't the case with the accountd protocol.
Protocol
========
Login
LOGIN <username :: token> <password :: token>
Password changing
PASSWORD <old :: token> <new :: token>
Gecos changing
FULLNAME <new :: token>
Both work by running a simple expect-like script against a Hermes
specific "passwd" program running at the far end of a PTY. (messy,
but easier than trying to reverse engineering Chris Thompson's code!)
I don't know if the script language is general enough for other passwd
programs. FreeBSD and generic Solaris seem to work just fine. There's
some kind of race condition or other bug which means that passwd on
Linux doesn't work reliably: I never worked out what was going on there.
Quota checking:
QUOTA
accountd cheats on Hermes: I was too lazy to write the 10 line perl
script which would translate output from the Hermes specific quota
command into the canonical form described in accountd.cf files.
Exim filter file management:
Based around (and compatible with) the intermediate format (.MSforward)
used by menu system on Hermes. This format is undocumented but simple.
Basic accounts
MAILSTATUS
Returns copy of .MSforward file as literal after running consistency
check on .forward file. Performs on the fly translation of simple
.forward files which are not Exim filter files. Example:
OK {102}
# MSforward file: change only via Hermes menu system
redirect
address dpc22@cam.ac.uk
copy true
MAILCHANGE <File :: literal>
Uploads new .MSforward file, generates .forward from it.
GET <filename :: token>
Returns given file as literal. Used to get vacation aliases and
log file.
PUT <filename :: token> <contents :: literal>
Upload file as literal. Used to upload vacation aliases.
VACATION_CLEAR
Clears vacation.log, vacation.once.dir, vacation.once.pag
|