1 \documentclass{article
}
4 \newenvironment{paramlist
}
5 {\begin{list
}{\bfseries\upshape \hspace{2em
}Parameter
\arabic{paramc
}:
}
6 {\usecounter{paramc
}\setlength{\parsep}{0.0ex
}\setlength}}
9 \newcommand{\ipcmsg}[1]{{\raggedleft\bfseries\upshape #1}}
11 \author{FancyMail Project
}
12 \title{Server IPC Message Reference
}
19 \section{Introduction
}
21 This
document describes the messages that different
22 servers may interchange depending on the role they play,
23 it does not describe the format of the information or
24 the medium on wich it is transfered.
26 The messages are divided in diferent protocols, each
31 When describing the comunication examples between two process we will
32 define one process as a client (requesting a service) as the server,
33 the format to describe a message will be the following:
36 C: message name: parameter
1 ; parameter
2 ; parameter
3
37 S: message name: parameter
1 ; parameter
2 ; parameter
3
40 Where C is client and S server.
42 \section{Common Messages
}
46 A positive response to another mensage, should include a return value.
60 \section{Authentication Server
}
65 Verify if a user exist, will return "ok" is the user
66 exist, error otherwise.
74 Will authenticate a given user, will return ok if the
75 user and password are right, error otherwise.
82 \section{Mail Queue Server
}
84 \subsection{Comunication Examples
}
85 \subsubsection{Adding a message to a queue
}
87 With a given queue named "incoming" we will push a message to it,
88 where C is the client and QS is the queue server:
92 QS: ok: /tmp/fmain/queues/incoming/
212214962143124030
93 C: push: incoming ; /tmp/fmain/queues/incoming/
212214962143124030
97 \subsubsection{Getting a message from a queue
}
99 With a given queue named "incoming" we will pop a message from it,
100 where C is the client and QS is the queue server:
104 QS: ok: /tmp/fmain/queues/incoming/
212214962143124030
107 \subsubsection{Subscribing to a queue
}
109 With a given queue named "incoming" we will subscribe to it,
110 where C is the client and QS is the queue server:
113 C: subscribe: incoming ; socket://
127.0.0.1:
14001
117 Once the client is subscribed and there is new messages in the queue,
118 the queue server will connect back to the client and send the message
119 "alert", then the client may pop messages till it receives the error
125 QS: ok: /tmp/fmain/queues/incoming/
212214962143124030
130 \subsection{Messages
}
134 Request a slot from the message queue, it will send
135 back an OK response with the filename to use, this
136 filename will be the identifier the requested slot.
138 After writing the data into the file you must send back
139 a the finishing message "push", in order to move the
140 message to the queue.
148 Tell the queue server that it can move a given message to
149 the queue, this means that we finished writing the data to
150 the file and it is closed.
159 Retrieve the next message in the queue, it will return an OK
160 message with the filename.
168 Subscribe to a message queue, the subscriber will receive alerts
169 when there is new messages in the queue.
173 \item IPC Callback String
178 Remove subscription to a queue. The IPC Callback String should
179 be exactly the same as given on subscription.
183 \item IPC Callback String
186 \section{SMTP Out Server
}
188 \subsection{Comunication Examples
}
189 \subsection{Messages
}
193 Sends a message to another SMTP server.
201 \section{Mailbox Server
}
203 \subsection{Comunication Examples
}
205 \subsubsection{Listing a user mailbox
}
207 Give a mailbox server MS and a client C:
212 MS: mailinfo:
1 ;
120
213 MS: mailinfo:
2 ;
300
217 \subsection{Messages
}
221 It will return ok message with the amount of emails
222 for a given user, after that it will push n "mailinfo"
223 message. On failture it will return error.
231 Return message with a given email detail.
235 \item Message Size (in octets)
240 Store an email, it will return ok if successful and
241 begin using raw operations till read 'Data Length'
252 Retrieve an email for a given user. Should
253 return ok with the size of the email if the
254 email number is valid and then it will
255 start sending the email using raw operations.
256 If the email number is invalid will return error.
265 Delete an email for a given user. It will return
266 ok if the operation was sucessful, error otherwise
267 (when the message doesen't exist.