1 ==============================================================================
4 A mail server offering the same level of flexibility as Java Servlets.
6 The org.ibex.mail server infrastructure is designed to run within
7 Resin. This gives us immediate access to Resin's advanced features
10 - Sophisticated configuration file management in XML
11 - Expression Language expansion within configuration files
14 - Shared configuration of virtual hosts between web-apps and mail-apps
15 - Authentication infrastructure
18 ______________________________________________________________________________
21 Ibexmail is believed to be compliant with the following RFCs:
26 ______________________________________________________________________________
29 Each script is invoked with the variable 'm' bound to a message to be
30 handled. The script MUST return either a Filter or a Target which
31 will process the message next. This is a crucial property that
32 prevents mail from being lost -- a script can never "lose" a message
33 except by explicitly sending it to the target 'ibex.mail.target.dead'.
34 All methods which create new messages (such as ibex.mail.message.clone())
35 Also take a target -- the newly-created message is immediately directed
36 to the target; the current script does not get access to it.
38 The following properties are available from ibex.mail:
42 my. -- this can be read from but only written to if it is null
43 mailbox -- a mail storage object; subproperties are submailboxes; also qualifies as a Target
44 db -- a (read/write) properties file for the current user
46 freshMessageId -- returns a fresh message id every time it is read
49 props[path] -- reads a java-style properties file from [path] and allows read-write access
50 script[path] -- reads a script from 'path', parses it as a JS script, and passes the message to that script
64 dead -- drops the message on the floor; it vanishes without a trace
65 dir[path] -- uses the directory [path] as a naive file-based storage area
66 send -- sends the outgoing message via smtp
67 bounce(message) -- bounces the message
76 create -- creates a fresh Message object when read from
77 clone(m, t) -- makes a copy of message 'm' and sends it to target 't'
78 pipe(cmdline) -- pipes the message (headers and body) to the shell command 'cmdline'
87 The following tables describe the keys on objects of various types.
88 The type of an object is not visible from the JavaScript world; it is
89 provided here only for documentation purposes.
91 Note that, for example, m.headers.date is not the same as m.date; the
92 former is a string; the latter is a Date object (with subfields)
95 allHeaders [String] -- one massive string holding all the headers
96 headers [Hash] -- the *string* value of each header, keyed on header name
97 subject [String] -- the Subject: header (for convenience)
98 date [Date] -- the message's date
99 to [Address] -- the To: header as an Address object
100 from [Address] -- the From: header as an Address object
101 envelopeTo [Address] -- the SMTP "RCPT TO:" recipient
102 envelopeFrom [Address] -- the SMTP "MAIL FROM:" sender
103 replyto [Address] -- the ReplyTo: header as an Address object
104 messageid [String] -- the MessageId: header; if none is present one will be created
105 cc [Array] -- an array of Adress objects, one for each person cc'd
106 bcc [Array] -- an array of Adress objects, one for each person bcc'd
108 traces [Array] -- an array of Trace objects
110 deleted [boolean] -- the message's deleted flag
111 read [boolean] -- the message's read flag
112 answered [boolean] -- the message's answered flag
115 user [String] -- the 'user' part of 'foo <user@host.com>'
116 host [String] -- the 'host.com' part of 'foo <user@host.com>'
117 description [String] -- the 'foo' part of 'foo <user@host.com>'
120 returnPath [String] -- FIXME