Index: openacs-4/packages/webmail-system/README
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/README,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/README 6 Jun 2006 14:35:10 -0000 1.1
@@ -0,0 +1,22 @@
+# ------------------------------------------------------------------------- #
+# IMAP WEBMAIL SYSTEM #
+# #
+# AUTHOR: Ayman Mohamed #
+# Nima Mazloumi #
+# EMAIL: mo2mo@hotmail.com #
+# mazloumi@uni-mannheim.de #
+# DATE: August 15th, 2004 #
+# #
+# ------------------------------------------------------------------------- #
+
+# --------------------------------- README -------------------------------- #
+
+Within this package are contained some README's which should be read
+before trying to proceed with this package in any form.
+
+Check the following:
+
+1. www/help/USER-README for Webmail usage help
+2. www/doc/DEVELOPER-README for Webmail installation and development
+
+# ---------------------------------- EOF ---------------------------------- #
Index: openacs-4/packages/webmail-system/webmail-system.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/webmail-system.info,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/webmail-system.info 6 Jun 2006 14:35:10 -0000 1.1
@@ -0,0 +1,35 @@
+
+
+
+
+ Webmail System
+ Webmail System
+ f
+ f
+
+
+ Nima Mazloumi
+ Ayman Mohamed
+ This is a Webmail System which allows users to access their email accounts online through a browser using an IMAP server.
+ 2006-06-06
+ Universität Mannheim
+ This is a Webmail System which allows users to access their email accounts online through a browser using an IMAP server.
+ 0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: openacs-4/packages/webmail-system/catalog/webmail-system.de_DE.ISO-8859-1.xml
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/catalog/webmail-system.de_DE.ISO-8859-1.xml,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/catalog/webmail-system.de_DE.ISO-8859-1.xml 6 Jun 2006 14:35:11 -0000 1.1
@@ -0,0 +1,212 @@
+
+
+
+ Kontenverwaltung
+ Konto ge�ndert
+ Konto erstellt
+ Konto besteht bereits
+ Konten
+ Konten
+ Aktion
+ aktiv
+ Aktive Sitzung geschlossen
+ Konto hinzuf�gen
+ Kontakt hinzuf�gen
+ Server hinzuf�gen
+ Signature erstellen
+ vCard hinzuf�gen
+ Kontakt hinzuf�gen
+ Konto wird hinzugef�gt
+ Verwalten
+ Alle Konten wurden gel�scht...
+ Alle Addressb�cher wurden gel�scht...
+ Alle Server wurden gel�scht...
+ Alle Benutzereinstellungen wurden gel�scht...
+ JavaScript erlauben
+ Host anh�ngen
+ Sind Sie sicher, dass Sie JavaScript erlauben m�chten?
+ Anlage
+ Anlagen
+ Authentifizierung
+ Authentifizierungstyp
+ Falsches Konto oder der Server reagiert nicht
+ Falsche Email
+ Inhalt
+ �ndern
+ Weiter zur Anmeldung
+ Schlie�en
+ Sitzung zu %old_server% wurde beendet
+ Problem mit der Verbindung. Bitte Seite neuladen
+ Email schreiben
+ Neue Email
+ Nachricht verfassen
+ Verbunden mit <a href="retrieve" class="button"> %neat_name%</a>
+ Kontakt
+ Kontakt hinzuf�gen
+ Kontakt ge�ndert
+ Kontakt gel�scht
+ Kontakte verwalten
+ F�r weitere Informationen setzen Sie sich mit Ihrem Sytemadministrator in Verbindung.
+ Kontakte
+ Ko<u>n</u>takte
+ Erstellen
+ Neues Verzeichnis erstellen
+ Verzeichnis anlegen
+ Aktuelles Verzeichnis:
+ Datum
+ Standard
+ Standard Signatur
+ L�schen
+ Verzeichnis l�schen
+ Ausgew�hlte Email l�schen
+ Verzeichnis l�schen
+ Je nach Provider kann dies eine Weile dauern...
+ Kopfzeile anzeigen
+ Wollen Sie wirklich alle Eintr�ge im Webmailsystem l�schen?
+ Konto bearbeiten
+ Bearbeiten
+ Server bearbeiten
+ Kontakt bearbeiten
+ E-mail
+ %contacts.first_name% schreiben
+ %contacts.first_names% schreiben
+ Ende der urspr�nglichen Nachricht
+ Tragen Sie einen kurzen Namen f�r diesen Dienst ein.
+ Fehler: Nicht angemeldet.
+ Fehler: Der ausgew�hlte Benutzer konnte aufgrund bestehender Referenzen nicht gel�scht werden.
+ Beenden
+ Dateigr��e
+ Typ
+ Dateiname
+ Name
+ Name
+ Verzeichnis
+ Verzeichnisse verwalten
+ Verzeichnisname
+ Verzeichnisse
+ Verzeichnisse
+ Weiterleiten
+ Von
+ HTML
+ Funktion noch nicht implementiert.
+ WG:
+ Ihre Nachrichten werden bezogen
+ Hilfe
+ <u>H</>ilfe
+ Kopfzeile verbergen
+ Hostadresse
+ Wie soll HTML dargestellt werden? So wie es ist, ohne Styleinformationen, als optmierter Text oder einfacher Text?
+ HTML ohne CSS
+ IMAP-Adresse
+ IMAP-Adresse
+ IMAP-Server
+ Posteingang
+ Postfach
+ <li>Um die Liste der aktuellen Emails einzusehen bitte auf 'Posteingang' klicken.<li>Dieser Link f�hrt Sie zu Ihrem Postfach.
+ Nachname
+ Anmelden
+ <li>Zuerst muss eine g�ltige Kennung angeben (in der Regel ein Wort) werden, dann <li>ein g�ltiges Passwort. Schlie�lich ist<li>der entsprechenden IMAP-Server auszuw�hlen und <li>anschlie�end auf "Anmelden" zu klicken.
+ Kennung
+ Abmelden
+ Abme<u>l</u>den
+ Der Benutzer kann durch ein Klick auf "Abmelden" eine laufenden Webmail-Sitzung beenden.
+ Gr��e auf %size% Bytes begrenzt.
+ Navigationsleiste
+ N�chste
+ Spitzname besteht bereits
+ Spitzname
+ Nr.
+ Nein
+ Keine aktive Sitzung
+ Kein Betreff
+ Konto existiert nicht
+ Folgendes kann passiert sein:
+ Nur einfacher Text ist hier gestattet.
+ Urspr�ngliche Nachricht
+ Passwort
+ Bitte geben Sie die Daten f�r den neuen Kontakt an:
+ Bitte f�hren Sie die entsprechenden �nderungen durch:
+ Bitte geben Sie den Namen des zu erstellenden Verzeichnisses an:
+ Bitte geben Sie hier die notwendigen Konteneinstellungen ein:
+ Bitte f�llen Sie die entsprechenden Angaben zum IMAP-Server aus:
+ Bitte gehen Sie hier die notwendigen Servereinstellungen ein:
+ Bitte melden Sie sich an.
+ Bitte w�hlen Sie den IMAP-Server aus, den Sie entfernen m�chten:
+ Bitte w�hlen Sie das Verzeichnis aus, das Sie l�schen m�chten:
+ Bitte w�hlen Sie den Benutzer aus, den Sie entfernen m�chten:
+ Einstellungen
+ Einstellungen
+ Einstellungen wurden ge�ndert
+ Weiter
+ <A HREF="view?number=%prev_num%" alt="Zur�ck"><<</a> %number% of %msg% |
+ <A HREF="view?number=%prev_num%" alt="Zur�ck"><<</a> %number% of %msg% <A HREF="view?number=%next_num%" alt="Weiter"> >>
+ Drucken
+ Aw:
+ Entfernen
+ Konto l�schen
+ L�schen
+ Server entfernen
+ Benutzer entfernen
+ Kontakt entfernen
+ Antworten
+ Emails werden bezogen
+ Senden
+ Absender
+ verschicken
+ Serveradministration
+ Serverhost
+ Servername
+ Server
+ Parameter setzen
+ Soll JavaScript in Nachrichten, die Sie empfangen erlaubt werden?
+ <u>S</u>ignatur
+ Betreff
+ Vielen Dank f�r die Nutzung von IMAP-Webmail.
+ Standard IMAP Port ist 143.
+ Die folgenden Aufgaben sind f�r Webmail-Administratoren verf�gbar:
+ Dieses Dokument hilft Ihnen die Funktionsweisen von Webmail kennen zu lernen. Nachfolgend werden die wesentlichen Aktivit�ten beschrieben:
+ Die nachfolgenden Aktivit�ten k�nnen nur bei erfolgreicher Anmeldung durchgef�hrt werden.
+ Kennung oder Passwort sind ung�ltig.
+ Sie haben keine Kontakte gespeichert.
+ Dieses Konto besteht bereits
+ <font color="red"><b>Es handelt sich hierbei um eine nicht r�ckg�ngig machbare Handlung. Sie sollten daher wissen, was Sie tun!</b></font>
+ Diese Seite kann nicht ohne eine g�ltige Anmeldung aufgerufen werden.
+ Dieser Dienst ist zurzeit nicht verf�gbar.
+ An
+ (%total_msgs% Nachrichten, %recent_msgs% aktuelle)
+ Typ
+ Eine Verbindung mit dem Server war nicht m�glich
+ Eine Verbindung mit dem Server war nicht m�glich!
+ Benutzer
+ Benutzer-Kontakte
+ Benutzerhilfe
+ Benutzer ist nicht angemeldet.
+ Benutzereinstellungen
+ Kennung
+ Benutzerkonten
+ Nachricht ansehen
+ Die Seite wird automatisch geladen, sobald alle Nachrichten bezogen sind.
+ Webmail-Administration
+ Wilkommen
+ Wilkommen bei IMAP-Webmail
+ Ja
+ Sie sind noch nicht angemeldet.
+ Sie sind nicht angemeldet.
+ Sie k�nnen hier Ihre Zugangsdaten �ndern:
+ Sie k�nnen hier eine Signatur erstellen.
+ Sie k�nnen hier alle Eintr�ge des Webmail-Systems l�schen:
+ Sie k�nnen hier eine vCard hochladen.
+ Dieses Element kann nicht ge�ndert werden.
+ Ihnen fehlt die Berechtigung ein Konto zu erstellen.
+ Sie haben keine neuen Nachrichten.
+ Sie haben keine neuen Nachrichten (Insgesamt %total_msgs%)
+ Sie haben die maximal zul�ssige Anzahl der Konten (%max_servers%) erreicht.
+ Sie haben %recent_msgs% neue Nachricht.
+ Sie haben %recent_msgs% neue Nachrichten.
+ Sie haben %recent_msgs% Nachrichten (Insgesamt %total_msgs%)
+ Die Webmail-Sitzung ist abgelaufen.
+ Ihre Emailadress muss mit '%host_addr%' enden.
+ Ihre Email wurde verschickt
+ Die Datei ist gr��er als die maximal zul�ssige Gr��e von %size% Bytes.
+ Ihr Postfach ist leer.
+
Index: openacs-4/packages/webmail-system/catalog/webmail-system.en_US.ISO-8859-1.xml
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/catalog/webmail-system.en_US.ISO-8859-1.xml,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/catalog/webmail-system.en_US.ISO-8859-1.xml 6 Jun 2006 14:35:11 -0000 1.1
@@ -0,0 +1,283 @@
+
+
+
+ Account Administration
+ Account changed
+ Account created
+ Account exists
+ Accounts
+ <u>A</u>ccounts
+ Action
+ Active
+ Active session closed
+ Add Account
+ Add Contact
+ Add Server
+ Add Signature
+ Add vCard
+ Adding a contact
+ Adding an account
+ Administration
+ All accounts deleted...
+ All address books deleted...
+ All servers deleted...
+ All user preferences deleted...
+ Allow JavaScript
+ Append Host
+ Are you sure you want JavaScript enabled
+ <u>A</u>ttachment
+ Attachments
+ Authentication
+ Authentication Type
+ Bad account or server is currently down
+ Bad Email
+ <u>B</u>cc
+ <u>B</u>ody
+ <u>C</u>c
+ Change
+ Click here to login
+ Close
+ Closed session with %old_server%
+ Communication problem. Please reload page
+ Compose
+ <u>C</u>ompose
+ Composing an email
+ <li>The user selects 'Compose' from the main menu provided at the
+ top of the screen.
+<li>This then takes them to a form for their email.
+<li>The user then fills the fields they wish to have in the email
+ (at least one recipient must be specified to send the mail).
+<li>Once the user has completed their email, pressing 'Send'
+processes the mail and sends it to their recipients.
+ Connected to <a href="retrieve" class="button"> %neat_name%</a>
+ Contact
+ Contact added
+ Contact changed
+ Contact deleted
+ Contact Management
+ <li>The user can select 'Contacts' to manage their online address book.
+<li>This takes them to their current contact list.
+<li>The user can then add or remove a contact by selecting from the sub-menu located under the main menu bar on the top left.
+<li>This takes the user to their chosen event (add or remove).
+<li>For adding a contact, the user must fill in the required fields within the form and then select 'Add'.
+<li>For removing a contact, the user must select which contact they 'Remove' to remove it.
+<li>The user can send a contact an email from the contacts page by selecting the envelope besides the contact's name.
+
+ Contact your system admin for more information.
+ Contacts
+ Co<u>n</u>tacts
+ Create
+ Create Folder
+ Creating a folder
+ CSV
+ Current Folder:
+ Date
+ Default
+ Default Signature
+ Delete
+ Delete Folder
+ Delete selected emails
+ Deleting a folder
+ Depending on the provider you use this may take a while...
+ Display Headers
+ Style
+ Do you really want to reset the whole webmail system?
+ Edit Account
+ Edit Contact
+ Edit Server
+ Editing a contact
+ Email
+ Email %contacts.first_name%
+ Email %contacts.first_names%
+ End Original Message
+ Enhanced Text
+ Enter short name for this service.
+ Error Not Logged In
+ Error: Selected user could not be removed as it violates referential integrity.
+ Exit
+ File size
+ File type
+ Filename
+ First Name
+ First Names
+ Folder
+ Folder Management
+ <li>The user can select 'Folders' to manage their folders.
+<li>This takes them to their current folder list.
+<li>The user can then create or delete a folder by selecting from the sub-menu located under the main menu bar on the top left.
+<li>This takes the user to their chosen event (create or delete).
+<li>For creating a folder, the folder name is required to bein and 'Create' selected.
+<li>For deleting a folder, the user must select which folder they would like to delete from the dropdown menu and then select 'Delete' to delete it.
+ Folder name
+ Folders
+ <u>F</u>olders
+ Forward
+ From
+ Full HTML
+ Functionality not updated yet.
+ Fwd:
+ Getting your emails
+ Help
+ <u>H</u>elp
+ Hide Headers
+ Host Address
+ How should we handle HTML? Show it as it is, remove Style Information, as enhanced text version or plain text?
+ HTML without CSS
+ Icons
+ Id
+ IMAP
+ IMAP Address
+ IMAP Address
+ IMAP Port
+ IMAP Server
+ Inbox
+ <u>I</u>nbox
+ <li>The user selects 'Inbox' from the main menu provided at the top of the
+screen.
+<li>This then brings up their Inbox with all their emails listed.
+ <u>J</u>avaScript
+ Last Name
+ Login
+ <li>The user must provide their username (generally one word)
+ <li>The user then provides their password.
+ <li>The user selects the IMAP server they wish to connect to.
+ <li>The user then clicks 'Login'.
+ Login Name
+ Logout
+ <u>L</u>ogout
+ The user is able to logout by selecting 'Logout' from the main menu provided at the top of the screen.
+
+ Maximum size is limited to %size% bytes.
+ <u>N</u>avigation bar
+ Next
+ Nick already exists
+ Nickname
+ NNTP
+ No.
+ No
+ No active session
+ No Subject
+ No such account
+ One of the following may have happened:
+ Only plain text permitted.
+ Original Message
+ Password
+ Plain Text
+ Please enter the details of the new contact you would like to add.
+ Please enter the details of the new contact you would like to change:
+ Please enter the name of the new folder you would like to create:
+ Please fill in the details for the account you would like to manage:
+ Please fill in the details for the IMAP server you would like to add:
+ Please fill in the details for the server you would like to manage:
+ Please log in before performing this action.
+ Please select IMAP server you would like to remove:
+ Please select in the name of the folder you would like to delete:
+ Please select user you would like to remove:
+ POP3
+ Port
+ Preferences
+ <u>P</u>references
+ Preferences changed
+ Previous
+ <A HREF="view?number=%prev_num%" alt="Previous"><<</a> %number% of %msg% |
+ <A HREF="view?number=%prev_num%" alt="Previous"><<</a> %number% of %msg% <A HREF="view?number=%next_num%" alt="Next"> >>
+ Print
+ Re:
+ Remove
+ Remove Account
+ Remove Contact
+ Remove Server
+ Remove User
+ Removing a Contact
+ Reply
+ Reset System
+ Retrieving email list
+ Send
+ Sender
+ sending
+ Server
+ Server Administration
+ Server Host
+ Server Name
+ Server Port
+ Servers
+ Set Parameters
+ Should we allow JavaScript in emails sent to you?
+ <u>S</u>ignature
+ SMTP
+ SMTP Auth
+ SMTP Port
+ S<u>t</u>yle
+ <u>S</u>ubject
+ Text
+ Thank you for using IMAP Webmail.
+ The default IMAP port is 143.
+ The following are the functions available for Webmail Administrators:
+ The following document is to be used as an aid for users in understanding
+how to use the Webmail system. The main user scenarios are run through below:
+
+ The following scenarios can only be performed if the user is logged in.
+ The username/password you supplied is not valid.
+ There are no contacts.
+ This account exists already
+ <font color="red"><b>This is an extreme action. You should know what you are doing!</b></font>
+ This page cannot be accessed without being logged in.
+ This service is currently not available.
+ <u>T</u>o
+ (%total_msgs% messages, %recent_msgs% recent)
+ Type
+ Unable to connect to server
+ Unable to connect with server!
+ User
+ User Administration
+ User contacts
+ User Help
+ User not logged in
+ User Preferences
+ Username
+ Users
+ <u>v</u>Card
+ Viewing email
+ <li>Once in their Inbox, the user can select any of the emails in their list
+by selecting the Sender's name.
+<li>This then takes the user to view the email from that sender.
+<li>The user then has two sets of options:
+<ol>
+<li>They can then read the email and choose to reply, forward or delete the
+mail message.
+<li>They can then read the email and choose to traverse through the emails via
+previous and next or close the email.
+</ol> These options are located on the top left and right respectively of
+ the email they are reading. The options are also repeated on
+ the bottom of the email.
+<li>If the email contains attachments, these will be displayed below
+ the email message in the 'Attachments' section.
+<li>The user can view any attachments by selecting the 'Filename'
+ of the attachment. If the browser can display the email, it will,
+ otherwise, the attachment will be asked to be downloaded by the
+ user.
+ We will continue automatically when retrieval is complete.
+ Webmail Administration
+ Welcome
+ Welcome to IMAP Webmail
+ Yes
+ You are currently not logged in.
+ You are now logged out.
+ You can change your login info here:
+ You can enter your signature here.
+ You can reset the complete webmail system here:
+ You can upload a vCard here.
+ You cannot change this element.
+ You don't have the permission to add an account.
+ You have no new mail.
+ You have no new mail (%total_msgs% total)
+ You have reached the max number of servers permitted (%max_servers%).
+ You have <a href="view?number=1">%recent_msgs%</a> new mail message.
+ You have <a href="retrieve">%recent_msgs%</a> new mail messages.
+ You have %recent_msgs% recent message (%total_msgs% total)
+ Your current webmail session has expired.
+ Your email must end with '%host_addr%'
+ Your email was sent
+ Your file is larger than the maximum file size allowed on this system (%size% bytes).
+ Your inbox is empty.
+
Index: openacs-4/packages/webmail-system/sql/postgresql/webmail-system-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/sql/postgresql/webmail-system-create.sql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/sql/postgresql/webmail-system-create.sql 6 Jun 2006 14:35:10 -0000 1.1
@@ -0,0 +1,182 @@
+-->
+-- WEBMAIL SYSTEM CREATE SQL FILE (webmail-system-create.sql)
+--
+-- Author: Nima Mazloumi
+-- Email: mazloumi@uni-mannheim.de
+-- Creation Date: 2006-03-22
+-- Last Modified: 2006-03-22
+--
+-- Description:
+-- Creates all the necessary tables and references required for the webmail system.
+--
+-- Sequences Created:
+-- * webmail_account_seq
+-- * webmail_server_seq
+-- * webmail_contact_seq
+--
+-- Tables Created:
+-- * webmail_servers
+-- * webmail_user_accounts
+-- * webmail_user_prefs
+-- * webmail_address_book
+-- * webmail_serv_types
+-- * webmail_auth_types
+-->
+
+----------------------------------------------------------------------------------------------
+
+-- Creating the sequences
+
+CREATE SEQUENCE webmail_account_seq;
+
+CREATE SEQUENCE webmail_server_seq;
+
+CREATE SEQUENCE webmail_contact_seq;
+
+----------------------------------------------------------------------------------------------
+
+-->
+-- WEBMAIL SERVERS
+--
+-- Short Description: Available servers for receiving and sending mail.
+--
+-- Full Description:
+-- The set of all IMAP servers available to be used. This table includes their corresponding
+-- SMTP server. These servers should be predetermined prior to launching the WebMail system
+-- and set by the WebMail administrator.
+-->
+
+CREATE TABLE webmail_servers
+(
+ server_id int4 PRIMARY KEY,
+ neat_name varchar(64) NOT NULL,
+ imap_addr varchar(64) NOT NULL,
+ host_addr varchar(64) NOT NULL,
+ imap_port int4,
+ smtp_addr varchar(256),
+ server_type int4,
+ auth_type int4,
+ active_p char(1),
+ smtp_auth_p char(1),
+ smtp_port int4,
+ host_append_p char(1)
+);
+
+----------------------------------------------------------------------------------------------
+
+-->
+-- WEBMAIL USER ACCOUNTS
+--
+-- Short Description: Details for each account.
+--
+-- Full Description:
+-- The set of all registered accounts. This table includes information about the user
+-- for that account including their email address, login name to their corresponding IMAP
+-- server, some additional personal information and details of their last visit to the
+-- IMAP server via WebMail.
+-->
+
+CREATE TABLE webmail_user_accounts
+(
+ user_id int4 NOT NULL REFERENCES users,
+ default_p bool,
+ account_id int4 PRIMARY KEY,
+ server_id int4 REFERENCES webmail_servers,
+ username varchar(20),
+ email varchar(256),
+ "password" varchar(20),
+ active_p bool,
+ CONSTRAINT webmail_user_accounts_users_fk FOREIGN KEY (user_id) REFERENCES users (user_id) ON UPDATE NO ACTION ON DELETE NO ACTION,
+ CONSTRAINT webmail_user_accounts_servers_fk FOREIGN KEY (server_id) REFERENCES webmail_servers (server_id) ON UPDATE NO ACTION ON DELETE NO ACTION
+);
+
+----------------------------------------------------------------------------------------------
+
+-->
+-- WEBMAIL USER PREFERENCES
+--
+-- Short Description: Preferences for each user.
+--
+-- Full Description:
+-- The preferences for each user. The amount of preferences will increase over time
+-- however currently the table only contains a few preferences: the number of emails per
+-- page the user would like to have when viewing folders (default is 50), the signature
+-- to append to outgoing mail and the folder to save draft emails to.
+--
+-- Notes:
+-- * The 'account_id' and 'draft_folder' pair for a FOREIGN KEY reference to the
+-- 'webmail_folders' table. The FOREIGN KEY constrains the data of those two values
+-- based on columns in the 'webmail_folders' table.
+-->
+CREATE TABLE webmail_user_prefs
+(
+ draft_folder varchar(32),
+ emails_per_page int4,
+ signature text,
+ nav_bar char(1),
+ user_id int4 NOT NULL REFERENCES users,
+ style char(1),
+ js_enabled char(1),
+ vcard text,
+ CONSTRAINT webmail_user_prefs_users_fk FOREIGN KEY (user_id) REFERENCES users (user_id) ON UPDATE NO ACTION ON DELETE NO ACTION
+);
+
+----------------------------------------------------------------------------------------------
+
+-->
+-- WEBMAIL ADDRESS BOOK
+--
+-- Short Description: Address books for each account.
+--
+-- Full Description:
+-- The address book associated with each account. Each address book entry is associated with
+-- an account identifier and each identifier can have more than one corresponding addresses.
+-->
+
+
+CREATE TABLE webmail_address_book
+(
+ contact_id int4 NOT NULL REFERENCES webmail_user_accounts,
+ email_address varchar(64) NOT NULL,
+ first_names varchar(50) NOT NULL,
+ last_name varchar(50),
+ nick varchar(30),
+ user_id int4 NOT NULL REFERENCES users
+);
+
+----------------------------------------------------------------------------------------------
+
+-->
+-- WEBMAIL AUTHENTICATION TYPES AS DESCRIBED IN UW IMAP DOCUMENTATION
+-->
+
+CREATE TABLE webmail_auth_types
+(
+ "type" varchar(20),
+ type_id int4 NOT NULL
+);
+
+insert into webmail_auth_types ("type", type_id) values ('/notls','1');
+insert into webmail_auth_types ("type", type_id) values ('/ssl','2');
+insert into webmail_auth_types ("type", type_id) values ('/validate-cert','3');
+insert into webmail_auth_types ("type", type_id) values ('/novalidate-cert','4');
+insert into webmail_auth_types ("type", type_id) values ('/tls','5');
+insert into webmail_auth_types ("type", type_id) values ('/readonly','6');
+
+-->
+-- WEBMAIL SERVER TYPES AS DESCRIBED IN UW IMAP DOCUMENTATION
+-->
+
+CREATE TABLE webmail_serv_types
+(
+ "type" varchar(20),
+ type_id int4 NOT NULL
+);
+
+insert into webmail_serv_types ("type", type_id) values ('/imap','1');
+insert into webmail_serv_types ("type", type_id) values ('/pop3','2');
+insert into webmail_serv_types ("type", type_id) values ('/nntp','3');
+insert into webmail_serv_types ("type", type_id) values ('/imap2','4');
+insert into webmail_serv_types ("type", type_id) values ('/imap2bis','5');
+insert into webmail_serv_types ("type", type_id) values ('/imap4','6');
+insert into webmail_serv_types ("type", type_id) values ('/imap4revl','7');
\ No newline at end of file
Index: openacs-4/packages/webmail-system/sql/postgresql/webmail-system-drop.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/sql/postgresql/webmail-system-drop.sql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/sql/postgresql/webmail-system-drop.sql 6 Jun 2006 14:35:10 -0000 1.1
@@ -0,0 +1,81 @@
+-->
+-- WEBMAIL SYSTEM DROP SQL FILE (webmail-system-drop.sql)
+--
+-- Author: Nima Mazloumi
+-- Email: mazloumi@uni-mannheim.de
+-- Creation Date: 2006-03-22
+-- Last Modified: 2006-03-22
+--
+-- Description:
+-- Drops all the sequences, tables and references which exist in the webmail system.
+-- These tables are dropped in reverse order to that of the create sql file.
+--
+-- Tables Dropped:
+-- * webmail_address_book
+-- * webmail_user_prefs
+-- * webmail_user_accounts
+-- * webmail_servers
+-- * webmail_serv_types
+-- * webmail_auth_types
+--
+-- Sequences Dropped:
+-- * webmail_contact_seq
+-- * webmail_server_seq
+-- * webmail_account_seq
+-->
+
+----------------------------------------------------------------------------------------------
+
+-->
+-- WEBMAIL ADDRESS BOOK
+-->
+
+DROP TABLE webmail_address_book;
+
+----------------------------------------------------------------------------------------------
+
+-->
+-- WEBMAIL USER PREFERENCES
+-->
+
+DROP TABLE webmail_user_prefs;
+
+----------------------------------------------------------------------------------------------
+
+-->
+-- WEBMAIL ACCOUNTS
+-->
+
+DROP TABLE webmail_user_accounts;
+
+----------------------------------------------------------------------------------------------
+
+-->
+-- WEBMAIL SERVER TYPES
+-->
+
+DROP TABLE webmail_serv_types;
+
+----------------------------------------------------------------------------------------------
+
+-->
+-- WEBMAIL AUTHENTICATION TYPES
+-->
+
+DROP TABLE webmail_auth_types;
+
+----------------------------------------------------------------------------------------------
+
+-->
+-- WEBMAIL SERVERS
+-->
+
+DROP TABLE webmail_servers CASCADE;
+
+----------------------------------------------------------------------------------------------
+
+DROP SEQUENCE webmail_contact_seq;
+
+DROP SEQUENCE webmail_server_seq;
+
+DROP SEQUENCE webmail_account_seq;
\ No newline at end of file
Index: openacs-4/packages/webmail-system/tcl/webmail-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/tcl/webmail-procs.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/tcl/webmail-procs.tcl 6 Jun 2006 14:35:10 -0000 1.1
@@ -0,0 +1,808 @@
+ad_library {
+
+ Procs for Webmail-System
+ @author mazloumi@uni-mannheim.de
+ @creation-date 2004-08-15
+
+}
+
+namespace eval webmail {
+
+ ######################################################################
+ # Procedure: activate_account
+ # Params: account_id
+ # Description: Returns activates an account
+ ######################################################################
+
+ ad_proc -public activate_account {
+
+ {-account_id:required}
+ } {
+ @param account_id The unique account id for the user
+ Activates an account and verifies it. the active status is set
+ } {
+
+ # get account information. make sure the user ids correspond
+ set uid [ad_conn user_id]
+
+ if {![db_0or1row select_nav_bar_setting {}]} {
+ set nav_bar 1
+ }
+
+ if {[db_0or1row select_account select_account]} {
+ #let's close an active session first
+ set old_server [ad_get_client_property webmail-system neat_name]
+ webmail::close_session
+
+ if {[exists_and_not_null old_server]} {webmail::notify_user -type "auth" -message "[_ webmail-system.Closed_session_with_old_server]"}
+
+ set UW_imap_server "\{$imap_addr:$imap_port$type$auth_type\}"
+ ns_log Notice "$UW_imap_server $username $password"
+ set id [ns_imap open -mailbox $UW_imap_server -user $username -password $password -expunge]
+
+ # now lets verify the account by login in. If successful inform the user about inbox status
+ if [catch { set id [ns_imap open -mailbox $UW_imap_server -user $username -password $password -expunge] } errmsg] {
+
+ webmail::notify_user -type "error" -message "[_ webmail-system.Unable_to_connect_to_server]"
+ webmail::expired_session "WEBMAIL: Unable to connect with server"
+
+ # deactivate account
+ webmail::set_account_activity -account_id $account_id -active_p "f"
+
+ webmail::notify_user -type "warning" -message "[_ webmail-system.Bad_account_or_server_down]"
+
+ } else {
+ webmail::notify_user -type "auth" -message "[_ webmail-system.Connected_to_serv_neat_name]"
+ # set session parameters for this account
+ ad_set_client_property webmail-system username $username
+ ad_set_client_property webmail-system server_id $server_id
+ ad_set_client_property webmail-system server $imap_addr
+ ad_set_client_property webmail-system conn_id $id
+ ad_set_client_property webmail-system neat_name $neat_name
+ ad_set_client_property webmail-system nav_bar $nav_bar
+ ad_set_client_property webmail-system email $email
+ ad_set_client_property webmail-system password $password
+ ad_set_client_property webmail-system smtp_server $smtp_addr
+ webmail::get_status
+
+ webmail::set_account_activity -account_id $account_id -active_p "t"
+ }
+ } else {
+ webmail::notify_user -type "error" -message "[_ webmail-system.No_such_account]"
+ }
+ }
+
+ ######################################################################
+ # Procedure: set_account_activity
+ # Params: account_id, active_p
+ # Description: Changes the activity status of an account
+ ######################################################################
+
+ ad_proc -private set_account_activity {
+ {-account_id:required}
+ {-active_p:required}
+ } {
+ @param account_id The account to affected
+ @param active_p The status to set the account to 't' or 'f'
+ Changes the activity status of an account
+ } {
+ set user_id [ad_conn user_id]
+ db_dml set_status {}
+ }
+ ######################################################################
+ # Procedure: verify_email
+ # Params: server_id, email
+ # Description: Verifies if a given email address is valid for this server
+ ######################################################################
+
+ ad_proc -private verify_email {
+ {-server_id:required}
+ {-email:required}
+ {-username:required}
+ } {
+ @param server_id The server to verify with
+ @param email The email the user indicated
+ @param username The username of the account
+ Return 1 if it is a vali email address. Depends on the flag host_append_p
+ that must be set to 1. Otherwise always 1 is returned.
+ } {
+
+ db_1row get_server_info {}
+ if { $host_append_p == 1 } {
+ set correct_email "$username@$host_addr"
+ if { $email == $correct_email } {
+ return 1
+ } else {
+ webmail::notify_user -type "error" -message "[_ webmail-system.Your_email_must_end_with_host_addr]"
+ return 0
+ }
+ } else {
+ return 1
+ }
+ }
+
+ ######################################################################
+ # Procedure: notify_user
+ # Params: type, message
+ # Description: Create a user message that will be displayed on the next page
+ ######################################################################
+
+ ad_proc -public notify_user {
+ {-type:required "info"}
+ {-message:required ""}
+ } {
+ @param type The message type
+ @param message The actual message
+ Create a user message that will be displayed on the next page
+ Permitted types are: info, warning, cool, error, question, auth
+ } {
+ set url [ad_conn package_url]
+ util_user_message -html -message "$message
"
+ }
+
+ ######################################################################
+ # Procedure: create_account
+ # Params: server_id, username, password, email
+ # Description: Creates a new account for the user
+ ######################################################################
+
+ ad_proc -public create_account {
+ {-server_id:required}
+ {-username:required}
+ {-password:required}
+ {-email:required}
+ } {
+ @param server_id The server to create the account for
+ @param username The login for that server
+ @param password The password to authenticate with
+ @param email The email address for the sender header
+
+ Creates a new account. Initially the account is set to inactive mode. Returns the account_id
+ } {
+
+ set user_id [ad_conn user_id]
+
+ # if the account doesnt exists already
+ if {![db_0or1row account_exists {}]} {
+
+ #we create it
+ set account_id [db_nextval webmail_account_seq]
+ db_dml add_active_account {}
+ webmail::notify_user -type "cool" -message "[_ webmail-system.Account_created]"
+ return $account_id
+ } else {
+ #webmail::notify_user -type "info" -message "[_ webmail-system.Account_exists]"
+ return $account_id
+ }
+ }
+
+ ######################################################################
+ # Procedure: verify_session
+ # Description:
+ ######################################################################
+
+ ad_proc -public verify_session {
+ Checks if we have an active session
+ } {
+ set id [ad_get_client_property webmail-system conn_id]
+
+ # Checking if the user is logged in (ie. session currently running)
+ # Also, checking if the connection is still alive
+ if { [empty_string_p $id] || [catch { set new_mail [ns_imap ping $id] } errmsg] } {
+ webmail::expired_session "WEBMAIL: No active Session"
+ return
+ }
+ }
+
+ ######################################################################
+ # Procedure: expired_session
+ # Params: reason
+ # Description: Redirects the page if the session is expired
+ ######################################################################
+
+ ad_proc -public expired_session { reason } {
+ Closes the session
+ } {
+ ns_log Error "$reason"
+ webmail::close_session
+ ad_returnredirect "not-logged-in"
+ return
+ }
+
+ ######################################################################
+ # Procedure: close_session
+ # Params: -
+ # Description: Sets all session params to null
+ ######################################################################
+
+ ad_proc -public close_session { } {
+ Sets all client properties previously calling ad_get_client_property to empty string
+ } {
+ ns_log debug "WEBMAIL: Closing the session"
+
+ set url [ad_conn package_url]
+ # first we check if there is an open connection. we close everything first.
+ set id [ad_get_client_property webmail-system conn_id]
+ if { [empty_string_p $id] || [catch { set new_mail [ns_imap ping $id] } errmsg] } {
+ #webmail::notify_user -type "warning" -message "[_ webmail-system.No_active_session]"
+ } else {
+ ns_imap close $id
+ #webmail::notify_user -type "info" -message "[_ webmail-system.Active_session_closed]"
+ }
+
+ #and reset all parameters
+ ad_set_client_property webmail-system conn_id ""
+ ad_set_client_property webmail-system account_id ""
+ ad_set_client_property webmail-system username ""
+ ad_set_client_property webmail-system password ""
+ ad_set_client_property webmail-system email ""
+ ad_set_client_property webmail-system server_id ""
+ ad_set_client_property webmail-system server ""
+ ad_set_client_property webmail-system neat_name ""
+ ad_set_client_property webmail-system host ""
+ ad_set_client_property webmail-system next 1
+ ad_set_client_property webmail-system nav_bar 0
+ }
+
+
+ ######################################################################
+ # Procedure: get_status
+ # Params: -
+ # Description: Gets current inbox status
+ ######################################################################
+
+ ad_proc -public get_status { } {
+ Gets current inbox status
+ } {
+ set url [ad_conn package_url]
+ # first we check if there is an open connection. we close everything first.
+ set id [ad_get_client_property webmail-system conn_id]
+
+ set recent_msgs [ns_imap n_recent $id]
+ set total_msgs [ns_imap n_msgs $id]
+ if { $recent_msgs > 0 && $total_msgs > 0 } {
+ webmail::notify_user -type "cool" -message "[_ webmail-system.You_have_recent_total_email]"
+ }
+ if { $recent_msgs == 0 && $total_msgs > 0 } {
+ webmail::notify_user -type "info" -message "[_ webmail-system.You_have_no_new_mail_total_email]"
+ }
+ if { $recent_msgs == 0 && $total_msgs == 0 } {
+ webmail::notify_user -type "warning" -message "[_ webmail-system.Your_inbox_is_empty]"
+ }
+ }
+
+ ######################################################################
+ # Procedure: mail_format_body
+ # Params: email body
+ # Description: Formats the body of the message
+ ######################################################################
+
+ ad_proc -public mail_format_body { body } {
+ Prepares the mail body and wraps it inside a PRE HTML tag
+ } {
+ #set body [ns_quotehtml $body]
+ #set body [ns_imap striphtml $body]
+ return "
$body
"
+ }
+
+ ######################################################################
+ # Procedure: mail_send
+ # Params: recipients sender subject body
+ # Description: Sends an email from the sender to the recipients
+ ######################################################################
+
+ ad_proc -public mail_send { sender recipients subject body } {
+ Sends an email over Sendmail installed locally
+ } {
+ ns_log debug "WEBMAIL: Starting the ns_sendmail command..."
+
+ if [catch { ns_sendmail $recipients $sender $subject $body } errmsg] {
+ ns_log debug "WEBMAIL: Email to $recipients failed: $errmsg"
+ }
+
+ ns_log debug "WEBMAIL: Ending the ns_sendmail command..."
+ }
+
+
+ ######################################################################
+ # Procedure: change_format
+ # Params: message display_style
+ # Description: Formats the body of the message
+ ######################################################################
+
+ ad_proc -public change_format {
+ {-body:required}
+ {-style:required}
+ {-js_enabled:required}
+ {-content_type:required}
+ } {
+ @param body The content of the email
+ @param style The destined format
+ @param js_enabled Should we allow JavaScript
+ Formats the body of the message in accordance to the given style
+ } {
+ ns_log Error "TYPE: $content_type"
+ if { $js_enabled == 0 } {set body [ns_imap striphtml $body]}
+ switch $style {
+ 0 {
+ # Full HTML
+ return [util_close_html_tags $body]
+ }
+ 1 {
+ # No CSS
+ if { $content_type == "text/html" } {
+ set body [disable_attributes -html $body -attr [list class style]]
+ }
+ return [util_close_html_tags $body]
+ }
+ 2 {
+ # Enhanced Text
+ return [ad_text_to_html [ad_html_to_text $body]]
+ }
+ 3 {
+ # Plain Text
+ #return ad_convert_to_text -html_p "t" $body
+ return [ad_html_text_convert -from "text/html" -to "text/plain" $body]
+ }
+ }
+ }
+
+ ######################################################################
+ # Procedure: mail_decode_hdr
+ # Params: header string
+ # Descrption: Decodes header string
+ ######################################################################
+
+ ad_proc -public mail_decode_hdr { str } {
+ Decodes the email
+ } {
+ set b [string first "=?" $str]
+ if { $b >= 0 } {
+ set b [string first "?" $str [expr $b+2]]
+ if { $b > 0 } {
+ set e [string first "?=" $str $b]
+ if { $e == -1 } { set e end } else { incr e -1 }
+ switch [string index $str [expr $b+1]] {
+ Q {
+ set str [ns_imap decode qprint [string range $str [expr $b+3] $e]]
+ }
+ B {
+ set str [ns_imap decode base64 [string range $str [expr $b+3] $e]]
+ }
+ }
+ }
+ }
+ return $str
+ }
+
+ ######################################################################
+ # Procedure: mail_format_size
+ # Params: size of the email
+ # Description: Formats given size in bytes into more user-friendly size text
+ ######################################################################
+
+
+ ad_proc -public mail_format_size { size } {
+ @option size Size is bytes
+ Sets the size of the email depending on the number of bytes
+ } {
+ if { $size > 1048576 } {
+ set size "[format \"%.1f\" [expr $size / 1048576.0]]Mb"
+ } elseif { $size > 1024 } {
+ set size "[format \"%.1f\" [expr $size/1024.0]]Kb"
+ }
+ return $size
+ }
+
+ ######################################################################
+ # Procedure: create_boundary
+ # Params: string
+ # Description: creates a unique boundary within the email context
+ ######################################################################
+
+ ad_proc -private create_boundary {
+ {str ""}
+ } {
+ param str An optional string to create the boundary
+ Creates a unique boundary within the email context
+ } {
+ if {[exists_and_not_null str]} {
+ return "OACS-[md5::md5 $str]"
+ } else {
+ return "OACS-2e4w7w0k32-0A"
+ }
+ }
+
+ ######################################################################
+ # Procedure: encode
+ # Params: temporary file
+ # Description: takes a file from local disk and returns it base64 encoded
+ ######################################################################
+
+
+ ad_proc -private encode {
+ {-file:required}
+ } {
+ @param file Path to a valid file on disk
+ Returns a given file base 64 encoded. Requires mmencode
+ } {
+ set mmencode "/usr/bin/mmencode"
+ set fp [open "|$mmencode -b $file" r]
+ set b64 [read $fp]
+ close $fp
+ return $b64
+ }
+
+ ######################################################################
+ # Procedure: create_header
+ # Params: content_type boundary
+ # Description: creates a default header for the email depending on the content_type
+ ######################################################################
+
+ ad_proc -public create_header {
+ {-content_type:required}
+ {-has_attach_p:required}
+ } {
+ @param content_type The content_type of the email
+ @param has_attach_p Wether this emails contains attachments or not
+ Creates the header depending on the content_type
+ } {
+
+ set header [ns_set new]
+ ns_set put $header "MIME-Version" "1.0"
+ ns_set update $header "X-Mailer" "OpenACS 5.1"
+
+ if { $has_attach_p} {
+ set boundary [webmail::create_boundary]
+ set cnt_type "Multipart/Mixed; boundary=\"$boundary\""
+ } else {
+ set cnt_type "$content_type; charset=UNICODE-1-1"
+ ns_set update $header "Content-Transfer-Encoding" "7bit"
+ }
+
+ ns_set update $header "Content-Type" "$cnt_type"
+
+ return $header
+
+ }
+
+ ######################################################################
+ # Procedure: create_notice
+ # Params:
+ # Description: creates the notice part for older email clients
+ ######################################################################
+
+ ad_proc -private create_notice {
+ } {
+ Creates the notice for older email clients
+ } {
+
+ set notice "This is a multi-part message in MIME format.\n\nThis message is in MIME format. Because your mail reader does not understand this format, some or all of this message may not be legible.\n"
+ return $notice
+ }
+
+ ######################################################################
+ # Procedure: create_body
+ # Params: body boundary
+ # Description: creates the message part of the email
+ ######################################################################
+
+ ad_proc -public create_body {
+ {-has_attach_p}
+ {-body:required}
+ } {
+ @param body The email richtext message, a list with two elements {text} mime_type
+ @param boundary A unique value within the email context
+ Creates the message part of the email
+ } {
+
+ set body_content [template::util::richtext::get_property contents $body]
+ set body_type [template::util::richtext::get_property format $body]
+
+ if {$has_attach_p} {
+ #Email with attachment
+ set boundary [webmail::create_boundary]
+ set notice [webmail::create_notice]
+ set mail_body "--$boundary\nContent-Type: $body_type; charset=\"UNICODE-1-1\"; format=flowed\nContent-Transfer-Encoding: 7bit\n\n$body_content\n\n"
+ } else {
+ #Email without attachment
+ set notice ""
+ set mail_body $body_content
+ }
+ return $notice$mail_body
+
+ }
+
+
+ ######################################################################
+ # Procedure: create_attachment
+ # Params: file
+ # Description: creates the attachment part of the email
+ ######################################################################
+
+ ad_proc -public create_attachment {
+
+ {-file:required}
+
+ } {
+ @param file The file retrieved from an ad_form element
+ Creates an attachment part for the email
+ } {
+ set filename [template::util::file::get_property filename $file]
+ set tmp_file [template::util::file::get_property tmp_filename $file]
+ set mime_type [template::util::file::get_property mime_type $file]
+ set b64 [webmail::encode -file $tmp_file]
+
+ set boundary [webmail::create_boundary]
+
+ set attach_body "--$boundary\nContent-Type: $mime_type;\n name=\"$filename\"\nContent-Disposition: attachment;\n filename=\"$filename\"\nContent-Transfer-Encoding: base64\n\n$b64\n\n"
+ return $attach_body
+
+ }
+
+
+ ######################################################################
+ # Procedure: add_vcard
+ # Params: content
+ # Description: creates a vcard attachment for the email
+ ######################################################################
+
+ ad_proc -public add_vcard {
+
+ {-content:required}
+
+ } {
+ @param content content of the vCard as a list: name, type, content
+ Creates a vcard for the email
+ } {
+ #set type [lindex $content 1] not used since results in application/base64
+
+ set boundary [webmail::create_boundary]
+ set filename [lindex $content 0]
+ set body [lindex $content 2]
+
+ set attach_body "--$boundary\nContent-Type: text/x-vcard; charset=utf8;\n name=\"$filename\"\nContent-Transfer-Encoding: 7bit\nContent-Disposition: attachment;\n filename=\"$filename\"\n\n$body\n\n"
+ return $attach_body
+
+ }
+
+
+ ######################################################################
+ # Procedure: create_email
+ # Params: content attachment boundary
+ # Description: creates the full email ready to be sent
+ ######################################################################
+
+ ad_proc -public create_email {
+
+ {-content:required}
+ {-attachment:required}
+ {-vcard:required}
+ } {
+ @param content The content block of the email
+ @param attachment A given attachment block
+ @param vcard A given vCard block
+ Creates the full email ready to be sent
+ } {
+ if { [exists_and_not_null attachment] || [exists_and_not_null vcard] } {
+ set boundary [webmail::create_boundary]
+ set close_part "--$boundary--\n"
+ return "$content$attachment$vcard$close_part"
+ } else {
+ return "$content\n"
+ }
+ }
+
+
+ ######################################################################
+ # Procedure: quoted_printable_encode
+ # Params: text charset
+ # Description: Encodes special characters in the message header according to RFC 2047
+ ######################################################################
+
+ ad_proc -private quoted_printable_encode {
+ -text:required
+ {-charset ""}
+ } {
+ Encode special characters, like german umlauts, in message headers
+ according to RFC 2047.
+ } {
+ # First check if there are any characters which need to be quoted at all.
+ set encode_p 0
+ for { set i 0 } { $i < [string length $text] } { incr i } {
+ if { ![string is ascii [string index $text $i]] } {
+ set encode_p 1
+ }
+ }
+
+ if { !$encode_p } { return $text }
+
+ set hex "0123456789ABCDEF"
+
+ if {[empty_string_p $charset]} {
+ set end_of_line "="
+ set begin_of_line ""
+ } else {
+ set end_of_line "?="
+ set begin_of_line "=?$charset?Q?"
+ }
+
+ set result ""
+ set line $begin_of_line
+
+ for { set i 0 } { $i < [string length $text] } { incr i } {
+ set current [string index $text $i]
+ if { ![string is ascii $current] || [string first $current " \t\r\n()<>@,;:/\[\]?.=\"\\"] != -1 } {
+ binary scan $current c x
+ append line "=[string index $hex [expr ($x & 0xf0) >> 4]][string index $hex [expr $x & 0x0f]]"
+ } else {
+ append line $current
+ }
+ if { [string length $line] > 70 } {
+ if { ![empty_string_p $result] } { append result "\n" }
+ append result "${line}$end_of_line"
+ set line $begin_of_line
+ }
+ }
+
+ if { ![string equal $line $begin_of_line] } {
+ if { ![empty_string_p $result] } { append result "\n" }
+ append result "${line}$end_of_line"
+ }
+
+ return $result
+ }
+
+
+ ######################################################################
+ # Procedure: disable_attribute
+ # Params: html attr
+ # Description: Disables all passed HTML Attributes.
+ ######################################################################
+
+ ad_proc -private disable_attributes {
+ {-attr:required}
+ {-html:required}
+ } {
+ @param html The HTML to parse
+ @param attr The list of attributes to disable
+ Disables all passed HTML Attributes.
+ } {
+ set attributes [list]
+ for { set i [string first < $html] } { $i != -1 } { set i [string first < $html $i] } {
+ incr i
+ regexp -indices -start $i {\A/?([-_a-zA-Z0-9]+)\s*} $html match name_idx
+ set i [expr { [lindex $match 1] + 1}]
+ while { $i < [string length $html] && ![string equal [string index $html $i] {>}] } {
+ if { ![regexp -indices -start $i {\A\s*([^\s=>]+)\s*(=?)\s*} $html match attr_name_idx equal_sign_idx] } {
+ regexp -indices -start $i {\A[\s=]*} $html match
+ set i [expr { [lindex $match 1] + 1 }]
+ } {
+ set attr_name [string tolower [string range $html [lindex $attr_name_idx 0] [lindex $attr_name_idx 1]]]
+ set i [expr { [lindex $match 1] + 1}]
+
+ if { [lindex $equal_sign_idx 1] - [lindex $equal_sign_idx 0] < 0 } {
+ lappend attributes $attr_name
+ } else {
+ switch -- [string index $html $i] {
+ {"} { set exp {\A"([^"]*)"\s*} }
+ {'} { set exp {\A'([^']*)'\s*} }
+ default { set exp {\A([^\s>]*)\s*} }
+ }
+ if { ![regexp -indices -start $i $exp $html match attr_value_idx] } {
+ set attr_value [string range $html [expr {$i+1}] end]
+ set i [string length $html]
+ } else {
+ set attr_value [string range $html [lindex $attr_value_idx 0] [lindex $attr_value_idx 1]]
+ set i [expr { [lindex $match 1] + 1}]
+ }
+ set attr_value [util_expand_entities_ie_style $attr_value]
+ lappend attributes [list $attr_name $attr_value]
+ }
+ }
+ }
+ }
+
+ foreach pair $attributes {
+ ns_log error "PAIR: <$pair>"
+ set size [llength $pair]
+ if { $size == 2 } {
+ # if the attribute has also a value replace the value
+ set key [lindex $pair 0]
+ set value [lindex $pair 1]
+ foreach unwanted_attr $attr {
+ if { $key == $unwanted_attr } {
+ regsub -nocase -all "$value" $html "dummy" html
+ regsub -nocase -all "$key" $html "dummy_$key" html
+ }
+ }
+ } else {
+ # else replace the attribute
+ set key [lindex $pair 0]
+ foreach unwanted_attr $attr {
+ if { $key == $unwanted_attr } { regsub -nocase -all "$attr" $html "dummy_$attr" html }
+ }
+ }
+ }
+ return $html
+ }
+
+
+ ######################################################################
+ # Procedure: read_file
+ # Params: file
+ # Description: Returns the name, type and content of a file as a list
+ ######################################################################
+
+ ad_proc -public read_file {
+
+ {-file:required}
+
+ } {
+ @param file full path to a file on disk
+ Returns the name, type and content of a file as a list
+ } {
+ set filename [template::util::file::get_property filename $file]
+ set tmp_file [template::util::file::get_property tmp_filename $file]
+ set mime_type [template::util::file::get_property mime_type $file]
+
+ set fileId [open "$tmp_file"]
+ set content [read $fileId]
+ close $fileId
+ return [list $filename $mime_type $content]
+ }
+
+
+ ######################################################################
+ # Procedure: parse_sender
+ # Params: sender
+ # Description: Tries to parse first_names, last_name and email from sender
+ # Returns an array
+ ######################################################################
+
+ ad_proc -public parse_sender {
+
+ {-sender:required}
+ {-array:required}
+
+ } {
+ @param sender The sender header of an email
+ @param array The array to put the result in
+ Tries to parse first_names, last_name and email from sender and creates an array
+ } {
+
+ upvar 1 $array result
+
+ regexp {"(.*?)" <(.*?)>} $sender match person email
+ if {[exists_and_not_null person]} {
+ set person [split $person " "]
+ set size [llength $person]
+ switch $size {
+ 1 {
+ set first_names ""
+ set last_name [lindex $person 0]
+ }
+ 2 {
+ set first_names [lindex $person 0]
+ set last_name [lindex $person 1]
+ }
+ default {
+ set last_name [lindex $person end]
+ set first_names [join [lrange $person 0 [expr $size -2]] " "]
+ }
+ }
+ } else {
+ set first_names ""
+ set last_name ""
+ set email $sender
+ }
+ set result(first_names) $first_names
+ set result(last_name) $last_name
+ set result(email) $email
+
+ return
+ }
+
+
+}
+# ------------------------- END OF FILE ------------------------- #
\ No newline at end of file
Index: openacs-4/packages/webmail-system/tcl/webmail-procs.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/tcl/webmail-procs.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/tcl/webmail-procs.xql 6 Jun 2006 14:35:10 -0000 1.1
@@ -0,0 +1,68 @@
+
+
+
+
+
+
+
+ select wa.username,
+ wa.password,
+ wa.email,
+ ws.imap_addr,
+ ws.imap_port,
+ ws.server_id,
+ ws.smtp_addr,
+ ws.neat_name,
+ (select type from webmail_serv_types where ws.server_type = type_id) as type,
+ (select type from webmail_auth_types where ws.auth_type = type_id) as auth_type
+ from webmail_user_accounts wa,
+ webmail_servers ws where
+ wa.account_id = :account_id and
+ wa.user_id = :uid and
+ ws.server_id = wa.server_id
+
+
+
+
+
+
+
+ select nav_bar from webmail_user_prefs where user_id = :uid
+
+
+
+
+
+
+
+ update webmail_user_accounts set active_p = :active_p where account_id = :account_id and user_id = :user_id
+
+
+
+
+
+
+
+ select server_id, host_addr, host_append_p from webmail_servers where server_id = :server_id
+
+
+
+
+
+
+
+ select account_id from webmail_user_accounts where server_id = :server_id and user_id = :user_id and username = :username
+
+
+
+
+
+
+
+ insert into webmail_user_accounts (account_id, user_id, server_id, email, username, password, active_p) values
+ (:account_id, :user_id, :server_id, :email, :username, :password, 'f')
+
+
+
+
+
Index: openacs-4/packages/webmail-system/www/account-remove.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/account-remove.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/account-remove.tcl 6 Jun 2006 14:35:11 -0000 1.1
@@ -0,0 +1,46 @@
+# --------------------------------------------------------------- #
+# ADMIN REMOVE ACCOUN #
+# #
+# LOCATION: packages/webmail-system/www/admin/account-remove.tcl #
+# #
+# --------------------------------------------------------------- #
+
+# ------------------------ PAGE CONTRACT ------------------------ #
+
+ad_page_contract {
+
+ Admin accounts -- removing an account
+
+ @author Nima Mazloumi (mazloumi@uni-mannheim.de)
+ @creation-date 23/08/2004
+
+ } -query {
+ {user_id:multiple,notnull}
+ }
+
+# ------------------------ SET VARIABLES ------------------------ #
+
+set address "Administrator"
+set page_title "#webmail-system.Account_Administration#"
+
+set accounts [split $user_id " "]
+set accounts [join $accounts "', '"]
+
+ns_log debug "WEBMAIL: User Administration: Account Remove"
+
+# -------------------------- PROCESSING ------------------------- #
+
+# Removing the account from the database
+if { [catch { db_dml remove_account {} } errmsg ] } {
+ ns_log error "WEBMAIL: Account remove: $errmsg"
+ ad_returnredirect "accounts?err=1"
+}
+
+ns_log debug "WEBMAIL: Account Administration: Remove end"
+
+# --------------------------------------------------------------- #
+
+ad_returnredirect "accounts"
+ad_script_abort
+
+# ------------------------- END OF FILE ------------------------- #
Index: openacs-4/packages/webmail-system/www/account-remove.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/account-remove.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/account-remove.xql 6 Jun 2006 14:35:11 -0000 1.1
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+ delete from webmail_user_accounts where user_id IN (:accounts)
+
+
+
+
+
\ No newline at end of file
Index: openacs-4/packages/webmail-system/www/account.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/account.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/account.adp 6 Jun 2006 14:35:10 -0000 1.1
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+@page_title@
+@address@
+
+#webmail-system.Please_fill_in_the_details_for_the_IMAP_server_you_would_like_to_add#
+
Index: openacs-4/packages/webmail-system/www/account.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/account.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/account.tcl 6 Jun 2006 14:35:10 -0000 1.1
@@ -0,0 +1,92 @@
+# --------------------------------------------------------------- #
+# ADMIN ACCOUNT #
+# #
+# LOCATION: packages/webmail-system/www/account.tcl #
+# #
+# --------------------------------------------------------------- #
+
+# ------------------------ PAGE CONTRACT ------------------------ #
+
+ad_page_contract {
+
+ Admin Account
+
+ @author Nima Mazloumi (mazloumi@uni-mannheim.de)
+ @creation-date 23/08/2004
+
+} {
+ account_id:optional
+}
+
+# ------------------------ SET VARIABLES ------------------------ #
+
+set page_title "#webmail-system.Adding_an_account#"
+set address "Administrator"
+set id [ad_get_client_property webmail-system conn_id]
+set user_id [ad_conn user_id]
+
+set opts [list]
+
+db_multirow -extend { server_line } servers get_servers {} {
+ set server_line "$neat_name ($host_addr)"
+ lappend opts [list $server_line $server_id ]
+}
+
+ns_log debug "WEBMAIL: Admin Server started"
+
+# ------------------------- CREATE FORM ------------------------- #
+
+ad_form -name account -form {
+ account_id:key(webmail_account_seq)
+ {server_id:text(select)
+ {options $opts}
+ {label "#webmail-system.Server#"}
+ {html {single single}}}
+ {username:text
+ {html { size 30}}
+ {label "#webmail-system.Username#"}}
+ {password:text(password)
+ {label "#webmail-system.Password#"}}
+ {email:text
+ {label "#webmail-system.Email#"}}
+} -select_query_name select_account -on_request {
+ # if only default server allowed
+} -new_data {
+
+ if {![webmail::verify_email -server_id $server_id -email $email -username $username]} {
+ ad_return_complaint 1 "[_ webmail-system.Bad_Email]"
+ ad_script_abort
+ }
+
+ if { [catch { db_dml add_account {} } errmsg] } {
+ webmail::notify_user -type "error" -message "[_ webmail-system.This_account_exists_already]"
+ } else {
+ webmail::notify_user -type "info" -message "[_ webmail-system.Account_created]"
+ }
+
+} -edit_data {
+
+ if {![webmail::verify_email -server_id $server_id -email $email -username $username]} {
+ ad_return_complaint 1 "[_ webmail-system.Bad_Email]"
+ ad_script_abort
+ }
+
+ if { [catch { db_dml edit_account {} } errmsg] } {
+ webmail::notify_user -type "error" -message "[_ webmail-system.This_account_exists_already]"
+ } else {
+ webmail::notify_user -type "info" -message "[_ webmail-system.Account_changed]"
+ }
+
+} -after_submit {
+ ad_returnredirect "accounts"
+ ad_script_abort
+}
+
+
+ns_log debug "WEBMAIL: Admin Account completed"
+
+# --------------------------------------------------------------- #
+
+ad_return_template
+
+# ------------------------- END OF FILE ------------------------- #
Index: openacs-4/packages/webmail-system/www/account.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/account.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/account.xql 6 Jun 2006 14:35:10 -0000 1.1
@@ -0,0 +1,37 @@
+
+
+
+
+
+
+
+ insert into webmail_user_accounts (account_id, server_id, user_id,
+ email, username, password, active_p)
+ values (:account_id, :server_id, :user_id, :email, :username, :password, 't')
+
+
+
+
+
+
+ update webmail_user_accounts
+ set email = :email,
+ username = :username,
+ password = :password
+ where account_id = :account_id
+
+
+
+
+
+ select * from webmail_servers where active_p = 't'
+
+
+
+
+
+ select * from webmail_user_accounts where account_id = :account_id
+
+
+
+
Index: openacs-4/packages/webmail-system/www/accounts.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/accounts.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/accounts.adp 6 Jun 2006 14:35:11 -0000 1.1
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+@page_title@
+@address@
+
+
+ Error: Selected account could not be removed as it violates referential integrity
+
+
+
Index: openacs-4/packages/webmail-system/www/accounts.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/accounts.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/accounts.tcl 6 Jun 2006 14:35:11 -0000 1.1
@@ -0,0 +1,134 @@
+# --------------------------------------------------------------- #
+# ADMIN ACCOUNTS #
+# #
+# LOCATION: packages/webmail-system/www/admin/accounts.tcl #
+# #
+# --------------------------------------------------------------- #
+
+# ------------------------ PAGE CONTRACT ------------------------ #
+
+ad_page_contract {
+
+ Admin accounts
+
+ @author Nima Mazloumi (mazloumi@uni-mannheim.de)
+ @creation-date 20/08/2004
+
+} {
+ err:optional
+ account_id:optional
+ delete_p:optional
+ default_p:optional
+}
+
+# ------------------------ SET VARIABLES ------------------------ #
+ns_log debug "WEBMAIL: Account Administration"
+
+set address "Administrator"
+set page_title "#webmail-system.Account_Administration#"
+set id [ad_get_client_property webmail-system conn_id]
+set user_id [ad_conn user_id]
+set max_accounts [parameter::get -parameter "MaximumUserAccounts" -default 0]
+set allowed_p [parameter::get -parameter "MultipleAccountsAllowedP" -default 0]
+set count [db_string do_count {}]
+
+# -------------------------- PROCESSING ------------------------- #
+
+if { $allowed_p == 1 && $count < $max_accounts } {
+ set actions [list [_ webmail-system.Add_Account] "account" [_ webmail-system.Add_Account]]
+} else {
+ set actions ""
+}
+
+# Build the list-builder list
+template::list::create \
+ -name accounts \
+ -key user_id \
+ -actions $actions \
+ -multirow accounts \
+ -sub_class {
+ tiny
+ } -elements {
+ edit {
+ label ""
+ display_template {
+
+ }
+ link_url_eval {[export_vars -base account { account_id {ad_form_mode edit}}]}
+ link_html {title "Edit this account"}
+ }
+ neat_name {
+ label "[_ webmail-system.Server_Name]"
+ html "align left"
+ } username {
+ label "[_ webmail-system.Username]"
+ html "align left"
+ } email {
+ label "[_ webmail-system.Email]"
+ html "align left"
+ } default {
+ label "[_ webmail-system.Active]"
+ html "align center"
+ display_template {
+
+
+
+
+
+
+
+ }
+ } delete {
+ label ""
+ display_template {
+
+
+
+
+
+ }
+ }
+
+ }
+
+if { [info exists err] != 1 } {
+ set err 0
+}
+
+
+#Delete account if requested
+if {[exists_and_not_null account_id] && [exists_and_not_null delete_p]} {
+ db_dml delete_account {}
+}
+
+# Set account as default if requested
+if {[exists_and_not_null account_id] && [exists_and_not_null default_p]} {
+
+ #three steps: first reset the other accounts
+ db_dml set_all_to_false {}
+
+ #make this one as default
+ db_dml make_default {}
+
+ #and finally create a new session for the new default account
+ webmail::activate_account -account_id $account_id
+ ad_returnredirect "welcome"
+ ad_script_abort
+}
+
+db_multirow -extend {default_p_url delete_url} accounts get_all_accounts {} {
+ set default_p_url "accounts?[export_vars { account_id {default_p 't'} }]"
+ set delete_url "accounts?[export_vars { account_id {delete_p 't'} }]"
+}
+
+ns_log debug "WEBMAIL: Accounts Administration completed"
+
+# --------------------------------------------------------------- #
+
+ad_return_template
+
+# ------------------------- END OF FILE ------------------------- #
Index: openacs-4/packages/webmail-system/www/accounts.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/accounts.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/accounts.xql 6 Jun 2006 14:35:11 -0000 1.1
@@ -0,0 +1,37 @@
+
+
+
+
+
+
+ select * from webmail_servers ws, webmail_user_accounts wm where
+ ws.server_id = wm.server_id and user_id = :user_id order by
+ neat_name, username
+
+
+
+
+
+ select count(server_id) as server_count from webmail_user_accounts where user_id = :user_id
+
+
+
+
+
+ delete from webmail_user_accounts where account_id = :account_id
+
+
+
+
+
+ update webmail_user_accounts set default_p = 'f' where account_id <> :account_id and user_id = :user_id
+
+
+
+
+
+ update webmail_user_accounts set default_p = 't' where account_id = :account_id
+
+
+
+
Index: openacs-4/packages/webmail-system/www/add-attach.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/add-attach.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/add-attach.adp 6 Jun 2006 14:35:10 -0000 1.1
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+@page_title@
+@address@
+
+#webmail-system.This_functionality_is_yet_to_be_implemented#
Index: openacs-4/packages/webmail-system/www/add-attach.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/add-attach.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/add-attach.tcl 6 Jun 2006 14:35:10 -0000 1.1
@@ -0,0 +1,52 @@
+# --------------------------------------------------------------- #
+# ADD ATTACHMENT #
+# #
+# LOCATION: packages/webmail-system/www/add-attach.tcl #
+# #
+# --------------------------------------------------------------- #
+
+# ------------------------ PAGE CONTRACT ------------------------ #
+
+ad_page_contract {
+
+ Adding an attachment the user's composed email
+
+ @author Ayman Mohamed (mo2mo@hotmail.com)
+ @author Nima Mazloumi (mazloumi@uni-mannheim.de)
+ @creation-date 14/10/2002
+
+} {
+}
+
+# ------------------- RETRIEVE SESSION PARAMS ------------------- #
+
+ns_log debug "WEBMAIL: Add attachment started"
+
+set id [ad_get_client_property webmail-system conn_id]
+set username [ad_get_client_property webmail-system username]
+set server [ad_get_client_property webmail-system server]
+set host [ad_get_client_property webmail-system host]
+
+# ------------------ CHECKING SESSION VALIDITY ------------------ #
+
+# Checking if the user is logged in (ie. session currently running)
+# Also, checking if the connection is still alive
+if { [empty_string_p $id] || [catch { set new_mail [ns_imap ping $id] } errmsg] } {
+ webmail::expired_session "WEBMAIL: Add Attachment Error"
+ return
+}
+
+# ------------------------ SET VARIABLES ------------------------ #
+
+set page_title "#webmail-system.Add_attachment#"
+set address "$username@$host"
+
+# -------------------------- PROCESSING ------------------------- #
+
+ns_log debug "WEBMAIL: Add attachment complete"
+
+# --------------------------------------------------------------- #
+
+ad_return_template
+
+# ------------------------- END OF FILE ------------------------- #
Index: openacs-4/packages/webmail-system/www/compose.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/compose.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/compose.adp 6 Jun 2006 14:35:10 -0000 1.1
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+@page_title@
+
+
+
Index: openacs-4/packages/webmail-system/www/compose.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/compose.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/compose.tcl 6 Jun 2006 14:35:10 -0000 1.1
@@ -0,0 +1,247 @@
+# --------------------------------------------------------------- #
+# COMPOSE AN EMAIL #
+# #
+# LOCATION: packages/webmail-system/www/compose.tcl #
+# #
+# --------------------------------------------------------------- #
+
+# ------------------------ PAGE CONTRACT ------------------------ #
+
+ad_page_contract {
+
+ Composing an email to be sent.
+
+ @author Ayman Mohamed (mo2mo@hotmail.com)
+ @author Nima Mazloumi (mazloumi@uni-mannheim.de)
+ @creation-date 12/9/2002
+
+} {
+ number:optional
+ action:optional
+ attachment:trim,optional
+ attachment.tmpfile:tmpfile,optional
+ contact_id:optional
+} -validate {
+ max_size -requires {attachment} {
+ set n_bytes [file size ${attachment.tmpfile}]
+ set max_bytes [ad_parameter "MaximumFileSize"]
+ if { $n_bytes > $max_bytes } {
+ set size [util_commify_number $max_bytes]
+ webmail::notify_user -type "error" -message "[_ webmail-system.Your_file_is_larger_than_the_maximum_file_size_allowed_on_this_system]"
+ ad_complain "[_ webmail-system.Your_file_is_larger_than_the_maximum_file_size_allowed_on_this_system]"
+ }
+ }
+}
+
+# ------------------------ SET VARIABLES ------------------------ #
+
+ns_log debug "WEBMAIL: Compose started"
+
+set page_title "[_ webmail-system.Composing_an_email]"
+set use_wysiwyg_p [parameter::get -parameter "UseWysiwygP" -default "f"]
+set user_id [ad_conn user_id]
+set package_id [ad_conn package_id]
+
+# ------------------------- CREATE FORM ------------------------- #
+
+#set opts [list]
+
+#db_multirow emails get_emails {} {
+# lappend opts [list $email]
+#}
+set from [ad_get_client_property webmail-system email]
+
+set max_bytes [ad_parameter "MaximumFileSize"]
+set size [util_commify_number $max_bytes]
+
+ad_form -html { enctype multipart/form-data } -name compose_email -form {
+ {from:text
+ {html {readonly readonly size 50}}
+ {label "[_ webmail-system.From]"}}
+ {to:text
+ {html { size 74 accesskey t }}
+ {label "[_ webmail-system.To]"}}
+ {cc:text,optional
+ {html { size 74 accesskey c }}
+ {label "[_ webmail-system.Cc]"}}
+ {bcc:text,optional
+ {html { size 74 accesskey b }}
+ {label "[_ webmail-system.Bcc]"}}
+ {subject:text
+ {html { size 74 accesskey s }}
+ {label "[_ webmail-system.Subject]"}}
+ {attachment:file,optional
+ {html { size 37 accesskey a }}
+ {label "[_ webmail-system.Attachment]"}
+ {help_text "[_ webmail-system.Maximum_size_is_limited_to_size]"}}
+}
+
+set signature ""
+set vcard ""
+
+#As a default we don't simply add an optional vCard
+set vcard_p 0
+
+# Check if user has made vCard and Signature settings and extend the form
+if { [db_0or1row select_preferences {}] } {
+ if {[exists_and_not_null vcard]} {
+ ad_form -extend -name compose_email -form {
+ {vcard_p:text(radio),optional
+ {label "[_ webmail-system.Add_vCard]"}
+ {options {{Yes 1} {No 0}}}}
+ }
+ }
+}
+
+ad_form -extend -name compose_email -form {
+ {body:richtext(richtext),optional
+ {htmlarea_p $use_wysiwyg_p}
+ {html { cols 56 rows 20 wrap soft accesskey b }}
+ {label "[_ webmail-system.Body]"}}
+ {submit:text(submit)
+ {label "[_ webmail-system.Send]"}
+ }
+} -on_request {
+ set htmlarea_p $use_wysiwyg_p
+
+ set prefix ""
+ set body ""
+ set type ""
+
+ if {[exists_and_not_null action] && [exists_and_not_null number]} {
+ # Different settings based on each action (reply or forward)
+ if { $action == "reply"} {
+ set prefix [_ webmail-system.Re]
+ } else {
+ set prefix [_ webmail-system.Fwd]
+ }
+ set recipient [ns_imap header $id $number from]
+ set subject "[_ webmail-system.Re] [ns_imap header $id $number subject]"
+ set sender [ns_imap header $id $number to]
+
+ ns_imap struct $id $number -array struct
+ # Preparing the body format in the reply message
+ if { $struct(type) == "multipart" } {
+ for { set i 1 } { $i <= $struct(part.count) } { incr i } {
+ array set part $struct(part.$i)
+ if { ![info exists part(body.name)] } {append content [ns_imap body $id $number $i -decode]}
+ }
+ } else {
+ set content [ns_imap text $id $number]
+ }
+
+ set body "\n\n\n\n---------------[_ webmail-system.Original_Message]---------------\n\n"
+ append body "[_ webmail-system.To] $sender\n[_ webmail-system.From] $recipient\n[_ webmail-system.Subject] $subject\n\n"
+ append body $[ad_html_to_text $content]
+ append body "\n\n-------------[_ webmail-system.End_Original_Message]-------------\n"
+
+ set subject "$prefix$subject"
+
+ # Scanning the recipient line for just the email without any other
+ # tags or strings such as < > or ""
+
+ set found [regexp {([-A-Za-z0-9_.]+@[-A-Za-z0-9_.]+)} $recipient match email]
+ set recipient $email
+ if { $action == "reply" } {set to $recipient}
+ }
+
+ if {[exists_and_not_null signature]} {
+ set body "$body\n\n\n\n[lindex $signature 0]"
+ set type [lindex $signature 1]
+ } else {
+ set body $body
+ set type "text/enhanced"
+ }
+
+ set body [template::util::richtext::create $body $type]
+
+ if {[exists_and_not_null contact_id]} {
+ if {[db_0or1row select_contact {}]} {
+ set to "\"$first_names $last_name\" <$email_address>"
+ }
+ }
+
+} -on_submit {
+ #set content_type [template::util::richtext::get_property format $body]
+
+ if {[exists_and_not_null vcard_p] || [exists_and_not_null attachment] } {
+ set has_attach_p 1
+ } else {
+ set has_attach_p 0
+ }
+
+ set emailList [list]
+ package require smtp
+ package require mime
+
+ set vcard_attach ""
+ if {$vcard_p == 1} {
+ #set vcard_attach [webmail::add_vcard -content $vcard]
+ set vCardFilename [lindex $vcard 0]
+ set vCardContent [lindex $vcard 2]
+ set vCardT text/x-vcard [mime::initialize -canonical "text/x-vcard; name=\"$vCardFilename\"" -string $vCardContent]
+ lappend emailList $vCardT
+ }
+
+ #set attach ""
+ if {[exists_and_not_null attachment]} {
+ #set attach [webmail::create_attachment -file $attachment]
+
+ set filename [template::util::file::get_property filename $attachment]
+ set tmp_file [template::util::file::get_property tmp_filename $attachment]
+ set mime_type [template::util::file::get_property mime_type $attachment]
+ #set b64 [webmail::encode -file $tmp_file]
+
+ set attachT [mime::initialize -canonical "$mime_type; name=\"$filename\"" -file $tmp_file]
+ lappend emailList $attachT
+ }
+
+ #set header [webmail::create_header -content_type $content_type -has_attach_p $has_attach_p]
+ #set content [webmail::create_body -body $body -has_attach_p $has_attach_p]
+
+ set body_content [template::util::richtext::get_property contents $body]
+ set body_type [template::util::richtext::get_property format $body]
+ set textT [mime::initialize -canonical $body_type -string $body_content]
+
+ lappend emailList $textT
+
+ #set email [webmail::create_email -content $content -attachment $attach -vcard $vcard_attach]
+
+ set multiT [mime::initialize -canonical multipart/mixed -parts $emailList]
+
+ set sender [ad_get_client_property webmail-system email]
+
+ ns_log Debug "Compose: Sending message from $sender to $to"
+ #acs_mail_lite::send -to_addr $to -from_addr $sender -subject $subject -body $email -extraheaders $header -package_id $package_id
+
+ set smtp_server [ad_get_client_property webmail-system smtp_server]
+ set username [ad_get_client_property webmail-system username]
+ set password [ad_get_client_property webmail-system password]
+ mime::setheader $multiT Subject $subject
+ mime::setheader $multiT X-Mailer "OpenACS 5.1"
+ mime::setheader $multiT Message-ID "[md5::md5 $body_content]$sender"
+
+ smtp::sendmessage $multiT \
+ -originator $sender \
+ -recipients $to \
+ -servers $smtp_server -username $username -password $password \
+ -debug 1 \
+ -header [list From $sender] \
+ -header [list To $to] \
+ -header [list Subject $subject] \
+ -header [list X-Mailer "OpenACS 5.1"] \
+ -header [list Message-ID "[md5::md5 $body_content]$sender"]
+ mime::finalize $multiT -subordinates all
+
+ webmail::notify_user -type "cool" -message "[_ webmail-system.Your_email_was_sent]"
+
+} -after_submit {
+ ad_returnredirect "welcome"
+ ad_script_abort
+}
+
+# --------------------------------------------------------------- #
+
+ad_return_template
+
+# ------------------------- END OF FILE ------------------------- #
Index: openacs-4/packages/webmail-system/www/compose.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/compose.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/compose.xql 6 Jun 2006 14:35:10 -0000 1.1
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+ select email from webmail_user_accounts where user_id = :user_id and active_p = 't'
+
+
+
+
+
+ select * from webmail_user_prefs where user_id = :user_id
+
+
+
+
+
+ select first_names, last_name, email_address from webmail_address_book where contact_id = :contact_id
+
+
+
+
Index: openacs-4/packages/webmail-system/www/contact-remove.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/contact-remove.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/contact-remove.tcl 6 Jun 2006 14:35:11 -0000 1.1
@@ -0,0 +1,40 @@
+# --------------------------------------------------------------- #
+# REMOVING A CONTACT #
+# #
+# LOCATION: packages/webmail-system/www/contact-remove.tcl #
+# #
+# --------------------------------------------------------------- #
+
+ad_page_contract {
+
+ Removing the contact.
+
+ @author Ayman Mohamed (mo2mo@hotmail.com)
+ @author Nima Mazloumi (mazloumi@uni-mannheim.de)
+ @creation-date 7/10/2002
+
+} {
+ contact_id:notnull,multiple
+}
+
+# -------------------------- PROCESSING ------------------------- #
+
+ns_log debug "WEBMAIL: Contact Remove started"
+set user_id [ad_conn user_id]
+
+set contacts [split $contact_id " "]
+set contacts [join $contacts "', '"]
+
+# Removing the contacts from the database
+if { [catch { db_dml remove_contacts $remove_contacts } errmsg ] } {
+ ns_log error "WEBMAIL: Contacts Remove: $errmsg"
+ ad_returnredirect "contacts?err=1"
+}
+
+ns_log debug "WEBMAIL: Contact Remove complete"
+
+# --------------------------------------------------------------- #
+
+ad_returnredirect "contacts"
+
+# ------------------------- END OF FILE ------------------------- #
Index: openacs-4/packages/webmail-system/www/contact-remove.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/contact-remove.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/contact-remove.xql 6 Jun 2006 14:35:11 -0000 1.1
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+ delete from webmail_address_book where contact_id IN (:contacts) and user_id = :user_id
+
+
+
+
Index: openacs-4/packages/webmail-system/www/contact.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/contact.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/contact.adp 6 Jun 2006 14:35:11 -0000 1.1
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+@page_title@
+
+#webmail-system.Please_fill_in_the_details_for_the_account_you_would_like_to_manage#
+
Index: openacs-4/packages/webmail-system/www/contact.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/contact.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/contact.tcl 6 Jun 2006 14:35:11 -0000 1.1
@@ -0,0 +1,73 @@
+# --------------------------------------------------------------- #
+# CONTACT #
+# #
+# LOCATION: packages/webmail-system/www/contact.tcl #
+# #
+# --------------------------------------------------------------- #
+
+ad_page_contract {
+
+ Managing contacts
+
+ @author Nima Mazloumi (mazloumi@uni-mannheim.de)
+ @creation-date 19/08/2004
+
+} {
+ contact_id:optional
+ first_names:optional
+ last_name:optional
+ email_address:optional
+}
+
+# ------------------------ SET VARIABLES ------------------------ #
+
+ns_log debug "WEBMAIL: Add Contact started"
+
+set user_id [ad_conn user_id]
+set page_title "#webmail-system.Contact Administration#"
+
+# ------------------------- CREATE FORM ------------------------- #
+
+ad_form -name contact -form {
+ contact_id:key(webmail_contact_seq)
+ {first_names:text
+ {html { size 30 }}
+ {label "#webmail-system.First_Names#"}}
+ {last_name:text
+ {html { size 30 }}
+ {label "#webmail-system.Last_Name#"}}
+ {email_address:text
+ {html { size 30 }}
+ {label "#webmail-system.Email#"}}
+ {nick:text,optional
+ {html { size 30 }}
+ {label "#webmail-system.Nickname#"}}
+} -select_query_name select_contact -on_request {
+ # for passing element values on the fly
+} -new_data {
+ if {![db_0or1row is_nick_unique {}]} {
+ db_dml add_contact {}
+ webmail::notify_user -type "cool" -message "[_ webmail-system.Contact_added]"
+ } else {
+ webmail::notify_user -type "error" -message "[_ webmail-system.Nick_already_exists]"
+ }
+} -edit_data {
+ if {![db_0or1row is_edited_nick_unique {}]} {
+ db_dml edit_contact {}
+ webmail::notify_user -type "info" -message "[_ webmail-system.Contact_changed]"
+ } else {
+ webmail::notify_user -type "error" -message "[_ webmail-system.Nick_already_exists]"
+ #ad_return_complaint 1 "[_ webmail-system.Nick_already_exists]"
+ }
+} -after_submit {
+ ad_returnredirect "contacts"
+ ad_script_abort
+}
+
+
+# --------------------------------------------------------------- #
+
+ns_log debug "WEBMAIL: Add Contact complete"
+ad_return_template
+
+# ------------------------- END OF FILE ------------------------- #
Index: openacs-4/packages/webmail-system/www/contact.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/contact.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/contact.xql 6 Jun 2006 14:35:11 -0000 1.1
@@ -0,0 +1,52 @@
+
+
+
+
+
+
+
+ insert into webmail_address_book (user_id, contact_id, email_address,
+ first_names, last_name, nick)
+ values (:user_id, :contact_id, :email_address,
+ :first_names, :last_name, :nick)
+
+
+
+
+
+
+
+ update webmail_address_book set
+ email_address = :email_address,
+ first_names = :first_names,
+ last_name = :last_name,
+ nick = :nick
+ where contact_id = :contact_id and user_id = :user_id
+
+
+
+
+
+
+
+ select * from webmail_address_book where contact_id = :contact_id and user_id = :user_id
+
+
+
+
+
+
+
+ select nick from webmail_address_book where user_id = :user_id and nick = :nick
+
+
+
+
+
+
+
+ select nick from webmail_address_book where user_id = :user_id and contact_id <> :contact_id and nick = :nick
+
+
+
+
Index: openacs-4/packages/webmail-system/www/contacts.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/contacts.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/contacts.adp 6 Jun 2006 14:35:11 -0000 1.1
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+@page_title@
+
+
+ Error: Selected contacts could not be removed as it
+ violates referential integrity
+
+
+
Index: openacs-4/packages/webmail-system/www/contacts.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/contacts.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/contacts.tcl 6 Jun 2006 14:35:11 -0000 1.1
@@ -0,0 +1,117 @@
+# --------------------------------------------------------------- #
+# CONTACTS #
+# #
+# LOCATION: packages/webmail-system/www/contacts.tcl #
+# #
+# --------------------------------------------------------------- #
+
+# ------------------------ PAGE CONTRACT ------------------------ #
+
+ad_page_contract {
+
+ The user's address (contacts) book.
+
+ @author Ayman Mohamed (mo2mo@hotmail.com)
+ @author Nima Mazloumi (mazloumi@uni-mannheim.de)
+ @creation-date 11/10/2002
+
+} {
+ err:optional
+ csv:optional
+ delete_p:optional
+ contact_id:optional
+}
+
+# ------------------------ SET VARIABLES ------------------------ #
+
+ns_log debug "WEBMAIL: Contacts started"
+
+set page_title "[_ webmail-system.User_contacts]"
+
+if { [info exists err] != 1 } {
+ set err 0
+}
+
+set id [ad_get_client_property webmail-system conn_id]
+set user_id [ad_conn user_id]
+
+set actions [list [_ webmail-system.Add_Contact] "contact" [_ webmail-system.Add_Contact] \
+ [_ webmail-system.CSV] "contacts?csv=yes" [_ webmail-system.CSV]]
+
+# Build the list-builder list
+template::list::create \
+ -name contacts \
+ -key contact_id \
+ -multirow contacts \
+ -actions $actions \
+ -sub_class {
+ tiny
+ } -elements {
+ edit {
+ label ""
+ display_template {
+
+ }
+ link_url_eval {[export_vars -base contact { contact_id {ad_form_mode edit}}]}
+ link_html {title "Edit this contact"}
+ } compose {
+ label ""
+ html "align right"
+ display_template {
+
+
+
+
+ }
+ } nick {
+ label "[_ webmail-system.Nickname]"
+ html "align left"
+ } first_names {
+ label "[_ webmail-system.First_Names]"
+ html "align left"
+ } last_name {
+ label "[_ webmail-system.Last_Name]"
+ html "align left"
+ } email_address {
+ label "[_ webmail-system.Email]"
+ html "align right"
+ } delete {
+ label ""
+ display_template {
+
+
+
+
+ }
+ sub_class narrow
+ }
+
+ } -selected_format csv -formats {
+ csv { output csv }
+ }
+
+# -------------------------- PROCESSING ------------------------- #
+
+#Delete account if requested
+if {[exists_and_not_null contact_id] && [exists_and_not_null delete_p]} {
+ db_dml delete_contact {}
+ webmail::notify_user -type "info" -message "[_ webmail-system.Contact_deleted]"
+}
+
+db_multirow -extend {delete_url} contacts get_contact_list {} {
+ set delete_url "contacts?[export_vars { contact_id {delete_p 't'} }]"
+}
+
+if { [exists_and_not_null csv] } {
+ template::list::write_output -name contacts
+}
+
+ns_log debug "WEBMAIL: Contacts complete"
+
+# --------------------------------------------------------------- #
+
+ad_return_template
+
+# ------------------------- END OF FILE ------------------------- #
Index: openacs-4/packages/webmail-system/www/contacts.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/contacts.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/contacts.xql 6 Jun 2006 14:35:11 -0000 1.1
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+ select * from webmail_address_book where user_id = :user_id order by first_names asc
+
+
+
+
+
+
+
+ delete from webmail_address_book where contact_id = :contact_id and user_id = :user_id
+
+
+
+
+
Index: openacs-4/packages/webmail-system/www/folder-create-2.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/folder-create-2.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/folder-create-2.tcl 6 Jun 2006 14:35:11 -0000 1.1
@@ -0,0 +1,50 @@
+# --------------------------------------------------------------- #
+# CREATING THE FOLDER #
+# #
+# LOCATION: packages/webmail-system/www/folder-create-2.tcl #
+# #
+# --------------------------------------------------------------- #
+
+ad_page_contract {
+
+ Creating the folder.
+
+ @author Ayman Mohamed (mo2mo@hotmail.com)
+ @author Nima Mazloumi (mazloumi@uni-mannheim.de)
+ @creation-date 7/10/2002
+
+} {
+ foldername:notnull
+}
+
+# ------------------- RETRIEVE SESSION PARAMS ------------------- #
+
+ns_log debug "WEBMAIL: Folder Create 2 started"
+
+set id [ad_get_client_property webmail-system conn_id]
+set server [ad_get_client_property webmail-system server]
+
+# ------------------ CHECKING SESSION VALIDITY ------------------ #
+
+# Checking if the user is logged in (ie. session currently running)
+# Also, checking if the connection is still alive
+if { [empty_string_p $id] || [catch { set new_mail [ns_imap ping $id] } errmsg] } {
+ webmail::expired_session "WEBMAIL: Add Attachment Error"
+ return
+}
+
+# -------------------------- PROCESSING ------------------------- #
+
+set name "\{$server\}mail/$foldername"
+
+if [catch { ns_imap m_create $id $name } errmsg] {
+ ns_log error "WEBMAIL: Folder Create 2 Error: $errmsg"
+}
+
+ns_log debug "WEBMAIL: Folder Create 2 complete"
+
+# --------------------------------------------------------------- #
+
+ad_returnredirect "folders"
+
+# ------------------------- END OF FILE ------------------------- #
Index: openacs-4/packages/webmail-system/www/folder-create.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/folder-create.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/folder-create.adp 6 Jun 2006 14:35:11 -0000 1.1
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+@page_title@
+@address@
+
+#webmail-system.Please_enter_the_name_of_the_new_folder_you_would_like_to_create#
+
+
\ No newline at end of file
Index: openacs-4/packages/webmail-system/www/folder-create.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/folder-create.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/folder-create.tcl 6 Jun 2006 14:35:11 -0000 1.1
@@ -0,0 +1,46 @@
+# --------------------------------------------------------------- #
+# CREATING A FOLDER #
+# #
+# LOCATION: packages/webmail-system/www/folder-create.tcl #
+# #
+# --------------------------------------------------------------- #
+
+ad_page_contract {
+
+ Form to creating a folder.
+
+ @author Ayman Mohamed (mo2mo@hotmail.com)
+ @author Nima Mazloumi (mazloumi@uni-mannheim.de)
+ @creation-date 7/10/2002
+
+} {
+}
+
+# ------------------------ SET VARIABLES ------------------------ #
+ns_log debug "WEBMAIL: Folder Create started"
+
+set page_title "#webmail-system.Creating_a_folder#"
+set submit_label "[_ webmail-system.Create]"
+set target "folder-create-2"
+set address "$username@$host"
+
+# ------------------------- CREATE FORM ------------------------- #
+
+form create new_folder -action $target
+
+element create new_folder foldername \
+ -datatype text \
+ -html { size 25 } \
+ -label "#webmail-system.Folder_name#"
+
+element create new_folder submit_button \
+ -widget submit \
+ -label $submit_label
+
+ns_log debug "WEBMAIL: Folder Create complete"
+
+# --------------------------------------------------------------- #
+
+ad_return_template
+
+# ------------------------- END OF FILE ------------------------- #
Index: openacs-4/packages/webmail-system/www/folder-delete-2.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/folder-delete-2.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/folder-delete-2.tcl 6 Jun 2006 14:35:10 -0000 1.1
@@ -0,0 +1,57 @@
+# --------------------------------------------------------------- #
+# DELETING A FOLDER #
+# #
+# LOCATION: packages/webmail-system/www/folder-delete-2.tcl #
+# #
+# --------------------------------------------------------------- #
+
+ad_page_contract {
+
+ Deleting a folder.
+
+ @author Ayman Mohamed (mo2mo@hotmail.com)
+ @author Nima Mazloumi (mazloumi@uni-mannheim.de)
+ @creation-date 7/10/2002
+
+} {
+ {name:notnull,multiple}
+}
+
+# ------------------- RETRIEVE SESSION PARAMS ------------------- #
+
+ns_log debug "WEBMAIL: Folder Delete 2 started"
+
+set id [ad_get_client_property webmail-system conn_id]
+set server [ad_get_client_property webmail-system server]
+
+# ------------------ CHECKING SESSION VALIDITY ------------------ #
+
+# Checking if the user is logged in (ie. session currently running)
+# Also, checking if the connection is still alive
+if { [empty_string_p $id] || [catch { set new_mail [ns_imap ping $id] } errmsg] } {
+ webmail::expired_session "WEBMAIL: Add Attachment Error"
+ return
+}
+
+# -------------------------- PROCESSING ------------------------- #
+
+if { [info exists name] } {
+
+ foreach foldername $name {
+ set foldername "\{$server\}$foldername"
+
+ ns_log debug "WEBMAIL: Deleting folder called $foldername"
+
+ if [catch { ns_imap m_delete $id $foldername } errmsg] {
+ ns_log debug "WEBMAIL: Cannot Delete Error: $errmsg"
+ }
+ }
+}
+
+ns_log debug "WEBMAIL: Folder complete"
+
+# --------------------------------------------------------------- #
+
+ad_returnredirect "folders"
+
+# ------------------------- END OF FILE ------------------------- #
Index: openacs-4/packages/webmail-system/www/folder-delete.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/folder-delete.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/folder-delete.adp 6 Jun 2006 14:35:10 -0000 1.1
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+@page_title@
+
+#webmail-system.Please_select_in_the_name_of_the_folder_you_would_like_to_delete#
+
+
Index: openacs-4/packages/webmail-system/www/folder-delete.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/folder-delete.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/folder-delete.tcl 6 Jun 2006 14:35:10 -0000 1.1
@@ -0,0 +1,88 @@
+# --------------------------------------------------------------- #
+# DELETING A FOLDER #
+# #
+# LOCATION: packages/webmail-system/www/folder-delete.tcl #
+# #
+# --------------------------------------------------------------- #
+
+ad_page_contract {
+
+ Form to delete a folder.
+
+ @author Ayman Mohamed (mo2mo@hotmail.com)
+ @author Nima Mazloumi (mazloumi@uni-mannheim.de)
+ @creation-date 11/10/2002
+
+} {
+}
+
+# ------------------- RETRIEVE SESSION PARAMS ------------------- #
+
+ns_log debug "WEBMAIL: Delete Folder started"
+
+set id [ad_get_client_property webmail-system conn_id]
+set username [ad_get_client_property webmail-system username]
+set server [ad_get_client_property webmail-system server]
+set host [ad_get_client_property webmail-system host]
+
+
+# ------------------ CHECKING SESSION VALIDITY ------------------ #
+
+# Checking if the user is logged in (ie. session currently running)
+# Also, checking if the connection is still alive
+if { [empty_string_p $id] || [catch { set new_mail [ns_imap ping $id] } errmsg] } {
+ webmail::expired_session "WEBMAIL: Add Attachment Error"
+ return
+}
+
+# ------------------------ SET VARIABLES ------------------------ #
+
+set page_title "#webmail-sytem.Deleting_a_folder#"
+set submit_label "[_ webmail-system.Delete]"
+set target "folder-delete-2"
+
+set mailbox "\{$server\}"
+
+# -------------------------- PROCESSING ------------------------- #
+
+set folders [ns_imap list $id $mailbox *]
+set fnames [list]
+
+foreach {odd even} $folders {
+ lappend fnames $odd
+}
+
+# Removing the root mail dir and the INBOX dir from the options
+set index [lsearch $fnames "mail"]
+set fnames [lreplace $fnames $index $index]
+
+set index [lsearch $fnames "INBOX"]
+set fnames [lreplace $fnames $index $index]
+
+# Duplicating values so that they can be used in the select
+foreach key $fnames {
+ lappend opts [list $key $key]
+}
+
+
+# ------------------------- CREATE FORM ------------------------- #
+
+form create remove_folder -action $target
+
+element create remove_folder foldername \
+ -widget select \
+ -datatype text \
+ -label "#webmail-system.Folder_name#" \
+ -options $opts
+
+element create remove_folder submit_button \
+ -widget submit \
+ -label $submit_label
+
+ns_log debug "WEBMAIL: Delete Folder complete"
+
+# --------------------------------------------------------------- #
+
+ad_return_template
+
+# ------------------------- END OF FILE ------------------------- #
Index: openacs-4/packages/webmail-system/www/folders.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/folders.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/folders.adp 6 Jun 2006 14:35:10 -0000 1.1
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+@page_title@
+
+
+
Index: openacs-4/packages/webmail-system/www/folders.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/folders.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/folders.tcl 6 Jun 2006 14:35:10 -0000 1.1
@@ -0,0 +1,89 @@
+# --------------------------------------------------------------- #
+# RETRIEVING FOLDER LIST #
+# #
+# LOCATION: packages/webmail-system/www/folders.tcl #
+# #
+# --------------------------------------------------------------- #
+
+ad_page_contract {
+
+ Retrieving the user's list of folders.
+
+ @author Ayman Mohamed (mo2mo@hotmail.com)
+ @author Nima Mazloumi (mazloumi@uni-mannheim.de)
+ @creation-date 30/9/2002
+
+} {
+}
+
+# ------------------- RETRIEVE SESSION PARAMS ------------------- #
+
+ns_log debug "WEBMAIL: Folders started"
+
+set id [ad_get_client_property webmail-system conn_id]
+set username [ad_get_client_property webmail-system username]
+set server [ad_get_client_property webmail-system server]
+set host [ad_get_client_property webmail-system host]
+
+# ------------------ CHECKING SESSION VALIDITY ------------------ #
+
+# Checking if the user is logged in (ie. session currently running)
+# Also, checking if the connection is still alive
+if { [empty_string_p $id] || [catch { set new_mail [ns_imap ping $id] } errmsg] } {
+ webmail::expired_session "WEBMAIL: Add Attachment Error"
+ return
+}
+
+# ------------------------ SET VARIABLES ------------------------ #
+
+set page_title "Retrieving folder list"
+
+set mailbox "\{$server\}"
+
+set actions [list [_ webmail-system.Create_Folder] "folder-create" [_ webmail-system.Create_Folder]]
+set bulk_actions [list [_ webmail-system.Delete_Folder] "folder-delete-2" [_ webmail-system.Delete_Folder]]
+set bulk_actions_export_vars [list "name"]
+
+template::list::create \
+ -name folder_list \
+ -key name \
+ -multirow folder_list \
+ -actions $actions \
+ -bulk_actions $bulk_actions \
+ -bulk_action_export_vars $bulk_actions_export_vars \
+ -sub_class {
+ tiny
+ } -elements {
+ name {
+ label "[_ webmail-system.Folder]"
+ link_url_col folder_link
+ html { align right }
+ }
+ }
+
+# -------------------------- PROCESSING ------------------------- #
+
+set folders [ns_imap list $id $mailbox *]
+set fnames [list]
+set number 0
+foreach {odd even} $folders {
+ incr number
+ lappend fnames [list $number $odd "retrieve?folder=$odd"]
+}
+
+multirow create folder_list number name folder_link
+
+foreach elm $fnames {
+ multirow append folder_list \
+ [lindex $elm 0] \
+ [lindex $elm 1] \
+ [lindex $elm 2]
+}
+
+ns_log debug "WEBMAIL: Folders complete"
+
+# --------------------------------------------------------------- #
+
+ad_return_template
+
+# ------------------------- END OF FILE ------------------------- #
Index: openacs-4/packages/webmail-system/www/help.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/help.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/help.adp 6 Jun 2006 14:35:11 -0000 1.1
@@ -0,0 +1,56 @@
+
+
+
+
+
+
+
+
+
+@page_title@
+
+
+
+
+
+
+
+
+
+
+
+
+
+#webmail-system.The_following_document_is_to_be_used#
+
+- #webmail-system.Login#
+
+#webmail-system.Login_Help_Text#
+
+#webmail-system.The_following_scenarios_can_only_be_performed_if-the_user_is_logged_in#
+ - #webmail-system.Inbox#
+
+#webmail-system.Inbox_Help_Text#
+
+ - #webmail-system.Viewing_email#
+
+#webmail-system.Viewing_Email_Help_Text#
+
+ - #webmail-system.Composing_an_email#
+
+#webmail-system.Composing_Email_Help_Text#
+
+ - #webmail-system.Folder_Management#
+
+#webmail-system.Folder_Management_Help_Text#
+
+ - #webmail-system.Contact_Management#
+
+#webmail-system.Contact_Management_Help_Text#
+ - #webmail-system.Logout#
+#webmail-system.Logout_Help_Text#
+
+ |
+
+
+
\ No newline at end of file
Index: openacs-4/packages/webmail-system/www/help.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/help.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/help.tcl 6 Jun 2006 14:35:11 -0000 1.1
@@ -0,0 +1,35 @@
+# --------------------------------------------------------------- #
+# HELP #
+# #
+# LOCATION: packages/webmail-system/www/help.tcl #
+# #
+# --------------------------------------------------------------- #
+
+# ------------------------ PAGE CONTRACT ------------------------ #
+
+ad_page_contract {
+
+ A help page for users.
+
+ @author Ayman Mohamed (mo2mo@hotmail.com)
+ @author Nima Mazloumi (mazloumi@uni-mannheim.de)
+ @creation-date 20/10/2002
+
+} {
+}
+
+# ------------------------ SET VARIABLES ------------------------ #
+ns_log debug "WEBMAIL: User Help started"
+
+set page_title "#webmail-system.User_Help#"
+set id [ad_get_client_property webmail-system conn_id]
+
+# -------------------------- PROCESSING ------------------------- #
+
+ns_log debug "WEBMAIL: User Help complete"
+
+# --------------------------------------------------------------- #
+
+ad_return_template
+
+# ------------------------- END OF FILE ------------------------- #
Index: openacs-4/packages/webmail-system/www/index.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/index.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/index.adp 6 Jun 2006 14:35:10 -0000 1.1
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+#webmail-system.This_service_is_currently_not_available#
\ No newline at end of file
Index: openacs-4/packages/webmail-system/www/index.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/index.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/index.tcl 6 Jun 2006 14:35:10 -0000 1.1
@@ -0,0 +1,51 @@
+# --------------------------------------------------------------- #
+# INDEX #
+# #
+# LOCATION: packages/webmail-system/www/index.tcl #
+# #
+# --------------------------------------------------------------- #
+
+# ------------------------ PAGE CONTRACT ------------------------ #
+
+ad_page_contract {
+
+ The index page tries to auto login user or to redirect to servers page
+ @author Nima Mazloumi (mazloumi@uni-mannheim.de)
+ @creation-date 25/08/2004
+
+} {
+}
+
+# ------------------------ SET VARIABLES ------------------------ #
+
+ns_log debug "WEBMAIL: Index started"
+
+set user_id [auth::require_login]
+
+#maybe in future add support for default server and autologin...we need user and password for that
+
+# -------------------------- PROCESSING ------------------------- #
+
+# If user has an account redirect to default account
+if {[db_0or1row has_account {}]} {
+ # ...redirect back to auto login
+ rp_form_put username $username
+ rp_form_put password $password
+ rp_form_put server_id $server_id
+ rp_form_put email $email
+ rp_internal_redirect "inside"
+ ad_script_abort
+}
+
+set allowed_p [parameter::get -parameter "MultipleAccountsAllowedP" -default 0]
+
+if { $allowed_p == 1 } {
+ rp_internal_redirect "accounts"
+ ad_script_abort
+}
+
+# --------------------------------------------------------------- #
+
+ns_log debug "WEBMAIL: Index complete"
+
+# ------------------------- END OF FILE ------------------------- #
Index: openacs-4/packages/webmail-system/www/index.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/index.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/index.xql 6 Jun 2006 14:35:10 -0000 1.1
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+ select neat_name, server_id from webmail_servers where active_p = 't'
+
+
+
+
+
+
+
+ select * from webmail_user_accounts where user_id = :user_id and default_p = 't'
+
+
+
+
+
Index: openacs-4/packages/webmail-system/www/inside.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/inside.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/inside.tcl 6 Jun 2006 14:35:10 -0000 1.1
@@ -0,0 +1,43 @@
+# --------------------------------------------------------------- #
+# INSIDE #
+# #
+# LOCATION: packages/webmail-system/www/inside.tcl #
+# #
+# --------------------------------------------------------------- #
+
+# ------------------------ PAGE CONTRACT ------------------------ #
+
+ad_page_contract {
+
+ Logs into the server and enters the user into the system \
+ if a correct connection to the server was made.
+
+ @author Ayman Mohamed (mo2mo@hotmail.com)
+ @author Nima Mazloumi (mazloumi@uni-mannheim.de)
+ @creation-date 26/9/2002
+
+} {
+ {username:optional {}}
+ {password:optional {}}
+ {server_id:optional {}}
+ {email:optional {}}
+}
+
+# ------------------------ SET VARIABLES ------------------------ #
+
+ns_log debug "WEBMAIL: Inside starting $username $password $server_id"
+
+# -------------------------- PROCESSING ------------------------- #
+
+set account_id [webmail::create_account -server_id $server_id -username $username -password $password -email $email]
+webmail::activate_account -account_id $account_id
+
+# ---------------------- SET SESSION PARAMS --------------------- #
+
+ns_log debug "WEBMAIL: Inside complete"
+
+# --------------------------------------------------------------- #
+
+ad_returnredirect "welcome"
+
+# ------------------------- END OF FILE ------------------------- #
Index: openacs-4/packages/webmail-system/www/inside.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/inside.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/inside.xql 6 Jun 2006 14:35:10 -0000 1.1
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+ select server_id, host_addr
+ from webmail_servers
+ where imap_addr = :imap_server
+
+
+
+
+
Index: openacs-4/packages/webmail-system/www/logout.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/logout.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/logout.adp 6 Jun 2006 14:35:11 -0000 1.1
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+@page_title@
+
+#webmail-system.Thank_you_for_using_IMAP_Webmail#
+#webmail-system.You_are_now_logged_out#
Index: openacs-4/packages/webmail-system/www/logout.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/logout.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/logout.tcl 6 Jun 2006 14:35:11 -0000 1.1
@@ -0,0 +1,38 @@
+# --------------------------------------------------------------- #
+# LOGOUT #
+# #
+# LOCATION: packages/webmail-system/www/logout.tcl #
+# #
+# --------------------------------------------------------------- #
+
+# ------------------------ PAGE CONTRACT ------------------------ #
+
+ad_page_contract {
+
+ Logs the user out of their current session.
+
+ @author Ayman Mohamed (mo2mo@hotmail.com)
+ @author Nima Mazloumi (mazloumi@uni-mannheim.de)
+ @creation-date 7/10/2002
+
+} {
+}
+
+# ------------------------ SET VARIABLES ------------------------ #
+
+ns_log debug "WEBMAIL: Logout started"
+
+set page_title "#webmail-sytem.Logout#"
+
+# -------------------------- PROCESSING ------------------------- #
+# Close the IMAP connection
+webmail::close_session
+webmail::notify_user -type "auth" -message "[_ webmail-system.Active_session_closed]"
+
+ns_log debug "WEBMAIL: Logout complete"
+
+# --------------------------------------------------------------- #
+
+ad_return_template
+
+# ------------------------- END OF FILE ------------------------- #
Index: openacs-4/packages/webmail-system/www/mail-delete.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/mail-delete.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/mail-delete.tcl 6 Jun 2006 14:35:11 -0000 1.1
@@ -0,0 +1,43 @@
+# --------------------------------------------------------------- #
+# MAIL DELETE #
+# #
+# LOCATION: packages/webmail-system/www/mail-delete.tcl #
+# #
+# --------------------------------------------------------------- #
+
+# ------------------------ PAGE CONTRACT ------------------------ #
+
+ad_page_contract {
+
+ Deleting a user's email
+
+ @author Ayman Mohamed (mo2mo@hotmail.com)
+ @author Nima Mazloumi (mazloumi@uni-mannheim.de)
+ @creation-date 11/10/2002
+
+} {
+ {number:integer,multiple,optional}
+}
+
+# ------------------- RETRIEVE SESSION PARAMS ------------------- #
+
+ns_log debug "WEBMAIL: Mail Delete started"
+
+# ------------------------ SET VARIABLES ------------------------ #
+
+set id [ad_get_client_property webmail-system conn_id]
+
+# -------------------------- PROCESSING ------------------------- #
+
+if { [info exists number] } {
+ foreach num $number {
+ #Todo: It works but with an error msg
+ set err_p [catch { [ns_imap delete $id $num] } errmsg]
+ ns_imap expunge $id
+ }
+}
+
+ns_log debug "WEBMAIL: Mail Delete complete"
+
+ad_return_template "retrieve"
+# ------------------------- END OF FILE ------------------------- #
\ No newline at end of file
Index: openacs-4/packages/webmail-system/www/mail-reply.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/mail-reply.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/mail-reply.adp 6 Jun 2006 14:35:10 -0000 1.1
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+@page_title@
+
+
\ No newline at end of file
Index: openacs-4/packages/webmail-system/www/mail-reply.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/mail-reply.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/mail-reply.tcl 6 Jun 2006 14:35:10 -0000 1.1
@@ -0,0 +1,124 @@
+# --------------------------------------------------------------- #
+# MAIL REPLY #
+# #
+# LOCATION: packages/webmail-system/www/mail-reply.tcl #
+# #
+# --------------------------------------------------------------- #
+
+# ------------------------ PAGE CONTRACT ------------------------ #
+
+ad_page_contract {
+
+ Replying to a user's email
+
+ @author Ayman Mohamed (mo2mo@hotmail.com)
+ @author Nima Mazloumi (mazloumi@uni-mannheim.de)
+ @creation-date 11/10/2002
+
+} {
+ number:notnull
+ action:notnull
+}
+
+
+# ------------------------ SET VARIABLES ------------------------ #
+
+ns_log debug "WEBMAIL: Mail Reply started"
+
+set user_id [ad_conn user_id]
+# Different settings based on each action (reply or forward)
+if { $action == "reply"} {
+ set page_title "#webmail-system.Mail_reply#"
+ set prefix [_ webmail-system.Re]
+} else {
+ set page_title "#webmail-system.Mail_forward#"
+ set prefix [_ webmail-system.Fwd]
+}
+
+set id [ad_get_client_property webmail-system conn_id]
+set recipient [ns_imap header $id $number from]
+set subject "[_ webmail-system.Re] [ns_imap header $id $number subject]"
+set sender [ns_imap header $id $number to]
+
+set content ""
+
+# -------------------------- PROCESSING ------------------------- #
+
+ns_imap struct $id $number -array struct
+# Preparing the body format in the reply message
+if { $struct(type) == "multipart" } {
+ for { set i 1 } { $i <= $struct(part.count) } { incr i } {
+ array set part $struct(part.$i)
+ if { ![info exists part(body.name)] } {append content [ns_imap body $id $number $i -decode]}
+ }
+} else {
+ set content [ns_imap text $id $number]
+}
+
+set body "\n\n\n\n---------------[_ webmail-system.Original_Message]---------------\n\n"
+append body "[_ webmail-system.To] $sender\n[_ webmail-system.From] $recipient\n[_ webmail-system.Subject] $subject\n\n"
+append body $[ad_html_to_text $content]
+append body "\n\n-------------[_ webmail-system.End_Original_Message]-------------\n"
+
+append prefix $subject
+
+# Scanning the recipient line for just the email without any other
+# tags or strings such as < > or ""
+
+set found [regexp {([-A-Za-z0-9_.]+@[-A-Za-z0-9_.]+)} $recipient match email]
+
+# Recipient only used if the action is reply
+set recipient $email
+
+# ------------------------- CREATE FORM ------------------------- #
+
+set use_wysiwyg_p [parameter::get -parameter "UseWysiwygP" -default "f"]
+
+set opts [list]
+
+db_multirow emails get_emails {} {
+ lappend opts [list "$username@$host_addr"]
+}
+
+ad_form -name reply_email -form {
+ {from:text(select)
+ {html {single single}}
+ {options $opts}
+ {value "[lindex $opts 0]"}
+ {label "[_ webmail-system.From]"}}
+ {to:text
+ {html { size 74 }}
+ {label "[_ webmail-system.To]"}}
+ {cc:text,optional
+ {html { size 74 }}
+ {label "[_ webmail-system.Cc]"}}
+ {bcc:text,optional
+ {html { size 74 }}
+ {label "[_ webmail-system.Bcc]"}}
+ {subject:text
+ {html { size 74 }}
+ {label "[_ webmail-system.Subject]"}}
+ {attachment:file,optional
+ {html { size 37 }}
+ {label "[_ webmail-system.Attachment]"}}
+ {body:richtext(richtext),optional
+ {htmlarea_p $use_wysiwyg_p}
+ {html { cols 56 rows 8 wrap soft }}
+ {label "[_ webmail-system.Body]"}}
+ {submit:text(submit)
+ {label "[_ webmail-system.Send]"}
+ }
+} -action "sending" -on_request {
+} -on_request {
+ set htmlarea_p $use_wysiwyg_p
+ set body [template::util::richtext::create $content "text/html"]
+ if { $action == "reply" } {set to $recipient}
+}
+
+# --------------------------------------------------------------- #
+
+ns_log debug "WEBMAIL: Mail Reply complete"
+
+ad_return_template
+
+# ------------------------- END OF FILE ------------------------- #
Index: openacs-4/packages/webmail-system/www/mail-reply.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/mail-reply.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/mail-reply.xql 6 Jun 2006 14:35:10 -0000 1.1
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+ select wa.username, ws.host_addr from webmail_user_accounts wa, webmail_servers ws where wa.user_id = :user_id and ws.server_id = wa.server_id and wa.active_p = 't'
+
+
+
+
+
Index: openacs-4/packages/webmail-system/www/not-logged-in.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/not-logged-in.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/not-logged-in.adp 6 Jun 2006 14:35:10 -0000 1.1
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
+
+
+
+@page_title@
+@context_bar@
+
+#webmail-system.This_page_cannot_be_accessed_without_being_logged_in#
+
+#webmail-system.One_of_the_following_may_have_happened#
+
+ - #webmail-system.The_username_password_you_supplied_is_not_valid#
+ - #webmail-system.Your_current_webmail_session_has_expired#
+ - #webmail-system.You_are_currently_not_logged_in#
+
+#webmail-system.Please_log_in_before_performing_this_action#
+
+
+#webmail-system.Login#
+#webmail-system.Accounts#
+
Index: openacs-4/packages/webmail-system/www/not-logged-in.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/not-logged-in.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/not-logged-in.tcl 6 Jun 2006 14:35:10 -0000 1.1
@@ -0,0 +1,64 @@
+# --------------------------------------------------------------- #
+# NOT LOGGED IN ERROR PAGE #
+# #
+# LOCATION: packages/webmail-system/www/not-logged-in.tcl #
+# #
+# --------------------------------------------------------------- #
+
+ad_page_contract {
+
+ Resulting error page when a page is accessed without \
+ the user being logged in. This may also occur if their \
+ session has expired.
+
+ @author Ayman Mohamed (mo2mo@hotmail.com)
+ @author Nima Mazloumi (mazloumi@uni-mannheim.de)
+ @creation-date 14/9/2002
+
+} {
+}
+
+# ------------------------ SET VARIABLES ------------------------ #
+
+set page_title [_ webmail-system.User_not_logged_in]
+set context_bar [_ webmail-system.Error_Not_Logged_In]
+set allowed_p [parameter::get -parameter "MultipleAccountsAllowedP" -default 0]
+# --------------------------------------------------------------- #
+
+ad_return_template
+
+# ------------------------- END OF FILE ------------------------- #
+
+
+#ns_write "\n\n__________ START OF EMAIL NUMBER $x __________\n\n"
+
+#if { [ns_imap n_msgs $id] >= $x } {
+
+# ns_write "Debug From [ns_imap header $id $x from] about [ns_imap header $id $x subject]"
+# ns_write "\n"
+
+
+# foreach { name value } [ns_imap headers $id $x] {
+# ns_write "Debug HEADER: $name: $value"
+# ns_write "\n"
+# }
+# foreach { name value } [ns_imap struct $id $x] {
+# if { [string range $name 0 3] == "part" } {
+# set no [string range $name 4 end]
+# foreach { name value } $value {
+# ns_write "Debug PART$no: $name: $value"
+# ns_write "\n"
+# }
+# continue
+# }
+# ns_write "Debug $name: $value"
+# ns_write "\n"
+# }
+
+#}
+
+#ns_write "\n\n------ *email body* ------\n\n"
+
+#ns_write "[ns_imap text $id $x]"
+
+#ns_write "\n\n__________ END OF EMAIL NUMBER $x __________\n\n"
Index: openacs-4/packages/webmail-system/www/preferences.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/preferences.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/preferences.adp 6 Jun 2006 14:35:10 -0000 1.1
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+@page_title@
+
+
+
+
+ @card_name@ | @card_type@ |
+@card_content@ |
+
+
+To be implemented:
+
+- Configuring sent folder
+
- Configuring draft folder
+
- Configuring number of lines per page
+
\ No newline at end of file
Index: openacs-4/packages/webmail-system/www/preferences.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/preferences.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/preferences.tcl 6 Jun 2006 14:35:11 -0000 1.1
@@ -0,0 +1,134 @@
+# --------------------------------------------------------------- #
+# PREFERENCES #
+# #
+# LOCATION: packages/webmail-system/www/preferences.tcl #
+# #
+# --------------------------------------------------------------- #
+
+# ------------------------ PAGE CONTRACT ------------------------ #
+
+ad_page_contract {
+
+ Allows the user to modify their preferences.
+
+ @author Ayman Mohamed (mo2mo@hotmail.com)
+ @author Nima Mazloumi (mazloumi@uni-mannheim.de)
+ @creation-date 11/10/2002
+
+} {
+ user_id:optional
+}
+
+# ------------------------ SET VARIABLES ------------------------ #
+
+ns_log debug "Preferences started"
+
+set user_id [ad_conn user_id]
+set page_title "[_ webmail-system.User_Preferences]"
+
+# ------------------------- CREATE FORM ------------------------- #
+
+set options [list]
+lappend options [list "[_ webmail-system.Full_HTML]" 0]
+lappend options [list "[_ webmail-system.HTML_without_CSS]" 1]
+lappend options [list "[_ webmail-system.Enhanced_Text]" 2]
+lappend options [list "[_ webmail-system.Plain_Text]" 3]
+
+set opts [list]
+lappend opts [list "[_ webmail-system.Text]" 0]
+lappend opts [list "[_ webmail-system.Icons]" 1]
+
+set use_wysiwyg_p [parameter::get -parameter "UseWysiwygP" -default "f"]
+set has_card_p 0
+
+ad_form -html { enctype multipart/form-data } -name preferences -form {
+ user_id:key
+ {has_pref_p:text(hidden)}
+ {old_card:text(hidden),optional}
+ {signature:richtext(richtext),optional
+ {label "[_ webmail-system.Signature]"}
+ {html { cols 50 rows 10 wrap soft accesskey s}}
+ {htmlarea_p $use_wysiwyg_p}
+ {help_text {[_ webmail-system.You_can_enter_your_signature_here]}}}
+ {js_enabled:text(radio),optional
+ {label "[_ webmail-system.JavaScript]"}
+ {html { accesskey j}}
+ {help_text {[_ webmail-system.Should_we_allow_JavaScript_in_emails_sent_to_you]}}
+ {options {{Yes 1} {No 0}}}}
+ {style:text(select)
+ {label "[_ webmail-system.Style]"}
+ {html { accesskey t}}
+ {help_text {[_ webmail-system.How_should_we_handle_HTML]}}
+ {options $options}}
+ {vcardfile:file,optional
+ {html { size 30 accesskey v }}
+ {label "[_ webmail-system.vCard]"}
+ {help_text {[_ webmail-system.You_can_upload_a_vcard_here]}}}
+ {nav_bar:text(select)
+ {options $opts}
+ {html { accesskey n}}
+ {label "[_ webmail-system.Navigation_bar]"}}
+} -edit_request {
+
+ set htmlarea_p $use_wysiwyg_p
+
+ if {[db_0or1row select_prefs {}]} {
+ set has_pref_p 1
+ if {[exists_and_not_null vcard]} {
+ set has_card_p 1
+ set old_card $vcard
+ set card_name [lindex $old_card 0]
+ set card_type [lindex $old_card 1]
+ set card_content [lindex $old_card 2]
+ } else {
+ set has_card_p 0
+ set old_card ""
+ }
+
+ if {[exists_and_not_null signature]} {
+ set sign_content [lindex $signature 0]
+ set sign_type [lindex $signature 1]
+ set signature [template::util::richtext::create $sign_content $sign_type]
+ } else {
+ set signature [template::util::richtext::create "" "text/html"]
+ }
+ } else {
+ set has_pref_p 0
+ set old_card ""
+ set signature [template::util::richtext::create "" "text/html"]
+ }
+
+} -on_submit {
+ if {[exists_and_not_null vcardfile]} {
+ set vcard [webmail::read_file -file $vcardfile]
+ } else {
+ if { $has_pref_p == 1 } {
+ set vcard $old_card
+ } else {
+ set vcard ""
+ }
+ }
+
+ if { $has_pref_p == 0 } {
+ db_dml new_preferences {}
+ ns_log Notice "WRITING PREF"
+ } else {
+ db_dml update_preferences {}
+ }
+ if {$js_enabled == 1} {
+ webmail::notify_user -type "warning" -message "[_ webmail-system.Are_you_sure_you_want_JavaScript_enabled]"
+ }
+ ad_set_client_property webmail-system nav_bar $nav_bar
+ webmail::notify_user -type "info" -message "[_ webmail-system.Preferences_changed]"
+} -after_submit {
+ ad_returnredirect "welcome"
+ ad_script_abort
+}
+
+ns_log debug "WEBMAIL: Preferences complete"
+
+# --------------------------------------------------------------- #
+
+ad_return_template
+
+# ------------------------- END OF FILE ------------------------- #
Index: openacs-4/packages/webmail-system/www/preferences.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/preferences.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/preferences.xql 6 Jun 2006 14:35:11 -0000 1.1
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+ select * from webmail_user_prefs where user_id = :user_id
+
+
+
+
+
+
+
+ insert into webmail_user_prefs
+ (user_id, signature, js_enabled, style, vcard, nav_bar)
+ values
+ (:user_id, :signature, :js_enabled, :style, :vcard, :nav_bar)
+
+
+
+
+
+
+
+ update webmail_user_prefs
+ set signature = :signature,
+ js_enabled = :js_enabled,
+ style = :style,
+ vcard = :vcard,
+ nav_bar = :nav_bar
+ where user_id = :user_id
+
+
+
+
+
Index: openacs-4/packages/webmail-system/www/retrieve.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/retrieve.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/retrieve.adp 6 Jun 2006 14:35:10 -0000 1.1
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
+
+
+
+@page_title@
+
+
+
+
+
+
+
+
+ #webmail-system.Current_Folder# @folder@ |
+ #webmail-system.Total_messages_recent_messages# |
+
+
+
+
+
+
+ |
+
+
+
+
+ |
+
+
+
+
+
+ #webmail-system.There_are_no_emails_within_this_folder#
+
+
+
Index: openacs-4/packages/webmail-system/www/retrieve.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/retrieve.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/retrieve.tcl 6 Jun 2006 14:35:10 -0000 1.1
@@ -0,0 +1,207 @@
+# --------------------------------------------------------------- #
+# RETRIEVING INBOX LIST #
+# #
+# LOCATION: packages/webmail-system/www/retrieve.tcl #
+# #
+# --------------------------------------------------------------- #
+
+ad_page_contract {
+
+ Retrieving the user's email list from their inbox.
+
+ @author Ayman Mohamed (mo2mo@hotmail.com)
+ @author Nima Mazloumi (mazloumi@uni-mannheim.de)
+ @creation-date 14/9/2002
+
+} {
+ finished_p:optional
+ folder:optional
+ orderby:optional
+ rewind:optional
+ forward:optional
+}
+
+# ------------------------ SET VARIABLES ------------------------ #
+ns_log debug "WEBMAIL: Retrieval Started"
+
+set page_title "#webmail-system.Retrieving_email_list#"
+
+set id [ad_get_client_property webmail-system conn_id]
+
+if { [catch { set status [ns_imap status $id] } errmsg] } {
+ webmail::notify_user -type "error" -message "[_ webmail-system.Communication_problem_Please_reload_page]"
+}
+set recent_msgs [ns_imap n_recent $id]
+set total_msgs [ns_imap n_msgs $id]
+if { ![exists_and_not_null folder] } {
+ set folder [ns_imap getparam $id mailbox.name]
+}
+
+set bulk_actions [list [_ webmail-system.Delete_selected_emails] "mail-delete" [_ webmail-system.Delete_selected_emails]]
+set bulk_actions_export_vars [list "number"]
+
+# Build the list-builder list
+template::list::create \
+ -name emails \
+ -multirow emails \
+ -key number \
+ -bulk_actions $bulk_actions \
+ -bulk_action_export_vars $bulk_actions_export_vars \
+ -sub_class {
+ tiny
+ } -elements {
+ number {
+ label ""
+ html "align right"
+ } contact {
+ label ""
+ html "align right"
+ display_template {
+
+ \
+
+
+
+
+ \
+
+
+
+ }
+ } sender {
+ label "[_ webmail-system.Sender]"
+ html "align left"
+ } subject {
+ label "[_ webmail-system.Subject]"
+ html "align left"
+ link_url_col subject_link
+ } date {
+ label "[_ webmail-system.Date]"
+ html "align left"
+ } size {
+ label "[_ webmail-system.File_size]"
+ html "align right"
+ } delete {
+ label ""
+ html "align center"
+ display_template {
+ \
+
+ }
+ }
+ } -orderby {
+ sender {orderby sender}
+ size {orderby size}
+ subject {orderby subject}
+ date {orderby date}
+ } -selected_format csv -formats {
+ csv { output csv }
+ }
+
+multirow create emails number max sender email first_names last_name subject subject_link date size attachments
+
+# -------------------------- PROCESSING ------------------------- #
+
+
+# Looping through all messages (num_of_msgs) in the folder
+if {![exists_and_not_null finished_p]} {
+ set finished_p 0
+} else {
+ set finished_p 1
+}
+
+if { !$finished_p } {
+ ad_progress_bar_begin \
+ -title "[_ webmail-system.Getting_your_emails]" \
+ -message_1 "[_ webmail-system.Depending_on_the_provider_you_use_this_may_take_a_while]" \
+ -message_2 "[_ webmail-system.We_will_continue_automatically_when_retrieval_is_complete]" \
+ -template "templates/progress-bar"
+}
+
+ns_log debug "WEBMAIL: Retrieval started"
+
+#number of messages
+set msg [ns_imap n_msgs $id]
+
+# pagination
+set limit [parameter::get -parameter "MaxListSize" -default 20]
+set count 0
+set next [ad_get_client_property webmail-system next]
+if {![exists_and_not_null next]} { set next 1 }
+
+#if {[exists_and_not_null forward]} { set next $next }
+if {[exists_and_not_null rewind]} {
+ set backward [expr $next - 2*$limit]
+ if { $backward <= 0 } { set backward 1 }
+ set next $backward
+}
+
+for {set x $next} {$x <= $total_msgs} {incr x} {
+
+ if { $count == $limit } {
+ ad_set_client_property webmail-system next $x
+ break
+ }
+
+ set number $x
+ set sender [ns_imap header $id $x from]
+
+ webmail::parse_sender -sender $sender -array person
+
+ set subject [ns_imap header $id $x subject]
+ if { $subject == "" } {
+ set subject "#webmail-system.No_Subject#"
+ }
+ set subject_link "view?number=$number"
+ set date [ns_imap header $id $x date]
+ set sdate [ns_imap parsedate $date]
+ if {$sdate != ""} {
+ # If date was parsed correctly set to locale format
+ set date [ns_fmttime $sdate "%x %X"]
+ } else {
+ # If date was not parsed correctly
+ set date [lrange [split $date " "] 0 3]
+ }
+ ns_imap struct $id $number -array struct
+ set size [webmail::mail_format_size $struct(size)]
+ if { $struct(type) == "multipart" } {
+ set attachments 1
+ } else {
+ set attachments 0
+ }
+
+ # Determining whether the current emails is the last in the folder
+ if { $number < $msg } {
+ set max 0 ;#false
+ set next_num [expr $number + 1]
+ } else {
+ set max 1 ;#true
+ }
+
+ multirow append emails $number $max $sender $person(email) $person(first_names) $person(last_name) $subject $subject_link $date $size $attachments
+
+ incr count
+}
+if { [exists_and_not_null orderby] } {
+ regexp {([^,]*),(.*)} $orderby match column order
+
+ if { $order == "asc" } {
+ template::multirow sort emails -increasing $column
+ } elseif { $order == "desc" } {
+ template::multirow sort emails -decreasing $column
+ }
+}
+
+if { !$finished_p } {
+ ad_progress_bar_end -url "retrieve?finished_p=1"
+}
+
+ns_log debug "WEBMAIL: Retrieval complete"
+
+# --------------------------------------------------------------- #
+
+ad_return_template
+
+# ------------------------- END OF FILE ------------------------- #
Index: openacs-4/packages/webmail-system/www/sending.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/sending.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/sending.tcl 6 Jun 2006 14:35:10 -0000 1.1
@@ -0,0 +1,55 @@
+# --------------------------------------------------------------- #
+# SENDING AN EMAIL #
+# #
+# LOCATION: packages/webmail-system/www/sending.tcl #
+# #
+# --------------------------------------------------------------- #
+
+# ------------------------ PAGE CONTRACT ------------------------ #
+
+ad_page_contract {
+
+ Sending an email
+
+ @author Ayman Mohamed (mo2mo@hotmail.com)
+ @author Nima Mazloumi (mazloumi@uni-mannheim.de)
+ @creation-date Sept 25, 2002
+
+} {
+ from:notnull
+ to:notnull
+ cc:optional
+ bcc:optional
+ subject:optional
+ body:optional
+ attachment:optional
+}
+
+# ------------------------- SET VARIABLES ----------------------- #
+
+if { $cc == "" } {
+ set to_and_cc "$to"
+ ns_log debug "WEBMAIL: CC is nil"
+} else {
+ set to_and_cc "$to, $cc"
+ ns_log debug "WEBMAIL: CC not nill: $to_and_cc"
+}
+
+# -------------------------- PROCESSING ------------------------- #
+
+ns_log debug "WEBMAIL: $from $to_and_cc $subject $body"
+
+#webmail::mail_send $from $to_and_cc $subject $body
+set upload_file [template::util::file::get_property filename $attachment]
+set tmpfile [template::util::file::get_property tmp_filename $attachment]
+set type [template::util::file::get_property mime_type $attachment]
+ns_log Notice "ATTACHMENT: <$attachment> <$upload_file> <$tmpfile> <$type>"
+
+
+ns_log debug "WEBMAIL: Email processed."
+
+# --------------------------------------------------------------- #
+
+ad_returnredirect "retrieve"
+
+# ------------------------- END OF FILE ------------------------- #
Index: openacs-4/packages/webmail-system/www/view-attach.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/view-attach.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/view-attach.tcl 6 Jun 2006 14:35:10 -0000 1.1
@@ -0,0 +1,36 @@
+# --------------------------------------------------------------- #
+# VIEWING ATTACHMENT #
+# #
+# LOCATION: packages/webmail-system/www/view-attach.tcl #
+# #
+# --------------------------------------------------------------- #
+
+ad_page_contract {
+
+ Viewing an attachment from an email.
+
+ @author Ayman Mohamed (mo2mo@hotmail.com)
+ @author Nima Mazloumi (mazloumi@uni-mannheim.de)
+ @creation-date 21/10/2002
+
+} {
+ number:notnull
+ part:notnull
+}
+
+# -------------------------- PROCESSING ------------------------- #
+ns_log debug "WEBMAIL: View Attach started"
+
+# Retrieving the id from the current session (null = not logged in)
+set id [ad_get_client_property webmail-system conn_id]
+
+# Retrieving the attachment and sending it to the HTTP connection
+ns_imap body $id $number $part -return
+
+ns_log debug "WEBMAIL: View Attach complete"
+
+# --------------------------------------------------------------- #
+
+ad_returnredirect "view?number=$number"
+
+# ------------------------- END OF FILE ------------------------- #
Index: openacs-4/packages/webmail-system/www/view.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/view.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/view.adp 6 Jun 2006 14:35:11 -0000 1.1
@@ -0,0 +1,106 @@
+
+
+
+
+
+
+
+
+
+@print_version;noquote@
+
+
+
+@page_title@
+
+
+
+
+
+
+
+ #webmail-system.Current_Folder#@folder@ |
+
+
+ @number@ | @msg@
+
+
+ @number@ | @msg@ |
+
+
+
+ | @number@ | @msg@
+
+
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ |
+
+
+
+
+
+
+
+
+ |
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: openacs-4/packages/webmail-system/www/view.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/view.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/view.tcl 6 Jun 2006 14:35:11 -0000 1.1
@@ -0,0 +1,162 @@
+#---------------------------------------------------------------- #
+# VIEWING SELECTED EMAIL #
+# #
+# LOCATION: packages/webmail-system/www/view.tcl #
+# #
+# --------------------------------------------------------------- #
+
+ad_page_contract {
+
+ Viewing the contents of the user's selected email.
+
+ @author Ayman Mohamed (mo2mo@hotmail.com)
+ @author Nima Mazloumi (mazloumi@uni-mannheim.de)
+ @creation-date 1/10/2002
+
+} {
+ number:notnull
+ header:optional
+ print_p:optional
+}
+
+# ------------------------ SET VARIABLES ------------------------ #
+ns_log debug "WEBMAIL: View started"
+
+set page_title "#webmail-system.Viewing_email#"
+
+set user_id [ad_conn user_id]
+
+set style 0
+set js_enabled 0
+db_0or1row select_prefs {}
+
+if {[exists_and_not_null print_p]} {
+ set print_p 1
+} else {
+ set print_p 0
+}
+
+set id [ad_get_client_property webmail-system conn_id]
+
+if { [exists_and_not_null header] } {
+ set header_p 1
+ set header [join [ns_imap headers $id $number]
]
+} else {
+ set header_p 0
+}
+
+set msg [ns_imap n_msgs $id]
+set status [ns_imap status $id]
+set folder [ns_imap getparam $id mailbox.name]
+
+# Build the list-builder list
+template::list::create \
+ -name files \
+ -multirow files \
+ -elements {
+ part_num {
+ label ""
+ html "align right"
+ display_template {
+
+
+
+ }
+ } name {
+ label "[_ webmail-system.Filename]"
+ html "align left"
+ link_url_col file_link
+ } type {
+ label "[_ webmail-system.File_type]"
+ html "align left"
+ } size {
+ label "[_ webmail-system.File_size]"
+ html "align left"
+ }
+ }
+
+
+# ------------------------- PROCESSING 1 ------------------------ #
+
+# Looping through all messages in the folder (ie. $msg)
+
+# Determining whether the current email is the first in the folder
+if { $number > 1 } {
+ set min 0 ;# false
+ set prev_num [expr $number - 1]
+} else {
+ set min 1 ;# true
+}
+
+# Determining whether the current emails is the last in the folder
+if { $number < $msg } {
+ set max 0 ;#false
+ set next_num [expr $number + 1]
+} else {
+ set max 1 ;#true
+}
+
+# ------------------------- PROCESSING 2 ------------------------ #
+
+# Retrieving all components of the message including attachments
+# if they are within the email
+
+ns_imap struct $id $number -array struct
+
+# Basic headers
+set recipients [ns_imap header $id $number to]
+set cc [ns_imap header $id $number cc]
+set date [ns_imap header $id $number date]
+set sender [webmail::mail_decode_hdr [ns_imap header $id $number from]]
+webmail::parse_sender -sender $sender -array person
+
+set subject [webmail::mail_decode_hdr [ns_imap header $id $number subject]]
+
+if { $subject == "" } {
+ set subject "#webmail-system.No_Subject#"
+}
+
+set flags $struct(flags)
+set attachments 0
+
+set print_version "[ad_system_name]
\
+ [_ webmail-system.From] $sender
\
+ [_ webmail-system.To] $recipients
\
+ [_ webmail-system.Subject] $subject
\
+ [_ webmail-system.Date] $date
"
+
+# For multipart messages show plain text in the body and list of attachments below
+if { $struct(type) == "multipart" } {
+ set attachments 1
+ set body ""
+
+ multirow create files part_num name file_link type size item_no
+
+ for { set i 1 } { $i <= $struct(part.count) } { incr i } {
+ array set part $struct(part.$i)
+ if { [info exists part(body.name)] } {
+ set part_type [string tolower "$part(type)/$part(subtype)"]
+ set part_size [webmail::mail_format_size $part(bytes)]
+ multirow append files "$i" "$part(body.name)" "view-attach?number=$number&part=$i" "$part_type" "$part_size" "$number"
+ } else {
+ set content [ns_imap body $id $number $i -decode]
+ append body [webmail::mail_format_body [webmail::change_format -content_type $struct(type) -style $style -js_enabled $js_enabled -body $content]]
+ append print_version [webmail::mail_format_body [webmail::change_format -content_type $struct(type) -style 3 -js_enabled 0 -body $content]]
+ }
+ }
+} else {
+ set attachments 0
+ set content [ns_imap text $id $number]
+ set body [webmail::mail_format_body [webmail::change_format -content_type $struct(type) -style $style -js_enabled $js_enabled -body $content]]
+ append print_version [webmail::mail_format_body [webmail::change_format -content_type $struct(type) -style 3 -js_enabled 0 -body $content]]
+}
+
+set body_size [string length $body]
+
+ns_log debug "WEBMAIL: Viewing complete"
+
+# --------------------------------------------------------------- #
+
+ad_return_template
+
+# ------------------------- END OF FILE ------------------------- #
Index: openacs-4/packages/webmail-system/www/view.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/view.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/view.xql 6 Jun 2006 14:35:11 -0000 1.1
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+ select style, js_enabled from webmail_user_prefs where user_id = :user_id
+
+
+
+
+
Index: openacs-4/packages/webmail-system/www/welcome.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/welcome.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/welcome.adp 6 Jun 2006 14:35:10 -0000 1.1
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+
+
+@page_title@
+
+#webmail-system.Welcome#
+
+
+ 
+
+ #webmail-system.You_have_recent_msgs_new_mail_message#
+
+
+ #webmail-system.You_have_recent_msgs_new_mail_messages#
+
+
+
+
#webmail-system.You_have_no_new_mail#
+
Index: openacs-4/packages/webmail-system/www/welcome.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/welcome.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/welcome.tcl 6 Jun 2006 14:35:10 -0000 1.1
@@ -0,0 +1,45 @@
+# --------------------------------------------------------------- #
+# WELCOME #
+# #
+# LOCATION: packages/webmail-system/www/welcome.tcl #
+# #
+# --------------------------------------------------------------- #
+
+# ------------------------ PAGE CONTRACT ------------------------ #
+
+ad_page_contract {
+
+ Welcome page for the user.
+
+ @author Ayman Mohamed (mo2mo@hotmail.com)
+ @author Nima Mazloumi (mazloumi@uni-mannheim.de)
+ @creation-date 27/9/2002
+
+} {
+}
+
+# ------------------------ SET VARIABLES ------------------------ #
+
+set page_title "#webmail-system.Welcome#"
+
+ns_log debug "WEBMAIL: Welcome started"
+
+set id [ad_get_client_property webmail-system conn_id]
+if { [empty_string_p $id] || [catch { set new_mail [ns_imap ping $id] } errmsg] } {
+ webmail::expired_session "WEBMAIL: no active session"
+ return
+} else {
+ set username [ns_imap getparam $id user]
+}
+# -------------------------- PROCESSING ------------------------- #
+
+# If new_mail is 1, then new mail exists - for ping above
+set recent_msgs [ns_imap n_recent $id]
+
+ns_log debug "WEBMAIL: Welcome complete"
+
+# --------------------------------------------------------------- #
+
+ad_return_template
+
+# ------------------------- END OF FILE ------------------------- #
Index: openacs-4/packages/webmail-system/www/admin/account.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/admin/account.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/admin/account.adp 6 Jun 2006 14:35:11 -0000 1.1
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+@page_title@
+@address@
+
+#webmail-system.Please_fill_in_the_details_for_the_IMAP_server_you_would_like_to_add#
+
Index: openacs-4/packages/webmail-system/www/admin/account.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/admin/account.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/admin/account.tcl 6 Jun 2006 14:35:11 -0000 1.1
@@ -0,0 +1,103 @@
+# --------------------------------------------------------------- #
+# ADMIN ACCOUNT #
+# #
+# LOCATION: packages/webmail-system/www/account.tcl #
+# #
+# --------------------------------------------------------------- #
+
+# ------------------------ PAGE CONTRACT ------------------------ #
+
+ad_page_contract {
+
+ Admin Account
+
+ @author Nima Mazloumi (mazloumi@uni-mannheim.de)
+ @creation-date 23/08/2004
+
+} {
+ account_id:optional
+}
+
+# ------------------------ SET VARIABLES ------------------------ #
+
+set page_title "#webmail-system.Adding_an_account#"
+set address "Administrator"
+set id [ad_get_client_property webmail-system conn_id]
+
+set opts [list]
+
+db_multirow -extend { server_line } servers get_servers {} {
+ set server_line "$neat_name ($host_addr)"
+ lappend opts [list $server_line $server_id ]
+}
+
+set uopts [list]
+
+db_multirow -extend { name } users get_users {} {
+ acs_user::get -user_id $user_id -array user
+ set name "$user(first_names) $user(last_name)"
+ lappend uopts [list $name $user_id ]
+}
+
+ns_log debug "WEBMAIL: Admin Server started"
+
+# ------------------------- CREATE FORM ------------------------- #
+
+ad_form -name account -form {
+ account_id:key(webmail_account_seq)
+ {user_id:text(select)
+ {options $uopts}
+ {label "#webmail-system.User#"}
+ {html {single single}}}
+ {server_id:text(select)
+ {options $opts}
+ {label "#webmail-system.Server#"}
+ {html {single single}}}
+ {username:text
+ {html { size 30}}
+ {label "#webmail-system.Username#"}}
+ {password:text(password)
+ {label "#webmail-system.Password#"}}
+ {email:text
+ {label "#webmail-system.Email#"}}
+} -select_query_name select_account -on_request {
+ # if only default server allowed
+} -new_data {
+
+ if {![webmail::verify_email -server_id $server_id -email $email -username $username]} {
+ ad_return_complaint 1 "[_ webmail-system.Bad_Email]"
+ ad_script_abort
+ }
+
+ if { [catch { db_dml add_account {} } errmsg] } {
+ webmail::notify_user -type "error" -message "[_ webmail-system.This_account_exists_already]"
+ } else {
+ webmail::notify_user -type "info" -message "[_ webmail-system.Account_created]"
+ }
+
+} -edit_data {
+
+ if {![webmail::verify_email -server_id $server_id -email $email -username $username]} {
+ ad_return_complaint 1 "[_ webmail-system.Bad_Email]"
+ ad_script_abort
+ }
+
+ if { [catch { db_dml edit_account {} } errmsg] } {
+ webmail::notify_user -type "error" -message "[_ webmail-system.This_account_exists_already]"
+ } else {
+ webmail::notify_user -type "info" -message "[_ webmail-system.Account_changed]"
+ }
+
+} -after_submit {
+ ad_returnredirect "users"
+ ad_script_abort
+}
+
+
+ns_log debug "WEBMAIL: Admin Account completed"
+
+# --------------------------------------------------------------- #
+
+ad_return_template
+
+# ------------------------- END OF FILE ------------------------- #
Index: openacs-4/packages/webmail-system/www/admin/account.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/admin/account.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/admin/account.xql 6 Jun 2006 14:35:11 -0000 1.1
@@ -0,0 +1,44 @@
+
+
+
+
+
+
+
+ insert into webmail_user_accounts (account_id, server_id, user_id,
+ email, username, password, active_p, default_p)
+ values (:account_id, :server_id, :user_id, :email, :username,
+ :password, 't', 't')
+
+
+
+
+
+
+ update webmail_user_accounts
+ set email = :email,
+ username = :username,
+ password = :password
+ where account_id = :account_id
+
+
+
+
+
+ select * from webmail_servers where active_p = 't'
+
+
+
+
+
+ select user_id from users where user_id <> 0;
+
+
+
+
+
+ select * from webmail_user_accounts where account_id = :account_id
+
+
+
+
Index: openacs-4/packages/webmail-system/www/admin/index.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/admin/index.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/admin/index.adp 6 Jun 2006 14:35:11 -0000 1.1
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+@page_title@
+@address@
\ No newline at end of file
Index: openacs-4/packages/webmail-system/www/admin/index.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/admin/index.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/admin/index.tcl 6 Jun 2006 14:35:11 -0000 1.1
@@ -0,0 +1,39 @@
+# --------------------------------------------------------------- #
+# ADMIN INDEX #
+# #
+# LOCATION: packages/webmail-system/www/admin/index.tcl #
+# #
+# --------------------------------------------------------------- #
+
+# ------------------------ PAGE CONTRACT ------------------------ #
+
+ad_page_contract {
+
+ Index for administration tasks.
+
+ @author Ayman Mohamed (mo2mo@hotmail.com)
+ @author Nima Mazloumi (mazloumi@uni-mannheim.de)
+ @creation-date 20/10/2002
+
+} {
+}
+
+# ------------------------ SET VARIABLES ------------------------ #
+
+set address ""
+
+set page_title "#webmail-system.Webmail_Administration#"
+
+set package_id [ad_conn package_id]
+
+permission::require_permission -object_id $package_id -privilege admin
+
+ns_log debug "WEBMAIL: Administration"
+
+# -------------------------- PROCESSING ------------------------- #
+
+# --------------------------------------------------------------- #
+
+ad_return_template
+
+# ------------------------- END OF FILE ------------------------- #
Index: openacs-4/packages/webmail-system/www/admin/reset-system.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/admin/reset-system.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/admin/reset-system.adp 6 Jun 2006 14:35:11 -0000 1.1
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+@page_title@
+
+
+#webmail-system.You_can_reset_the_complete_webmail_system_here#
+#webmail-system.This_is_an_extreme_action_You_should_know_what_you_are_doing#
+#webmail-system.Do_you_really_want_to_reset_the_whole_webmail_system#
+#webmail-system.Yes#
+#webmail-system.No1#
+
+
+@result;noquote@
+
\ No newline at end of file
Index: openacs-4/packages/webmail-system/www/admin/reset-system.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/admin/reset-system.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/admin/reset-system.tcl 6 Jun 2006 14:35:11 -0000 1.1
@@ -0,0 +1,60 @@
+# --------------------------------------------------------------- #
+# ADMIN SYSTEM RESET #
+# #
+# LOCATION: packages/webmail-system/www/admin/reset-system.tcl #
+# #
+# --------------------------------------------------------------- #
+
+# ------------------------ PAGE CONTRACT ------------------------ #
+
+ad_page_contract {
+
+ Possible page to reset the entire database.
+
+ @author Ayman Mohamed (mo2mo@hotmail.com)
+ @author Nima Mazloumi (mazloumi@uni-mannheim.de)
+ @creation-date 20/10/2002
+
+} {
+ confirm_p:optional
+}
+
+# ------------------------ SET VARIABLES ------------------------ #
+
+set page_title "#webmail-system.System_Reset#"
+
+ns_log debug "WEBMAIL: System Reset"
+
+# -------------------------- PROCESSING ------------------------- #
+
+set result ""
+if {[exists_and_not_null confirm_p]} {
+
+ #Deleting all user accounts
+ db_dml delete_accounts {delete from webmail_user_accounts}
+
+ append result "[_ webmail-system.All_accounts_deleted]
"
+
+ #Deleting all user preferences
+ db_dml delete_prefs {delete from webmail_user_prefs}
+
+ append result "[_ webmail-system.All_user_preferences_deleted]
"
+
+ #Deleting all user contacts
+ db_dml delete_contacts {delete from webmail_address_book}
+
+ append result "[_ webmail-system.All_address_books_deleted]
"
+
+ #Deleting all servers
+ db_dml delete_servers {delete from webmail_servers}
+
+ #append result "[_ webmail-system.All_servers_deleted]
"
+
+}
+
+
+# --------------------------------------------------------------- #
+
+ad_return_template
+
+# ------------------------- END OF FILE ------------------------- #
Index: openacs-4/packages/webmail-system/www/admin/server-remove.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/admin/server-remove.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/admin/server-remove.tcl 6 Jun 2006 14:35:11 -0000 1.1
@@ -0,0 +1,46 @@
+# --------------------------------------------------------------- #
+# ADMIN REMOVE USERS #
+# #
+# LOCATION: packages/webmail-system/www/admin/user-remove.tcl #
+# #
+# --------------------------------------------------------------- #
+
+# ------------------------ PAGE CONTRACT ------------------------ #
+
+ad_page_contract {
+
+ Admin user functionality - removing a user.
+
+ @author Nima Mazloumi (mazloumi@uni-mannheim.de)
+ @creation-date 23/08/2004
+
+} -query {
+ {server_id:multiple,notnull}
+}
+
+# ------------------------ SET VARIABLES ------------------------ #
+
+set address "Administrator"
+set page_title "#webmail-system.Server_Administration#"
+
+set server_ids [split $server_id " "]
+set server_ids [join $server_ids "', '"]
+
+ns_log debug "WEBMAIL: User Administration: Server Remove"
+
+# -------------------------- PROCESSING ------------------------- #
+
+# Removing the servers from the database
+if { [catch { db_dml remove_server {} } errmsg ] } {
+ ns_log error "WEBMAIL: Server Remove: $errmsg"
+ ad_returnredirect "servers?err=1"
+}
+
+ns_log debug "WEBMAIL: User Administration: Remove"
+
+# --------------------------------------------------------------- #
+
+ad_returnredirect "servers"
+ad_script_abort
+
+# ------------------------- END OF FILE ------------------------- #
Index: openacs-4/packages/webmail-system/www/admin/server-remove.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/admin/server-remove.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/admin/server-remove.xql 6 Jun 2006 14:35:11 -0000 1.1
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+ select server_id, neat_name, imap_addr, host_addr
+ from webmail_servers
+
+
+
+
+
+
+
+ delete from webmail_servers where server_id IN (:server_ids)
+
+
+
+
+
Index: openacs-4/packages/webmail-system/www/admin/server.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/admin/server.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/admin/server.adp 6 Jun 2006 14:35:11 -0000 1.1
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+@page_title@
+@address@
+
+#webmail-system.Please_fill_in_the_details_for_the_server_you_would_like_to_manage#
+
Index: openacs-4/packages/webmail-system/www/admin/server.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/admin/server.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/admin/server.tcl 6 Jun 2006 14:35:11 -0000 1.1
@@ -0,0 +1,89 @@
+# --------------------------------------------------------------- #
+# ADMIN SERVER #
+# #
+# LOCATION: packages/webmail-system/www/server.tcl #
+# #
+# --------------------------------------------------------------- #
+
+# ------------------------ PAGE CONTRACT ------------------------ #
+
+ad_page_contract {
+
+ Admin Server
+
+ @author Nima Mazloumi (mazloumi@uni-mannheim.de)
+ @creation-date 23/08/2004
+
+} {
+ server_id:optional
+}
+
+# ------------------------ SET VARIABLES ------------------------ #
+
+set page_title "#webmail-system.Adding_a_server#"
+set address "Administrator"
+
+set user_id [ad_conn user_id]
+
+set opts [list]
+db_multirow auth_types get_auth_types {} {
+ lappend opts [list $type $type_id]
+}
+
+set options [list]
+db_multirow server_types get_serv_types {} {
+ lappend options [list $type $type_id]
+}
+
+ns_log debug "WEBMAIL: Admin Server started"
+
+# ------------------------- CREATE FORM ------------------------- #
+
+ad_form -name server -form {
+ server_id:key(webmail_server_seq)
+ {neat_name:text
+ {label "#webmail-system.Server_Name#"}}
+ {imap_addr:text
+ {label "#webmail-system.IMAP_Server#"}}
+ {host_addr:text
+ {label "#webmail-system.Server_Host#"}}
+ {host_append_p:text(select)
+ {label "#webmail-system.Append_Host#"}
+ {options {{Yes 1} {No 0}}}}
+ {imap_port:text
+ {label "#webmail-system.IMAP_Port#"}}
+ {active_p:text(select)
+ {options {{Yes t} {No f}}}
+ {label "#webmail-system.Active#"}}
+ {server_type:text(select)
+ {label "#webmail-system.Type#"}
+ {options $options}}
+ {auth_type:text(select)
+ {label "#webmail-system.Authentication_Type#"}
+ {options $opts}}
+ {smtp_addr:text
+ {label "#webmail-system.SMTP#"}}
+ {smtp_port:text
+ {label "#webmail-system.SMTP_Port#"}}
+ {smtp_auth_p:text(select)
+ {options {{Yes t} {No f}}}
+ {label "#webmail-system.SMTP_Auth#"}}
+} -select_query_name select_server -on_request {
+ # if only default server allowed
+} -new_data {
+ db_dml add_server {}
+} -edit_data {
+ db_dml edit_server {}
+} -after_submit {
+ ad_returnredirect "servers"
+ ad_script_abort
+}
+
+
+ns_log debug "WEBMAIL: Admin Server complete"
+
+# --------------------------------------------------------------- #
+
+ad_return_template
+
+# ------------------------- END OF FILE ------------------------- #
Index: openacs-4/packages/webmail-system/www/admin/server.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/admin/server.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/admin/server.xql 6 Jun 2006 14:35:11 -0000 1.1
@@ -0,0 +1,54 @@
+
+
+
+
+
+
+ select * from webmail_auth_types
+
+
+
+
+
+ select * from webmail_serv_types
+
+
+
+
+
+ select * from webmail_servers where server_id = :server_id
+
+
+
+
+
+
+ insert into webmail_servers (server_id, neat_name,
+ host_addr, imap_addr, imap_port, active_p,
+ auth_type, server_type, host_append_p, smtp_addr, smtp_auth_p, smtp_port)
+ values (:server_id, :neat_name, :host_addr, :imap_addr,
+ :imap_port, :active_p, :auth_type, :server_type,
+ :host_append_p, :smtp_addr, :smtp_auth_p, :smtp_port)
+
+
+
+
+
+
+ update webmail_servers
+ set neat_name = :neat_name,
+ host_addr = :host_addr,
+ imap_addr = :imap_addr,
+ active_p = :active_p,
+ imap_port = :imap_port,
+ auth_type = :auth_type,
+ server_type = :server_type,
+ host_append_p = :host_append_p,
+ smtp_addr = :smtp_addr,
+ smtp_auth_p = :smtp_auth_p,
+ smtp_port = :smtp_port
+ where server_id = :server_id
+
+
+
+
Index: openacs-4/packages/webmail-system/www/admin/servers.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/admin/servers.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/admin/servers.adp 6 Jun 2006 14:35:11 -0000 1.1
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+@page_title@
+@address@
+
+
+ Error: Selected server could not be removed as it violates referential integrity
+
+
+
Index: openacs-4/packages/webmail-system/www/admin/servers.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/admin/servers.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/admin/servers.tcl 6 Jun 2006 14:35:11 -0000 1.1
@@ -0,0 +1,147 @@
+# --------------------------------------------------------------- #
+# ADMIN SERVERS #
+# #
+# LOCATION: packages/webmail-system/www/admin/servers.tcl #
+# #
+# --------------------------------------------------------------- #
+
+# ------------------------ PAGE CONTRACT ------------------------ #
+
+ad_page_contract {
+
+ Admin servers
+
+ @author Ayman Mohamed (mo2mo@hotmail.com)
+ @author Nima Mazloumi (mazloumi@uni-mannheim.de)
+ @creation-date 20/10/2002
+
+} {
+ err:optional
+ active_p:optional
+ server_id:optional
+ delete_p:optional
+ smtp_auth_p:optional
+}
+
+# ------------------------ SET VARIABLES ------------------------ #
+ns_log debug "WEBMAIL: Server Administration"
+
+set address "Administrator"
+set page_title "#webmail-system.Server_Administration#"
+
+# -------------------------- PROCESSING ------------------------- #
+
+set actions [list [_ webmail-system.Add_Server] "server" [_ webmail-system.Add_Server]]
+set bulk_actions [list [_ webmail-system.Remove_Server] "server-remove" [_ webmail-system.Remove_Server]]
+set bulk_actions_export_vars [list "server_id"]
+
+# Build the list-builder list
+template::list::create \
+ -name servers \
+ -key server_id \
+ -actions $actions \
+ -bulk_actions $bulk_actions \
+ -multirow servers \
+ -sub_class {
+ tiny
+ } -elements {
+ edit {
+ label ""
+ display_template {
+
+ }
+ link_url_eval {[export_vars -base server { server_id {ad_form_mode edit}}]}
+ link_html {title "Edit this server"}
+ } server_type {
+ label "[_ webmail-system.Type]"
+ html "align left"
+ } neat_name {
+ label "[_ webmail-system.Server_Name]"
+ html "align left"
+ } imap_server {
+ label "[_ webmail-system.Imap_Address]"
+ html "align left"
+ display_template {
+ @servers.imap_addr@:@servers.imap_port@
+ }
+ } host_addr {
+ label "[_ webmail-system.Host_Address]"
+ html "align left"
+ } smtp_server {
+ label "[_ webmail-system.SMTP] / [_ webmail-system.Authentication]"
+ html "align left"
+ display_template {
+ @servers.smtp_addr@:@servers.smtp_port@
+
+
+
+
+
+
+
+
+ }
+ } active {
+ label "[_ webmail-system.Active]"
+ html "align right"
+ display_template {
+
+
+
+
+
+
+
+
+ }
+ } delete {
+ label ""
+ display_template {
+
+
+
+
+ }
+ }
+ }
+
+if { [info exists err] != 1 } {
+ set err 0
+}
+
+#Deactivate server if requested
+if {[exists_and_not_null server_id] && [exists_and_not_null active_p]} {
+ db_dml toggle_activity {}
+}
+
+#Delete Server if requested
+if {[exists_and_not_null server_id] && [exists_and_not_null delete_p]} {
+ db_dml delete_server {}
+}
+
+#Set SMTP Authentication Mode if requested
+if {[exists_and_not_null server_id] && [exists_and_not_null smtp_auth_p]} {
+ db_dml toggle_smtp_auth_p {}
+}
+
+db_multirow -extend { active_p_url delete_url smtp_auth_p_url} servers get_all_servers {} {
+ set toggle_active_p [ad_decode $active_p "t" "f" "t"]
+ set active_p_url "servers?[export_vars { server_id {active_p $toggle_active_p} }]"
+ set delete_url "servers?[export_vars { server_id {delete_p 't'} }]"
+ set toggle_smtp_auth_p [ad_decode $smtp_auth_p "t" "f" "t"]
+ set smtp_auth_p_url "servers?[export_vars { server_id {smtp_auth_p $toggle_smtp_auth_p} }]"
+}
+
+ns_log debug "WEBMAIL: Server Administration complete"
+
+# --------------------------------------------------------------- #
+
+ad_return_template
+
+# ------------------------- END OF FILE ------------------------- #
Index: openacs-4/packages/webmail-system/www/admin/servers.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/admin/servers.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/admin/servers.xql 6 Jun 2006 14:35:11 -0000 1.1
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+ select ws.server_id, ws.neat_name, ws.host_addr, ws.smtp_addr, ws.smtp_auth_p,
+ ws.imap_port, ws.active_p, ws.imap_addr, ws.smtp_port, (select type from
+ webmail_serv_types where ws.server_type = type_id) as server_type from webmail_servers ws order by ws.neat_name
+
+
+
+
+
+ update webmail_servers set active_p = :active_p where server_id = :server_id
+
+
+
+
+
+ delete from webmail_servers where server_id = :server_id
+
+
+
+
+
+ update webmail_servers set smtp_auth_p = :smtp_auth_p where server_id = :server_id
+
+
+
+
Index: openacs-4/packages/webmail-system/www/admin/user-remove.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/admin/user-remove.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/admin/user-remove.tcl 6 Jun 2006 14:35:11 -0000 1.1
@@ -0,0 +1,49 @@
+# --------------------------------------------------------------- #
+# ADMIN REMOVE USERS #
+# #
+# LOCATION: packages/webmail-system/www/admin/user-remove.tcl #
+# #
+# --------------------------------------------------------------- #
+
+# ------------------------ PAGE CONTRACT ------------------------ #
+
+ad_page_contract {
+
+ Admin user functionality - removing a user.
+
+ @author Ayman Mohamed (mo2mo@hotmail.com)
+ @author Nima Mazloumi (mazloumi@uni-mannheim.de)
+ @creation-date 23/10/2002
+
+} {
+ user_id:multiple
+}
+
+# ------------------------ SET VARIABLES ------------------------ #
+
+set address "Administrator"
+set page_title "#webmail-system.User_Administration#"
+
+set users [split $user_id " "]
+set users [join $users "', '"]
+
+ns_log debug "WEBMAIL: User Administration: Remove"
+
+# -------------------------- PROCESSING ------------------------- #
+
+# Removing the user account from the database
+if { [catch { db_dml remove_account {} } errmsg ] } {
+ ns_log error "WEBMAIL: User Account Remove: $errmsg"
+ ad_returnredirect "users?err=1"
+}
+
+# ------------------------- CREATE FORM ------------------------- #
+
+
+ns_log debug "WEBMAIL: User Administration: Remove"
+
+# --------------------------------------------------------------- #
+
+ad_returnredirect "users"
+
+# ------------------------- END OF FILE ------------------------- #
Index: openacs-4/packages/webmail-system/www/admin/user-remove.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/admin/user-remove.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/admin/user-remove.xql 6 Jun 2006 14:35:11 -0000 1.1
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+ select wa.account_id, wa.server_id, wa.login_name, wa.email_address, wa.first_name, wa.last_name, ws.server_id, ws.neat_name, ws.imap_addr
+ from webmail_user_accounts wa, webmail_servers ws
+ where ws.server_id = wa.server_id
+
+
+
+
+
+
+
+ delete from webmail_user_accounts where user_id IN (:users)
+
+
+
+
+
Index: openacs-4/packages/webmail-system/www/admin/users.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/admin/users.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/admin/users.adp 6 Jun 2006 14:35:11 -0000 1.1
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+@page_title@
+@address@
+
+
+ #webmail-system.Error_Selected_user_could_not_be_removed_as_it_violates_referential_integrity#
+
+
Index: openacs-4/packages/webmail-system/www/admin/users.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/admin/users.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/admin/users.tcl 6 Jun 2006 14:35:11 -0000 1.1
@@ -0,0 +1,117 @@
+# --------------------------------------------------------------- #
+# ADMIN USERS #
+# #
+# LOCATION: packages/webmail-system/www/admin/users.tcl #
+# #
+# --------------------------------------------------------------- #
+
+# ------------------------ PAGE CONTRACT ------------------------ #
+
+ad_page_contract {
+
+ Admin user functionality.
+
+ @author Nima Mazloumi (mazloumi@uni-mannheim.de)
+ @creation-date 15/08/2004
+
+} {
+ err:optional
+ server_id:optional
+ account_id:optional
+ active_p:optional
+ delete_p:optional
+}
+
+# ------------------------ SET VARIABLES ------------------------ #
+
+set address "Administrator"
+
+set page_title "#webmail-system.User_Administration#"
+
+set actions [list [_ webmail-system.Add_Account] "account" [_ webmail-system.Add_Account]]
+set bulk_actions [list [_ webmail-system.Remove_User] "user-remove" [_ webmail-system.Remove_User]]
+set bulk_action_export_vars [list "user_id"]
+
+# Build the list-builder list
+template::list::create \
+ -name users \
+ -key user_id \
+ -actions $actions \
+ -bulk_actions $bulk_actions \
+ -bulk_action_export_vars $bulk_action_export_vars \
+ -multirow users \
+ -sub_class {
+ tiny
+ } -elements {
+ user_id {
+ label "[_ webmail-system.Id]"
+ html "align right"
+ } username {
+ label "[_ webmail-system.Username]"
+ html "align left"
+ } first_names {
+ label "[_ webmail-system.First_Names]"
+ html "align left"
+ } last_name {
+ label "[_ webmail-system.Last_Name]"
+ html "align left"
+ } neat_name {
+ label "[_ webmail-system.Server_Name]"
+ html "align left"
+ } active {
+ label "[_ webmail-system.Active]"
+ html "align right"
+ display_template {
+
+
+
+
+
+
+
+
+ }
+ } delete {
+ label ""
+ display_template {
+
+
+
+
+ }
+ }
+ }
+
+#Deactivate user if requested
+if {[exists_and_not_null server_id] && [exists_and_not_null account_id] && [exists_and_not_null active_p]} {
+ db_dml toggle_activity {}
+}
+
+#Delete account if requested
+if {[exists_and_not_null server_id] && [exists_and_not_null account_id] && [exists_and_not_null delete_p]} {
+ db_dml delete_user {}
+}
+
+ns_log debug "WEBMAIL: User Administration"
+
+# -------------------------- PROCESSING ------------------------- #
+
+if { [info exists err] != 1 } {
+ set err 0
+}
+
+db_multirow -extend { active_p_url delete_url} users get_users {} {
+ set toggle_active_p [ad_decode $active_p "t" "f" "t"]
+ set active_p_url "users?[export_vars { server_id {account_id $user_id} {active_p $toggle_active_p} }]"
+ set delete_url "users?[export_vars { server_id {account_id $user_id} {delete_p 't'} }]"
+}
+
+# --------------------------------------------------------------- #
+
+ad_return_template
+
+# ------------------------- END OF FILE ------------------------- #
\ No newline at end of file
Index: openacs-4/packages/webmail-system/www/admin/users.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/admin/users.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/admin/users.xql 6 Jun 2006 14:35:11 -0000 1.1
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+
+ select wa.user_id, p.first_names, p.last_name, wa.username,
+ ws.neat_name, ws.server_id, wa.active_p from
+ webmail_user_accounts wa, webmail_servers ws, persons p where
+ wa.server_id = ws.server_id and p.person_id = wa.user_id
+
+
+
+
+
+
+
+ update webmail_user_accounts set active_p = :active_p where user_id = :account_id and server_id = :server_id
+
+
+
+
+
+
+
+ delete from webmail_user_accounts where user_id = :account_id and server_id = :server_id
+
+
+
+
+
Index: openacs-4/packages/webmail-system/www/admin/images/openacs1.gif
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/admin/images/openacs1.gif,v
diff -u
Binary files differ
Index: openacs-4/packages/webmail-system/www/admin/images/openacs2.gif
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/admin/images/openacs2.gif,v
diff -u
Binary files differ
Index: openacs-4/packages/webmail-system/www/admin/images/spacer.gif
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/admin/images/spacer.gif,v
diff -u
Binary files differ
Index: openacs-4/packages/webmail-system/www/admin/styles/styles.css
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/admin/styles/styles.css,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/admin/styles/styles.css 6 Jun 2006 14:35:11 -0000 1.1
@@ -0,0 +1,126 @@
+.heading {
+ font-size: 14pt;
+ color: white;
+ font-weight: bold;
+ font-family: Arial, Helvetica, sans-serif
+}
+
+.standard {
+ font-size: 12pt;
+ color: black;
+ font-family: Arial, Helvetica, sans-serif;
+}
+
+PRE {
+ font-size: 12pt;
+ color: black;
+ font-family: Arial, Helvetica, sans-serif;
+}
+
+BODY {
+ color: black;
+ background: silver;
+ font-family: Arial, Helvetica, sans-serif
+}
+
+TABLE.outline {
+ border-width: medium;
+ border-color: white
+}
+
+H1.special {
+ text-align: center;
+ color: #006699;
+ font-size: 30pt;
+ font-family: Arial, Helvetica, sans-serif
+}
+
+P {
+ font-size: 12pt;
+ color: black;
+ font-family: Arial, Helvetica, sans-serif
+}
+
+P.title-rght {
+ text-align: right;
+ color: white;
+ font-size: 13pt;
+ font-family: Arial, Helvetica, sans-serif
+}
+
+P.error-red {
+ font-size: 12pt;
+ color: red;
+ font-family: Arial, Helvetica, sans-serif
+}
+
+TD.footer {
+ font-size: 10pt;
+ font-family: Arial, Helvetica, sans-serif
+}
+
+TD.head-lft {
+ font-size: 13pt;
+ text-align: left;
+ font-family: Arial, Helvetica, sans-serif
+}
+
+TD.head-rght {
+ font-size: 13pt;
+ text-align: right;
+ font-family: Arial, Helvetica, sans-serif
+}
+
+TD.standard {
+ font-size: 12pt;
+ color: black;
+ font-family: Arial, Helvetica, sans-serif;
+}
+
+TD.link {
+ font-size: 13pt;
+ color: purple;
+ font-family: Arial, Helvetica, sans-serif
+}
+
+TD.center {
+ font-size: 12pt;
+ text-align: center;
+ color: black;
+ font-family: Arial, Helvetica, sans-serif
+}
+
+TD.center-bld {
+ text-align: center;
+ font-weight: bold;
+ font-size: 12pt;
+ color: black;
+ font-family: Arial, Helvetica, sans-serif;
+}
+
+TD.center-bld-2 {
+ text-align: center;
+ font-weight: bold;
+ font-size: 13pt;
+ color: black;
+ font-family: Arial, Helvetica, sans-serif;
+}
+
+TD.view-head {
+ font-size: 12pt;
+ text-align: left;
+ font-weight: bold;
+ color: black;
+ font-family: Arial, Helvetica, sans-serif
+}
+
+LI.error-red {
+ font-size: 12pt;
+ color: red;
+ font-family: Arial, Helvetica, sans-serif
+}
+
+/* Links */
+A:link { text-decoration: none }
+A:active { text-decoration: none }
+A:visited { text-decoration: none }
Index: openacs-4/packages/webmail-system/www/admin/templates/master-template-admin.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/admin/templates/master-template-admin.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/admin/templates/master-template-admin.adp 6 Jun 2006 14:35:11 -0000 1.1
@@ -0,0 +1,35 @@
+
+
+
+
+
+
+
+
+
+@page_title@
+
+
+
+
+
Index: openacs-4/packages/webmail-system/www/admin/templates/master-template-admin.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/admin/templates/master-template-admin.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/admin/templates/master-template-admin.tcl 6 Jun 2006 14:35:11 -0000 1.1
@@ -0,0 +1,38 @@
+# --------------------------------------------------------------- #
+# ADMIN TEMPLATE #
+# #
+# webmail-system/www/template/master-template-admin.tcl #
+# #
+# --------------------------------------------------------------- #
+
+# ------------------------ PAGE CONTRACT ------------------------ #
+
+ad_page_contract {
+
+ Administration Template
+
+ @author Nima Mazloumi (mazloumi@uni-mannheim.de)
+ @creation-date 15/08/2004
+
+ } {
+
+ } -properties {
+ page_title:onevalue
+ address:onevalue
+ }
+
+# ------------------------ SET VARIABLES ------------------------ #
+
+set page_title "\#webmail-system.Webmail_Administration\#"
+set package_id [ad_conn package_id]
+set parameters_url [export_vars -base "/shared/parameters" {
+ package_id { return_url [ad_return_url] }
+}]
+
+# -------------------------- PROCESSING ------------------------- #
+
+# --------------------------------------------------------------- #
+
+ad_return_template
+
+# ------------------------- END OF FILE ------------------------- #
Index: openacs-4/packages/webmail-system/www/doc/DEVELOPER-README
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/doc/DEVELOPER-README,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/doc/DEVELOPER-README 6 Jun 2006 14:35:11 -0000 1.1
@@ -0,0 +1,279 @@
+
+# ------------------------------------------------------------------------- #
+# IMAP WEBMAIL SYSTEM #
+# #
+# AUTHOR: Ayman Mohamed #
+# Nima Mazloumi #
+# EMAIL: mo2mo@hotmail.com #
+# mazloumi@uni-mannheim.de #
+# DATE: March 21th, 2006 #
+# #
+# ------------------------------------------------------------------------- #
+
+# --------------------------- DEVELOPER'S GUIDE --------------------------- #
+
+In order to develop and run the IMAP Webmail system the following must be done:
+
+INSTALLATION OF OPENSSL
+
+ a. To have the Webmail system run over SSL, OpenSSL must be downloaded and
+ installed as well as the AOLServer NsOpenSSL module.
+
+ b. OpenSSL can be obtained from:
+ http://www.openssl.org
+
+ cd /usr/local/src
+ wget http://www.openssl.org/source/openssl-0.9.7i.tar.gz
+ tar xzpf openssl-0.9.7i.tar.gz
+ cd openssl-0.9.7i
+
+ emacs Configure
+ ESC Shift+%
+ -m486
+ -march=i486
+ Ctrl+X+S
+ Ctrl+X+C
+
+ ./config
+ make
+ make test
+ make install
+
+ c. NsOpenSSL can be obtained from:
+ http://www.scottg.net/webtools/aolserver/modules/nsopenssl/
+
+ Note: Documentation of both of these can be obtained from the
+ corresponding sites listed in points (b) and (c). Further
+ information may also be obtained by searching the OpenACS forum.
+
+INSTALLATION OF KERBEROS
+
+ Get ncurses-dev first:
+ Command: cd /usr/local/src
+ wget ftp://invisible-island.net/ncurses/ncurses-5.5.tar.gz
+ ./configure --without-cxx
+ make
+ make install
+
+ see http://web.mit.edu/kerberos/www/
+
+ Command: cd /usr/local/src
+ wget http://web.mit.edu/kerberos/dist/krb5/1.4/krb5-1.4.3-signed.tar
+ tar -xvf krb5-1.3.4.tar
+ tar xzpf krb5-1.4.3.tar.gz
+ cd krb5-1.4.3/src
+ ./configure
+ make
+
+INSTALLATION OF UW-IMAP SERVER
+
+ a. Download UW-IMAP Server Distribution (filename: imap.tar.Z)
+
+ This can be obtained from:
+ ftp://ftp.cac.washington.edu/imap/imap.tar.Z
+ Extra documentation available at:
+ http://www.washington.edu/imap
+
+ Commands: cd /usr/local/src
+ wget ftp://ftp.cac.washington.edu/mail/imap.tar.Z
+
+ b. Un-tar the file
+
+ Commands: cd /usr/local/src/
+ tar -xzvf imap.tar.Z
+
+ c. Move the extracted folder (imap-2004g or a similar folder name) to
+ the /usr/local/ directory
+
+ Command: mv imap-2004g /usr/local/
+
+ d. Make and install the libraries.
+
+ Depending on the unix system type, the make command changes.
+ Typical system types include: slx and lnp.
+ Check the README and docs/ for more information.
+ Take a look at the Makefile and see if
+ there is a port for your OS. For example Redhat is 'lsu'.
+
+ Command: cd /usr/local/imap-2004g
+ make slx
+ make slx SSLTYPE=none (without OpenSSL)
+ make install
+
+ If the Webmail system is to be installed in production site, it should
+ be installed with Secure Sockets Layer (SSL) to ensure the secure
+ transport of all imap interactions including user authentication.
+
+ Command: make slx SSLTYPE=unix
+
+ Redhat-Note: OpenSSL headers try to include krb5.h which
+ isn't in the standard include dirs:
+ http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=111301
+
+ Fix: cp /usr/kerberos/include/* /usr/include/openssl (when RPM was used)
+ cp /usr/local/src/krb5-1.3.4/src/include/ /usr/include/openssl (when manually installed)
+
+ e. Start the IMAP Server at localhost (OPTIONAL)
+
+ If you don't have a remote IMAP server available you need to start one on localhost to test
+ the webmail client.
+
+ - Install the POP2 daemon (ipopd/ipop2d), the POP3 daemon (ipopd/ipop3d), and
+ the IMAP daemon (imapd/imapd) on a system directory of your choosing.
+
+ - Update /etc/services to register the pop2 service on TCP port 109, the
+ pop3 service on TCP port 110, and the imap service on TCP port 143. Also
+ update Yellow Pages/NIS/NetInfo/etc. if appropriate on your system.
+
+ - Update /etc/inetd.conf to invoke the POP2, POP3, and IMAP daemons on their
+ associated services.
+
+ See /usr/local/imap-2004g/README for more.
+
+INSTALLATION OF NS_IMAP AOLSERVER MODULE
+
+ a. Download the ns_imap module (filename: nsimap-3.1.tar.gz)
+ This can be downloaded from:
+ http://mesh.dl.sourceforge.net/sourceforge/aolserver/nsimap-3.1.tar.gz
+ ftp://ftp.crystalballinc.com/pub/vlad/nsimap.tar.gz
+
+ Command: cd /usr/local/src/aolserver40r5
+ wget http://switch.dl.sourceforge.net/sourceforge/aolserver/nsimap-3.1.tar.gz
+ tar -xzvf nsimap-3.1.tar.gz
+ cd nsimap-3.1
+
+
+ Alternatively from CVS:
+
+ Command: cd /usr/local/src/aolserver40r5
+ cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/aolserver login
+ cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/aolserver co nsimap
+ cd nsimap
+
+ b. Edit the make file to ensure the listed location of the AOLServer
+ matches the current location of your own installation. If not,
+ point it to the correct location. Also ensure that the location of
+ the UW IMAP c-client libraries match the Makefile. If not, point
+ it to the correct location.
+
+ Command: emacs Makefile
+ SSL = -DSSL=1
+ SSLLIBS = -lcrypto -lssl -lcrypt
+ IMAPFLAGS = -I/usr/local/imap-2004a/c-client $(SSL)
+ IMAPLIBS = /usr/local/imap-2004a/c-client/c-client.a -L/usr/local/src/krb5-1.3.4/src/lib -lgssapi_krb5 -lpam
+
+ Comment the line 304 in nsimap.c containing mm_freeenevelope
+ /* static void mm_freeenvelope(void **ptr); */
+
+ Comment the 421 line in nsimap.c
+ /* ((IMAPLOCAL *)session->stream->local)->byeseen = 1; */
+
+ c. Compile the ns_imap module. The resulting nsimap.so file is copied to
+ its destination accordinly.
+
+ Command: make install
+
+ Note: If SSL is to be used, uncomment the SSL lines in the
+ Makefile. This wont work unless the previous SSL components
+ were installed.
+
+ Note: If you would like to store the nsimap.so file in a different
+ location than the AOLServer bin directory, simply call 'make'
+ and copy the 'nsimap.so' file manually.
+
+ d. Change your AOLServer configuration file to load nsimap
+
+ If you have an IMAP Server installed with a valid account you
+ can directly indicate "yourID" and "yourPWD" to test you installation.
+ Comment those lines if not applicable.
+
+ Command: emacs var/lib/aolserver/service0/etc/config.tcl
+
+ ns_param nsimap ${bindir}/nsimap.so
+
+ #---------------------------------------------------------------------
+ # IMAP support
+ #---------------------------------------------------------------------
+ ns_section ns/server/${server}/module/nsimap
+ ns_param idle_timeout 1800
+ ns_param debug 1
+ ns_param mailbox "INBOX"
+ ns_param user "yourID"
+ ns_param password "yourPWD"
+
+ e. Start the AOLServer and check the logs
+ Command: /usr/local/aolserver/bin/nsd-oracle -t /var/lib/aolserver/service0/etc/config.tcl (ORACLE)
+ /usr/local/aolserver/bin/nsd-postgres -t /var/lib/aolserver/service0/etc/config.tcl (POSTGRES)
+
+ cat /var/lib/aolserver/service0/log/error.log
+
+ If no errors we reported go to the ACS Developer Support Shell and test your installation:
+
+ Browser: http://yourhost:yourport/ds/shell
+ ns_imap open -mailbox {{YOURIMAPSERVER/debug}INBOX} #for a remote server
+ ns_imap open -mailbox {{localhost/debug}INBOX} #for your test server
+
+
+INSTALLATION OF TCLLIB
+ In order to allow sending mails via SMTP you need tcllib installed.
+ Tcllib contains the two required modules smtp and mime, versions 1.4
+ More: http://wiki.tcl.tk/1773
+ http://tcllib.sourceforge.net/doc/smtp.html
+ http://tcllib.sourceforge.net/doc/mime.html
+ http://physnet.physik.uni-oldenburg.de/~schlenk/tcl/tcllib/tcllib-intro.pdf
+
+ a. Get tcllib right from CVS
+ cd /usr/local/src
+ cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/tcllib login
+ cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/tcllib co tcllib
+ cd tcllib
+
+ b. Find your tclsh installation
+ locate tclsh
+
+ b. Call tclsh with the installer
+ /usr/local/src/tcl8.4.5/unix/tclsh installer.tcl
+
+ c. Verify your installation in tclsh
+ % package require smtp
+ 1.4
+ exit
+
+ Optional:
+ [d. Install tls
+ More: http://tls.sourceforge.net/
+ wget http://puzzle.dl.sourceforge.net/sourceforge/tls/tls1.5.0-linux-x86.tar.gz
+ tar zxpf tls1.5.0-linux-x86.tar.gz
+ mv tls1.5 /usr/local/lib/tcllib1.6.1.1/tls
+ ]
+
+MAIL TRANSFER AGENT (MTA)
+
+ a. Since not all Linux/Unix distributions ship with a MTA, an MTA
+ will need to obtained. The MTA allows the sending of mail from
+ Webmail system. (Note: If another MTA is available, it can
+ be used provided it allows relaying from your server.)
+
+ b. Many MTA's are available such as Qmail, Postfix, Sendmail, etc.
+ For my development I used Qmail which was reliable and I also
+ used Postfix. Although any MTA will suffice.
+
+ For Qmail, the following were required and were downloaded
+ as RPMs for my distribution: daemontools, uscpi, qmail
+
+ RPMs can be found at http://rpmfind.net for most distributions.
+
+ c. The AOLServer also needs to be configured with an ns/parameter
+ needed to be added if not already present. This was added in the
+ config file (eg. /usr/local/aolserver/birdnotes.tcl):
+
+ Required line: ns_param mailhost localhost
+
+ Note: If you are using an MTA on another server, its location
+ must be specified in this parameter.
+
+NSIMAP API
+ For more information on the nsimap API take a look at
+ /usr/local/src/aolserver40r5/nsimap/README
+
+# ---------------------------------- EOF ---------------------------------- #
\ No newline at end of file
Index: openacs-4/packages/webmail-system/www/help/USER-README
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/help/USER-README,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/help/USER-README 6 Jun 2006 14:35:11 -0000 1.1
@@ -0,0 +1,94 @@
+# ------------------------------------------------------------------------- #
+# IMAP WEBMAIL SYSTEM #
+# #
+# AUTHOR: Ayman Mohamed #
+# EMAIL: mo2mo@hotmail.com #
+# DATE: November 2nd, 2002 #
+# #
+# ------------------------------------------------------------------------- #
+
+# ------------------------------ USER'S GUIDE ----------------------------- #
+
+The following document is to be used as an aid for users in understanding
+how to use the Webmail system. The main user scenarios are run through
+below.
+
+1. LOGING INTO THE SYSTEM
+
+ a. The user must provide their username (generally one word).
+ b. The user then provides their password.
+ c. The user selects the IMAP server they wish to connect to.
+ d. The user then clicks 'Login'.
+
+The following scenarios can only be performed if the user is logged in.
+
+2. VIEWING A USER'S INBOX
+
+ a. The user selects 'Inbox' from the main menu provided at the
+ top of the screen.
+ b. This then brings up their Inbox with all their emails listed.
+
+3. VIEWING AN EMAIL
+
+ a. Once in their Inbox, the user can select any of the emails in
+ their list by selecting the Sender's name.
+ b. This then takes the user to view the email from that sender.
+ c. The user then has two sets of options:
+ 1. They can then read the email and choose to reply, forward
+ or delete the mail message.
+ 2. They can then read the email and choose to traverse through
+ the emails via previous and next or close the email.
+ These options are located on the top left and right respectively
+ of the email they are reading. The options are also repeated on
+ the bottom of the email.
+ d. If the email contains attachments, these will be displayed below
+ the email message in the 'Attachments' section.
+ e. The user can view any attachments by selecting the 'Filename'
+ of the attachment. If the browser can display the email, it will,
+ otherwise, the attachment will be asked to be downloaded by the
+ user.
+
+4. COMPOSING AN EMAIL
+
+ a. The user selects 'Compose' from the main menu provided at the
+ top of the screen.
+ b. This then takes them to a form for their email.
+ c. The user then fills the fields they wish to have in the email
+ (at least one recipient must be specified to send the mail).
+ d. Once the user has completed their email, pressing 'Send'
+ processes the mail and sends it to their recipients.
+
+5. FOLDER MANAGEMENT
+
+ a. The user can select 'Folders' to manage their folders.
+ b. This takes them to their current folder list.
+ c. The user can then create or delete a folder by selecting from
+ the sub-menu located under the main menu bar on the top left.
+ d. This takes the user to their chosen event (create or delete).
+ e. For creating a folder, the folder name is required to be
+ in and 'Create' selected.
+ f. For deleting a folder, the user must select which folder they
+ would like to delete from the dropdown menu and then select
+ 'Delete' to delete it.
+
+6. CONTACT MANAGEMENT
+
+ a. The user can select 'Contacts' to manage their online
+ address book.
+ b. This takes them to their current contact list.
+ c. The user can then add or remove a contact by selecting from
+ the sub-menu located under the main menu bar on the top left.
+ d. This takes the user to their chosen event (add or remove).
+ e. For adding a contact, the user must fill in the required
+ fields within the form and then select 'Add'.
+ f. For removing a contact, the user must select which contact they
+ would like to delete from the dropdown menu and then select
+ 'Remove' to remove it.
+ g. The user can send a contact an email from the contacts page
+ by selecting the envelope besides the contact's name.
+
+7. LOGING OUT
+
+ a. The user is able to logout by selecting 'Logout' from the
+ main menu provided at the top of the screen.
+# ---------------------------------- EOF ---------------------------------- #
\ No newline at end of file
Index: openacs-4/packages/webmail-system/www/images/accounts.gif
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/images/accounts.gif,v
diff -u
Binary files differ
Index: openacs-4/packages/webmail-system/www/images/add_contact.gif
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/images/add_contact.gif,v
diff -u
Binary files differ
Index: openacs-4/packages/webmail-system/www/images/admin.gif
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/images/admin.gif,v
diff -u
Binary files differ
Index: openacs-4/packages/webmail-system/www/images/asc.gif
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/images/asc.gif,v
diff -u
Binary files differ
Index: openacs-4/packages/webmail-system/www/images/attach.gif
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/images/attach.gif,v
diff -u
Binary files differ
Index: openacs-4/packages/webmail-system/www/images/auth.gif
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/images/auth.gif,v
diff -u
Binary files differ
Index: openacs-4/packages/webmail-system/www/images/blank.gif
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/images/blank.gif,v
diff -u
Binary files differ
Index: openacs-4/packages/webmail-system/www/images/closed-envelope.gif
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/images/closed-envelope.gif,v
diff -u
Binary files differ
Index: openacs-4/packages/webmail-system/www/images/closed-folder.gif
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/images/closed-folder.gif,v
diff -u
Binary files differ
Index: openacs-4/packages/webmail-system/www/images/compose.gif
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/images/compose.gif,v
diff -u
Binary files differ
Index: openacs-4/packages/webmail-system/www/images/contacts.gif
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/images/contacts.gif,v
diff -u
Binary files differ
Index: openacs-4/packages/webmail-system/www/images/cool.gif
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/images/cool.gif,v
diff -u
Binary files differ
Index: openacs-4/packages/webmail-system/www/images/csv.gif
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/images/csv.gif,v
diff -u
Binary files differ
Index: openacs-4/packages/webmail-system/www/images/desc.gif
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/images/desc.gif,v
diff -u
Binary files differ
Index: openacs-4/packages/webmail-system/www/images/error.gif
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/images/error.gif,v
diff -u
Binary files differ
Index: openacs-4/packages/webmail-system/www/images/folders.gif
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/images/folders.gif,v
diff -u
Binary files differ
Index: openacs-4/packages/webmail-system/www/images/forward.gif
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/images/forward.gif,v
diff -u
Binary files differ
Index: openacs-4/packages/webmail-system/www/images/header_hide.gif
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/images/header_hide.gif,v
diff -u
Binary files differ
Index: openacs-4/packages/webmail-system/www/images/header_show.gif
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/images/header_show.gif,v
diff -u
Binary files differ
Index: openacs-4/packages/webmail-system/www/images/help.gif
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/images/help.gif,v
diff -u
Binary files differ
Index: openacs-4/packages/webmail-system/www/images/inbox.gif
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/images/inbox.gif,v
diff -u
Binary files differ
Index: openacs-4/packages/webmail-system/www/images/info.gif
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/images/info.gif,v
diff -u
Binary files differ
Index: openacs-4/packages/webmail-system/www/images/left.gif
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/images/left.gif,v
diff -u
Binary files differ
Index: openacs-4/packages/webmail-system/www/images/login.gif
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/images/login.gif,v
diff -u
Binary files differ
Index: openacs-4/packages/webmail-system/www/images/logout.gif
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/images/logout.gif,v
diff -u
Binary files differ
Index: openacs-4/packages/webmail-system/www/images/mailbox.gif
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/images/mailbox.gif,v
diff -u
Binary files differ
Index: openacs-4/packages/webmail-system/www/images/open-folder.gif
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/images/open-folder.gif,v
diff -u
Binary files differ
Index: openacs-4/packages/webmail-system/www/images/prefs.gif
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/images/prefs.gif,v
diff -u
Binary files differ
Index: openacs-4/packages/webmail-system/www/images/print.gif
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/images/print.gif,v
diff -u
Binary files differ
Index: openacs-4/packages/webmail-system/www/images/question.gif
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/images/question.gif,v
diff -u
Binary files differ
Index: openacs-4/packages/webmail-system/www/images/reply.gif
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/images/reply.gif,v
diff -u
Binary files differ
Index: openacs-4/packages/webmail-system/www/images/right.gif
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/images/right.gif,v
diff -u
Binary files differ
Index: openacs-4/packages/webmail-system/www/images/spacer.gif
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/images/spacer.gif,v
diff -u
Binary files differ
Index: openacs-4/packages/webmail-system/www/images/trash.gif
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/images/trash.gif,v
diff -u
Binary files differ
Index: openacs-4/packages/webmail-system/www/images/view.gif
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/images/view.gif,v
diff -u
Binary files differ
Index: openacs-4/packages/webmail-system/www/images/warning.gif
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/images/warning.gif,v
diff -u
Binary files differ
Index: openacs-4/packages/webmail-system/www/styles/styles.css
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/styles/styles.css,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/styles/styles.css 6 Jun 2006 14:35:11 -0000 1.1
@@ -0,0 +1,120 @@
+.heading {
+ font-size: 14pt;
+ color: white;
+ font-weight: bold;
+ font-family: Arial, Helvetica, sans-serif
+}
+
+.standard {
+ font-size: 12pt;
+ color: black;
+ font-family: Arial, Helvetica, sans-serif;
+}
+
+PRE {
+ font-size: 12pt;
+ color: black;
+ font-family: Arial, Helvetica, sans-serif;
+}
+
+BODY {
+ color: black;
+ background: silver;
+ font-family: Arial, Helvetica, sans-serif
+}
+
+TABLE.outline {
+ border-width: medium;
+ border-color: white
+}
+
+H1.special {
+ text-align: center;
+ color: #006699;
+ font-size: 30pt;
+ font-family: Arial, Helvetica, sans-serif
+}
+
+P {
+ font-size: 12pt;
+ color: black;
+ font-family: Arial, Helvetica, sans-serif
+}
+
+P.title-rght {
+ text-align: right;
+ color: white;
+ font-size: 13pt;
+ font-family: Arial, Helvetica, sans-serif
+}
+
+TD.footer {
+ font-size: 10pt;
+ font-family: Arial, Helvetica, sans-serif
+}
+
+TD.head-lft {
+ font-size: 13pt;
+ text-align: left;
+ font-family: Arial, Helvetica, sans-serif
+}
+
+TD.head-rght {
+ font-size: 13pt;
+ text-align: right;
+ font-family: Arial, Helvetica, sans-serif
+}
+
+TD.standard {
+ font-size: 12pt;
+ color: black;
+ font-family: Arial, Helvetica, sans-serif;
+}
+
+TD.link {
+ font-size: 13pt;
+ color: purple;
+ font-family: Arial, Helvetica, sans-serif
+}
+
+TD.center {
+ font-size: 12pt;
+ text-align: center;
+ color: black;
+ font-family: Arial, Helvetica, sans-serif
+}
+
+TD.center-bld {
+ text-align: center;
+ font-weight: bold;
+ font-size: 12pt;
+ color: black;
+ font-family: Arial, Helvetica, sans-serif;
+}
+
+TD.center-bld-2 {
+ text-align: center;
+ font-weight: bold;
+ font-size: 13pt;
+ color: black;
+ font-family: Arial, Helvetica, sans-serif;
+}
+
+TD.view-head {
+ font-size: 12pt;
+ text-align: left;
+ font-weight: bold;
+ color: black;
+ font-family: Arial, Helvetica, sans-serif
+}
+
+LI.error-red {
+ font-size: 12pt;
+ color: red;
+ font-family: Arial, Helvetica, sans-serif
+}
+
+/* Links */
+A:link { text-decoration: none }
+A:active { text-decoration: none }
+A:visited { text-decoration: none }
Index: openacs-4/packages/webmail-system/www/templates/master-template-start.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/templates/master-template-start.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/templates/master-template-start.adp 6 Jun 2006 14:35:11 -0000 1.1
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ |
+
+
+
+
\ No newline at end of file
Index: openacs-4/packages/webmail-system/www/templates/master-template-start.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/templates/master-template-start.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/templates/master-template-start.tcl 6 Jun 2006 14:35:11 -0000 1.1
@@ -0,0 +1,48 @@
+# --------------------------------------------------------------- #
+# HELP #
+# #
+# webmail-system/www/template/master-template-start.tcl #
+# #
+# --------------------------------------------------------------- #
+
+# ------------------------ PAGE CONTRACT ------------------------ #
+
+ad_page_contract {
+
+ Template for pages that don't need active sessions
+
+ @author Nima Mazloumi (mazloumi@uni-mannheim.de)
+ @creation-date 15/08/2004
+
+} {
+ {admin_url ""}
+ {admin_title ""}
+}
+
+# ------------------------ SET VARIABLES ------------------------ #
+
+set package_id [ad_conn package_id]
+
+set admin_p [permission::permission_p -object_id $package_id \
+ -privilege admin -party_id [ad_conn untrusted_user_id]]
+
+if { $admin_p } {
+ set admin_url "admin"
+ set admin_title "#webmail-system.Administration#"
+}
+
+# ------------------- RETRIEVE SESSION PARAMS ------------------- #
+
+set id [ad_get_client_property webmail-system conn_id]
+
+ns_log debug "WEBMAIL: Start Master Template"
+
+# -------------------------- PROCESSING ------------------------- #
+
+ns_log debug "WEBMAIL: Start Master Template End"
+
+# --------------------------------------------------------------- #
+
+ad_return_template
+
+# ------------------------- END OF FILE ------------------------- #
Index: openacs-4/packages/webmail-system/www/templates/master-template.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/templates/master-template.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/templates/master-template.adp 6 Jun 2006 14:35:11 -0000 1.1
@@ -0,0 +1,59 @@
+
+
+
+
+
+
+
+<% set template [parameter::get -parameter "MasterTemplate" -default "/www/default-master"] %>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ |
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: openacs-4/packages/webmail-system/www/templates/master-template.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/templates/master-template.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/templates/master-template.tcl 6 Jun 2006 14:35:11 -0000 1.1
@@ -0,0 +1,48 @@
+# --------------------------------------------------------------- #
+# ADMIN INDEX #
+# #
+# LOC: packages/webmail-system/www/template/master-template.tcl #
+# #
+# --------------------------------------------------------------- #
+
+# ------------------------ PAGE CONTRACT ------------------------ #
+
+ad_page_contract {
+
+ Master-template
+
+ @author Nima Mazloumi (mazloumi@uni-mannheim.de)
+ @creation-date 15/08/2004
+
+} {
+ {admin_url ""}
+ {admin_title ""}
+}
+
+# ------------------------ SET VARIABLES ------------------------ #
+
+set package_id [ad_conn package_id]
+
+set admin_p [permission::permission_p -object_id $package_id \
+ -privilege admin -party_id [auth::require_login]]
+
+if { $admin_p } {
+ set admin_url "admin"
+ set admin_title "#webmail-system.Administration#"
+}
+
+# ------------------ CHECKING SESSION VALIDITY ------------------ #
+set id [ad_get_client_property webmail-system conn_id]
+set nav_bar_p [ad_get_client_property webmail-system nav_bar]
+
+# Checking if the user is logged in (ie. session currently running)
+# Also, checking if the connection is still alive
+if { [empty_string_p $id] || [catch { set new_mail [ns_imap ping $id] } errmsg] } {
+ webmail::expired_session "WEBMAIL: Session Error"
+ return
+}
+# --------------------------------------------------------------- #
+
+ad_return_template
+
+# ------------------------- END OF FILE ------------------------- #
\ No newline at end of file
Index: openacs-4/packages/webmail-system/www/templates/progress-bar.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/webmail-system/www/templates/progress-bar.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/webmail-system/www/templates/progress-bar.adp 6 Jun 2006 14:35:11 -0000 1.1
@@ -0,0 +1,61 @@
+
+
+
+
+
+
+
+
+
+@title@
+
+
+
+
+
+ @title;noquote@
+
+
+
+
+ @message_1@
+
+
+
+
+
+
+
+
+
+ @message_2@
+
+ |
+
+
+
+
+
+
+
+
\ No newline at end of file