+ /** Build and post a new message
+ * @return postid (or -1 if the message has not been found)
+ */
+ public function post($dest, $reply, $subject, $body)
+ {
+ $hdrs = Banana::$protocole->requestedHeaders();
+ $headers = Banana::$profile['headers'];
+ $headers[$hdrs['dest']] = $dest;
+ if ($reply) {
+ $headers[$hdrs['reply']] = $reply;
+ }
+ $headers['Subject'] = $subject;
+ $msg = BananaMessage::newMessage($headers, $body);
+ if (Banana::$protocole->send($msg)) {
+ Banana::$group = ($reply ? $reply : $dest);
+ $this->loadSpool(Banana::$group);
+ return Banana::$spool->getPostId($subject);
+ }
+ return -1;
+ }
+