Fossil SCM

Work toward revamping the webmail page.

drh 2018-07-14 14:58 trunk
Commit d68879f70cd6e35e38a100db1d55bc9630dace46eb0d81525ce1bd8f876483b7
2 files changed +2 -1 +14 -1
+2 -1
--- src/smtp.c
+++ src/smtp.c
@@ -646,16 +646,17 @@
646646
@ );
647647
@
648648
@ -- One row for each mailbox entry. All users emails are stored in
649649
@ -- this same table.
650650
@ CREATE TABLE IF NOT EXISTS repository.emailbox(
651
+@ ebid INTEGER PRIMARY KEY, -- Unique id for each mailbox entry
651652
@ euser TEXT, -- User who received this email
652653
@ edate INT, -- Date received. Seconds since 1970
653654
@ efrom TEXT, -- Who is the email from
654655
@ emsgid INT, -- Raw email text
655656
@ ets INT, -- Transcript of the receiving SMTP session
656
-@ estate INT, -- Unread, read, starred, etc.
657
+@ estate INT, -- 0: Unread, 1: read, 2: trash
657658
@ esubject TEXT, -- Subject line for display
658659
@ etags TEXT -- zero or more tags
659660
@ );
660661
@
661662
@ -- Information on how to deliver incoming email.
662663
--- src/smtp.c
+++ src/smtp.c
@@ -646,16 +646,17 @@
646 @ );
647 @
648 @ -- One row for each mailbox entry. All users emails are stored in
649 @ -- this same table.
650 @ CREATE TABLE IF NOT EXISTS repository.emailbox(
 
651 @ euser TEXT, -- User who received this email
652 @ edate INT, -- Date received. Seconds since 1970
653 @ efrom TEXT, -- Who is the email from
654 @ emsgid INT, -- Raw email text
655 @ ets INT, -- Transcript of the receiving SMTP session
656 @ estate INT, -- Unread, read, starred, etc.
657 @ esubject TEXT, -- Subject line for display
658 @ etags TEXT -- zero or more tags
659 @ );
660 @
661 @ -- Information on how to deliver incoming email.
662
--- src/smtp.c
+++ src/smtp.c
@@ -646,16 +646,17 @@
646 @ );
647 @
648 @ -- One row for each mailbox entry. All users emails are stored in
649 @ -- this same table.
650 @ CREATE TABLE IF NOT EXISTS repository.emailbox(
651 @ ebid INTEGER PRIMARY KEY, -- Unique id for each mailbox entry
652 @ euser TEXT, -- User who received this email
653 @ edate INT, -- Date received. Seconds since 1970
654 @ efrom TEXT, -- Who is the email from
655 @ emsgid INT, -- Raw email text
656 @ ets INT, -- Transcript of the receiving SMTP session
657 @ estate INT, -- 0: Unread, 1: read, 2: trash
658 @ esubject TEXT, -- Subject line for display
659 @ etags TEXT -- zero or more tags
660 @ );
661 @
662 @ -- Information on how to deliver incoming email.
663
+14 -1
--- src/webmail.c
+++ src/webmail.c
@@ -358,20 +358,33 @@
358358
/*
359359
** WEBPAGE: webmail
360360
**
361361
** This page can be used to read content from the EMAILBOX table
362362
** that contains email received by the "fossil smtpd" command.
363
+**
364
+** Query parameters:
365
+**
366
+** id=N Show a single email entry emailbox.ebid==N
367
+** f=N Display format. 0: decoded 1: raw
368
+** u=USER Show mailbox for USER (admin only).
369
+** u=* Show mailbox for all users (admin only).
370
+** d=N 0: inbox+unread 1: unread-only 2: trash 3: all
371
+** eN Select email entry emailbox.ebid==N
372
+** trash Move selected entries to trash (estate=2)
373
+** read Mark selected entries as read (estate=1)
374
+** unread Mark selected entries as unread (estate=0)
375
+**
363376
*/
364377
void webmail_page(void){
365378
int emailid;
366379
Stmt q;
367380
Blob sql;
368381
int showAll = 0;
369382
const char *zUser = 0;
370383
HQuery url;
371384
login_check_credentials();
372
- if( g.zLogin==0 ){
385
+ if( !login_is_individual() ){
373386
login_needed(0);
374387
return;
375388
}
376389
if( !db_table_exists("repository","emailbox") ){
377390
style_header("Webmail Not Available");
378391
--- src/webmail.c
+++ src/webmail.c
@@ -358,20 +358,33 @@
358 /*
359 ** WEBPAGE: webmail
360 **
361 ** This page can be used to read content from the EMAILBOX table
362 ** that contains email received by the "fossil smtpd" command.
 
 
 
 
 
 
 
 
 
 
 
 
 
363 */
364 void webmail_page(void){
365 int emailid;
366 Stmt q;
367 Blob sql;
368 int showAll = 0;
369 const char *zUser = 0;
370 HQuery url;
371 login_check_credentials();
372 if( g.zLogin==0 ){
373 login_needed(0);
374 return;
375 }
376 if( !db_table_exists("repository","emailbox") ){
377 style_header("Webmail Not Available");
378
--- src/webmail.c
+++ src/webmail.c
@@ -358,20 +358,33 @@
358 /*
359 ** WEBPAGE: webmail
360 **
361 ** This page can be used to read content from the EMAILBOX table
362 ** that contains email received by the "fossil smtpd" command.
363 **
364 ** Query parameters:
365 **
366 ** id=N Show a single email entry emailbox.ebid==N
367 ** f=N Display format. 0: decoded 1: raw
368 ** u=USER Show mailbox for USER (admin only).
369 ** u=* Show mailbox for all users (admin only).
370 ** d=N 0: inbox+unread 1: unread-only 2: trash 3: all
371 ** eN Select email entry emailbox.ebid==N
372 ** trash Move selected entries to trash (estate=2)
373 ** read Mark selected entries as read (estate=1)
374 ** unread Mark selected entries as unread (estate=0)
375 **
376 */
377 void webmail_page(void){
378 int emailid;
379 Stmt q;
380 Blob sql;
381 int showAll = 0;
382 const char *zUser = 0;
383 HQuery url;
384 login_check_credentials();
385 if( !login_is_individual() ){
386 login_needed(0);
387 return;
388 }
389 if( !db_table_exists("repository","emailbox") ){
390 style_header("Webmail Not Available");
391

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button