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 Each script is invoked with the variable 'm' bound to a message to be
22 handled. The script MUST return either a Filter or a Target which
23 will process the message next. This is a crucial property that
24 prevents mail from being lost -- a script can never "lose" a message
25 except by explicitly sending it to the target 'ibex.mail.target.dead'.
26 All methods which create new messages (such as ibex.mail.message.clone())
27 Also take a target -- the newly-created message is immediately directed
28 to the target; the current script does not get access to it.
30 The following properties are available from ibex.mail:
34 my. -- this can be read from but only written to if it is null
35 mailbox -- a mail storage object; subproperties are submailboxes; also qualifies as a Target
36 db -- a (read/write) properties file for the current user
38 freshMessageId -- returns a fresh message id every time it is read
41 props[path] -- reads a java-style properties file from [path] and allows read-write access
42 script[path] -- reads a script from 'path', parses it as a JS script, and passes the message to that script
55 dead -- drops the message on the floor; it vanishes without a trace
56 dir[path] -- uses the directory [path] as a naive file-based storage area
57 send -- sends the outgoing message via smtp
58 bounce(message) -- bounces the message
68 create -- creates a fresh Message object when read from
69 clone(m, t) -- makes a copy of message 'm' and sends it to target 't'
70 pipe(cmdline) -- pipes the message (headers and body) to the shell command 'cmdline'
79 The following tables describe the keys on objects of various types.
80 The type of an object is not visible from the JavaScript world; it is
81 provided here only for documentation purposes.
83 Note that, for example, m.headers.date is not the same as m.date; the
84 former is a string; the latter is a Date object (with subfields)
87 allHeaders [String] -- one massive string holding all the headers
88 headers [Hash] -- the *string* value of each header, keyed on header name
89 subject [String] -- the Subject: header (for convenience)
90 date [Date] -- the message's date
91 to [Address] -- the To: header as an Address object
92 from [Address] -- the From: header as an Address object
93 envelopeTo [Address] -- the SMTP "RCPT TO:" recipient
94 envelopeFrom [Address] -- the SMTP "MAIL FROM:" sender
95 replyto [Address] -- the ReplyTo: header as an Address object
96 messageid [String] -- the MessageId: header; if none is present one will be created
97 cc [Array] -- an array of Adress objects, one for each person cc'd
98 bcc [Array] -- an array of Adress objects, one for each person bcc'd
100 traces [Array] -- an array of Trace objects
102 deleted [boolean] -- the message's deleted flag
103 read [boolean] -- the message's read flag
104 answered [boolean] -- the message's answered flag
107 user [String] -- the 'user' part of 'foo <user@host.com>'
108 host [String] -- the 'host.com' part of 'foo <user@host.com>'
109 description [String] -- the 'foo' part of 'foo <user@host.com>'
112 returnPath [String] -- FIXME