+/* GLOBALS */
+
+sqgetGlobalVar('mailbox', $mailbox, SQ_GET);
+sqgetGlobalVar('passed_id', $passed_id, SQ_GET, NULL, SQ_TYPE_BIGINT);
+sqgetGlobalVar('js_web', $js_web, SQ_GET);
+
+if (! sqgetGlobalVar('startMessage', $startMessage, SQ_GET) ) {
+ $startMessage = 1;
+}
+if (! sqgetGlobalVar('passed_ent_id', $passed_ent_id, SQ_GET) ) {
+ $passed_ent_id = 0;
+}
+if (! sqgetGlobalVar('js_web', $js_web, SQ_GET) ) {
+ $js_web = 0;
+}
+
+sqgetGlobalVar('compose_messages', $compose_messages, SQ_SESSION);
+
+if(! sqgetGlobalVar('composesession', $composesession, SQ_SESSION) ) {
+ $composesession = 0;
+ sqsession_register($composesession, 'composesession');
+}
+/* END GLOBALS */
+
+// js_web variable is 1 only when link opens web based report page in new window
+// and in new window menu line or extra javascript code is not needed.
+if ($js_web) {
+ displayHTMLHeader(_("SpamCop reporting"));
+ echo "<body text=\"$color[8]\" bgcolor=\"$color[4]\" link=\"$color[7]\" vlink=\"$color[7]\" alink=\"$color[7]\">\n";
+} else {
+ displayPageHeader($color,$mailbox);
+}
+
+/** is spamcop plugin disabled */
+if (! is_plugin_enabled('spamcop')) {
+ error_box(_("Plugin is disabled."));
+ // display footer (closes html tags) and stop script execution
+ $oTemplate->display('footer.tpl');
+ exit();
+}
+
+ $imap_stream = sqimap_login($username, false, $imapServerAddress, $imapPort, 0);