============================================================================== org.ibex.mail A mail server offering the same level of flexibility as Java Servlets. The org.ibex.mail server infrastructure is designed to run within Resin. This gives us immediate access to Resin's advanced features including: - Sophisticated configuration file management in XML - Expression Language expansion within configuration files - JNI-driven SSL - Thread pooling - Shared configuration of virtual hosts between web-apps and mail-apps - Authentication infrastructure ______________________________________________________________________________ Compliance Ibexmail is believed to be compliant with the following RFCs: - ______________________________________________________________________________ JavaScript API Each script is invoked with the variable 'm' bound to a message to be handled. The script MUST return either a Filter or a Target which will process the message next. This is a crucial property that prevents mail from being lost -- a script can never "lose" a message except by explicitly sending it to the target 'ibex.mail.target.dead'. All methods which create new messages (such as ibex.mail.message.clone()) Also take a target -- the newly-created message is immediately directed to the target; the current script does not get access to it. The following properties are available from ibex.mail: ibex.mail. my. -- this can be read from but only written to if it is null mailbox -- a mail storage object; subproperties are submailboxes; also qualifies as a Target db -- a (read/write) properties file for the current user freshMessageId -- returns a fresh message id every time it is read props[path] -- reads a java-style properties file from [path] and allows read-write access script[path] -- reads a script from 'path', parses it as a JS script, and passes the message to that script filter. anonymize html2text pgp singleUseAddress returnReciept dcc vipul spamAssassin vacation target. dead -- drops the message on the floor; it vanishes without a trace dir[path] -- uses the directory [path] as a naive file-based storage area send -- sends the outgoing message via smtp bounce(message) -- bounces the message darcs(repo) procmail(procmailrc) lmtp(path) sms(phone#) fax(phone#) nntp(group) message. create -- creates a fresh Message object when read from clone(m, t) -- makes a copy of message 'm' and sends it to target 't' pipe(cmdline) -- pipes the message (headers and body) to the shell command 'cmdline' crypto. base36 .decode .encode The following tables describe the keys on objects of various types. The type of an object is not visible from the JavaScript world; it is provided here only for documentation purposes. Note that, for example, m.headers.date is not the same as m.date; the former is a string; the latter is a Date object (with subfields) Message allHeaders [String] -- one massive string holding all the headers headers [Hash] -- the *string* value of each header, keyed on header name subject [String] -- the Subject: header (for convenience) date [Date] -- the message's date to [Address] -- the To: header as an Address object from [Address] -- the From: header as an Address object envelopeTo [Address] -- the SMTP "RCPT TO:" recipient envelopeFrom [Address] -- the SMTP "MAIL FROM:" sender replyto [Address] -- the ReplyTo: header as an Address object messageid [String] -- the MessageId: header; if none is present one will be created cc [Array] -- an array of Adress objects, one for each person cc'd bcc [Array] -- an array of Adress objects, one for each person bcc'd resent *FIXME* traces [Array] -- an array of Trace objects deleted [boolean] -- the message's deleted flag read [boolean] -- the message's read flag answered [boolean] -- the message's answered flag Address user [String] -- the 'user' part of 'foo ' host [String] -- the 'host.com' part of 'foo ' description [String] -- the 'foo' part of 'foo ' Trace returnPath [String] -- FIXME FIXME