Fossil SCM
Work toward revamping the webmail page.
Commit
d68879f70cd6e35e38a100db1d55bc9630dace46eb0d81525ce1bd8f876483b7
Parent
cfc7aca2c1b573a…
2 files changed
+2
-1
+14
-1
+2
-1
| --- src/smtp.c | ||
| +++ src/smtp.c | ||
| @@ -646,16 +646,17 @@ | ||
| 646 | 646 | @ ); |
| 647 | 647 | @ |
| 648 | 648 | @ -- One row for each mailbox entry. All users emails are stored in |
| 649 | 649 | @ -- this same table. |
| 650 | 650 | @ CREATE TABLE IF NOT EXISTS repository.emailbox( |
| 651 | +@ ebid INTEGER PRIMARY KEY, -- Unique id for each mailbox entry | |
| 651 | 652 | @ euser TEXT, -- User who received this email |
| 652 | 653 | @ edate INT, -- Date received. Seconds since 1970 |
| 653 | 654 | @ efrom TEXT, -- Who is the email from |
| 654 | 655 | @ emsgid INT, -- Raw email text |
| 655 | 656 | @ ets INT, -- Transcript of the receiving SMTP session |
| 656 | -@ estate INT, -- Unread, read, starred, etc. | |
| 657 | +@ estate INT, -- 0: Unread, 1: read, 2: trash | |
| 657 | 658 | @ esubject TEXT, -- Subject line for display |
| 658 | 659 | @ etags TEXT -- zero or more tags |
| 659 | 660 | @ ); |
| 660 | 661 | @ |
| 661 | 662 | @ -- Information on how to deliver incoming email. |
| 662 | 663 |
| --- 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 @@ | ||
| 358 | 358 | /* |
| 359 | 359 | ** WEBPAGE: webmail |
| 360 | 360 | ** |
| 361 | 361 | ** This page can be used to read content from the EMAILBOX table |
| 362 | 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 | +** | |
| 363 | 376 | */ |
| 364 | 377 | void webmail_page(void){ |
| 365 | 378 | int emailid; |
| 366 | 379 | Stmt q; |
| 367 | 380 | Blob sql; |
| 368 | 381 | int showAll = 0; |
| 369 | 382 | const char *zUser = 0; |
| 370 | 383 | HQuery url; |
| 371 | 384 | login_check_credentials(); |
| 372 | - if( g.zLogin==0 ){ | |
| 385 | + if( !login_is_individual() ){ | |
| 373 | 386 | login_needed(0); |
| 374 | 387 | return; |
| 375 | 388 | } |
| 376 | 389 | if( !db_table_exists("repository","emailbox") ){ |
| 377 | 390 | style_header("Webmail Not Available"); |
| 378 | 391 |
| --- 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 |