ezmlmx 0.68
ezmlmx
Loading...
Searching...
No Matches
ezmlm-cgi.c File Reference

ezmlm-cgi requires to use the MVC pattern .... (eh) More...

#include <sys/types.h>
#include <unistd.h>
#include "alloc.h"
#include "direntry.h"
#include "datetime.h"
#include "now.h"
#include "stralloc.h"
#include "logmsg.h"
#include "error.h"
#include "env.h"
#include "sig.h"
#include "open.h"
#include "getln.h"
#include "case.h"
#include "scan.h"
#include "str.h"
#include "fmt.h"
#include "readwrite.h"
#include "wait.h"
#include "exit.h"
#include "buffer.h"
#include "getconf.h"
#include "constmap.h"
#include "byte.h"
#include "subscribe.h"
#include "errtxt.h"
#include "makehash.h"
#include "mime.h"
#include "idx.h"
#include "date2yyyymm.h"
#include "cgi.h"
Include dependency graph for ezmlm-cgi.c:

Go to the source code of this file.

Data Structures

struct  msginfo

Macros

#define WHO   "ezmlm-cgi"
#define SUBSCRIBE   "-subscribe"
#define FAQ   "-faq"
#define TXT_CGI_SUBSCRIBE   "\">[Subscribe To List]</a>\n"
#define TXT_CGI_FAQ   "\">[List FAQ]</a>\n"
#define NO_HDRS   6
#define HDR_SUBJECT   1
#define HDR_FROM   2
#define HDR_CT   4
#define HDR_CTENC   5
#define HDR_VERSION   6
#define MAXULONG   0xffffffff
#define VIEW   "-msadiz"
#define VIEW_MESSAGE   1
#define VIEW_TOPIC   2
#define VIEW_AUTHOR   3
#define VIEW_DATE   4
#define VIEW_INDEX   5
#define DIRECT   "psnpnz"
#define DIRECT_SAME   0
#define DIRECT_NEXT   1
#define DIRECT_PREV   -1 /* use only as the argument for some functions. Terrible hack for date links (fixed) */
#define DIRECT_FIRST   3
#define DIRECT_LAST   2
#define SPC_BASE   1
#define SPC_BANNER   2

Functions

void oput (const char *s, unsigned int l)
void oputs (const char *s)
void die_prog (const char *s)
void cgierr (const char *s, const char *s1, const char *s2)
void toggle_flagpre (int flag)
unsigned int decode_charset (const char *s, unsigned int l)
 return charset code. CS_BAD: Means that base charset should be used, i.e. that charset is empty or likely invalid. Add other charsets here. Later we will add code to replace a detected charset name with another, and to connect conversion routines, such as between windows-1251/koi-8r/iso-8859-5. CS_NONE: Are charsets for which we don't need to do anything special.
void html_put (const char *s, unsigned int l)
 At this time, us-ascii, iso-8859-? create no problems. We just encode some html chars. iso-2022 may have these chars as character components. cs is set for these, 3 for CN, 2 for others. Bit 0 set means 2 byte chars for SS2/SS3 shiftouts (JP doesn't use them, KR has single byte. If cs is set and we're shifted out (so set) we don't substitute. We also look for SI/SO to adjust so, and ESC to detect SS2/SS3. Need to ignore other ESC seqs correctly. JP doesn't use SI/SO, but uses ESC ( B/J and ESC $ B/@ analogously, so we use these to toggle so. "Roman", i.e. ESC ( J is treated as ascii.
void urlencode_put (const char *s, unsigned int l)
void urlencode_puts (const char *s)
void anchor_put (unsigned char *s, unsigned int l)
int checkhash (const char *s)
int uri2fn (stralloc *sa, char item, unsigned long n, const char *hash)
 from the inputs: item, num, and hash the normalized and relative file name URI of the target message is build and provided as 'sa'.
void alink (struct msginfo *infop, unsigned char item, unsigned char view, unsigned long msgnum, const char *data, unsigned int l)
 links with targets other msgnum -> msgnum. If the link is for author, we still supply subject, since most navigation at the message level will be along threads rather than author and we don't have an author index. Works because all index views have at least a subject link.
void index_messages (struct msginfo *infop, unsigned char item)
 for links from message view back to author/subject/threads index
void nav_links (struct msginfo *infop, unsigned char view, unsigned char direction)
 Creates using a maximum of available information only for links where the target is a message.
void justpress ()
void home_link ()
void subfaq_link ()
void message_links (struct msginfo *infop)
 Creates the html for all links from one message view.
void html_header (const char *t, const char *s, unsigned int l, const char *class, int flagspecial)
 flagspecial: 0x1 => robot index; no style sheet, no BASE flagspecial: 0x2 => banner, if available
void html_footer (int flagspecial)
void date_links (struct msginfo *infop, unsigned long d, char direction)
 output a date with link back to thread index
void finddate (struct msginfo *infop)
 DIRECT_SAME works as DIRECT_PREV, dvs returns previous date or last date.
void latestdate (struct msginfo *infop, int flagfail)
void firstdate (struct msginfo *infop)
void gtdate (struct msginfo *infop, int flagfail)
 infop->date has to be 0 or valid on entry. Month outside of [1-12] on entry causes GIGO
void index_links (struct msginfo *infop)
int show_index (struct msginfo *infop)
void object_links (struct msginfo *infop, char item)
int show_object (struct msginfo *infop, char item)
 shows thread, threads, author infop has the info needed to access the author/subject/thread file
void clear_mime ()
void new_mime ()
void mime_getarg (stralloc *sa, char **s, unsigned int *l)
 opies next token or "token" into sa and sets s & l appropriately for continuing the search
void decode_mime_type (char *s, unsigned int l, unsigned int flagmime)
void decode_transfer_encoding (char *s, unsigned int l)
int check_boundary ()
 return 0 if no boundary, 1 if start, 2 if end
void start_message_page (struct msginfo *infop)
 header etc for message. Delayed to collect subject so that we can put that in TITLE. This in turn needed for good looking robot index. Yep, not pretty, but it works and it's abhorrent to seek()/rewind* and another hack: it's hard to mix charsets within a doc. So, we disp messages entirely in the charset of the message. This is ok, since headers will be us-ascii or have encoded segments usually matching the charset in the message. Of course, we should be able to used e.g.
void show_part (struct msginfo *infop, int flagshowheaders, int flagstartseen)
 if flagshowheaders we display headers, otherwise not if flagstartseen we've already see the start boundary for this part, if not we'll ignore what's there up to it
int show_message (struct msginfo *infop)
char decode_item (char ch)
char decode_direction (char ch)
int decode_cmd (char *cmd, struct msginfo *infop)
 decodes cmd into infop. Assures that no security problems slip through by checking everything cmd: ivd:123[:abc]. navigation: i what we want (item), v is the view, d the direction. msgnumber: 123 is the current message number. resource: abc is a date/subject/author hash, depending on view, or empty if not available. returns: 0 no cmd + msgnum. 1 empty or least cmd + msgnum. Guarantee: Only legal values accepted
int msg2hash (struct msginfo *infop)
void set_message (struct msginfo *infop)
 Reads the file corresponding to infop->view and assumes fname.s is set correctly for this. Sets up a msgnav structure and links it in correction for view=author/subject. For view=date it supports also direction=DIRECT_FIRST which will return the first message of the first thread in the date file. DIRECT_LAST is not supported. DIRECT_FIRST is supported ONLY for date.
void auth2msg (struct msginfo *infop)
void subj2msg (struct msginfo *infop)
void date2msg (struct msginfo *infop)
void findlastmsg (struct msginfo *infop)
int navigate (struct msginfo *infop)
 interprets msginfo to create msginfo. Upon return, msginfo can be trusted to have all info needed, and that all info is correct. There may be more info than needed. This can be used to build more specific links. NOTE: there is no guarantee that a message meeting the criteria actually exists
void list_list (const char *listname)
 Make one link [for list_set()] per set of 100 archive messages. Assumption: Any directory DIR/archive/xxx where 'xxx' is a numeric, is part of the list archive and has in it an index file and one or more messages.
void list_set (unsigned long msgset)
void drop_priv (int flagchroot)
int main (int argc, char **argv)

Variables

int flagshowhtml = 1
int flagobscure = 0
char headers_used []
int headers_shown [] = {1,1,1,0,0,0}
stralloc hdr [NO_HDRS] = { {0},{0},{0},{0},{0},{0} }
char navstr [5] = "xxx:"
char * dir = 0
char * local = 0
char * host = 0
char * home = 0
char * banner = 0
const char * charset = 0
char * stylesheet = 0
char * cntl = 0
char strnum [FMT_ULONG]
stralloc charg = {0}
stralloc url = {0}
stralloc author = {0}
stralloc subject = {0}
stralloc base = {0}
stralloc line = {0}
stralloc decline = {0}
stralloc cfline = {0}
stralloc fname = {0}
stralloc dtline = {0}
stralloc headers = {0}
stralloc encoding = {0}
stralloc content = {0}
stralloc charsetbase = {0}
stralloc curcharset = {0}
stralloc sainit = {0}
stralloc listname = {0}
struct constmap headermap
unsigned long uid
unsigned long euid
int recursion_level
int so = 0
int ss23 = 0
int state = 0
int newlevel
int match
int fd
int cache
int child
int wstat
int flagtoplevel
unsigned int flagmime
unsigned int cs
unsigned int csbase
unsigned int pos
int flagrobot
int flagpre
int precharcount
char cn1 = 0
char cn2 = 0
char lastjp [] = "B"
char * bannerargs [4]
struct msginfo msginfo
mime_infomime_current = 0
mime_infomime_tmp = 0
datetime_sec when
struct datetime dt
char inbuf [4096]
buffer bi
char outbuf [4096]
buffer bo = BUFFER_INIT(write,1,outbuf,sizeof(outbuf))
unsigned long msgnav [5]
char hexchar [] = "0123456789ABCDEF"
char enc_url [] = "%00"

Detailed Description

ezmlm-cgi requires to use the MVC pattern .... (eh)

Author
Bruce Guenter
Date
2005-01-11 21:20:15Z

Definition in file ezmlm-cgi.c.

Macro Definition Documentation

◆ DIRECT

#define DIRECT   "psnpnz"

Definition at line 98 of file ezmlm-cgi.c.

◆ DIRECT_FIRST

#define DIRECT_FIRST   3

Definition at line 102 of file ezmlm-cgi.c.

◆ DIRECT_LAST

#define DIRECT_LAST   2

Definition at line 103 of file ezmlm-cgi.c.

◆ DIRECT_NEXT

#define DIRECT_NEXT   1

Definition at line 100 of file ezmlm-cgi.c.

◆ DIRECT_PREV

#define DIRECT_PREV   -1 /* use only as the argument for some functions. Terrible hack for date links (fixed) */

Definition at line 101 of file ezmlm-cgi.c.

◆ DIRECT_SAME

#define DIRECT_SAME   0

Definition at line 99 of file ezmlm-cgi.c.

◆ FAQ

#define FAQ   "-faq"

Definition at line 46 of file ezmlm-cgi.c.

◆ HDR_CT

#define HDR_CT   4

Definition at line 67 of file ezmlm-cgi.c.

◆ HDR_CTENC

#define HDR_CTENC   5

Definition at line 68 of file ezmlm-cgi.c.

◆ HDR_FROM

#define HDR_FROM   2

Definition at line 66 of file ezmlm-cgi.c.

◆ HDR_SUBJECT

#define HDR_SUBJECT   1

Definition at line 65 of file ezmlm-cgi.c.

◆ HDR_VERSION

#define HDR_VERSION   6

Definition at line 69 of file ezmlm-cgi.c.

◆ MAXULONG

#define MAXULONG   0xffffffff

Definition at line 83 of file ezmlm-cgi.c.

◆ NO_HDRS

#define NO_HDRS   6

Definition at line 64 of file ezmlm-cgi.c.

◆ SPC_BANNER

#define SPC_BANNER   2

Definition at line 790 of file ezmlm-cgi.c.

◆ SPC_BASE

#define SPC_BASE   1

Definition at line 789 of file ezmlm-cgi.c.

◆ SUBSCRIBE

#define SUBSCRIBE   "-subscribe"

Definition at line 45 of file ezmlm-cgi.c.

◆ TXT_CGI_FAQ

#define TXT_CGI_FAQ   "\">[List FAQ]</a>\n"

Definition at line 48 of file ezmlm-cgi.c.

◆ TXT_CGI_SUBSCRIBE

#define TXT_CGI_SUBSCRIBE   "\">[Subscribe To List]</a>\n"

Definition at line 47 of file ezmlm-cgi.c.

◆ VIEW

#define VIEW   "-msadiz"

Definition at line 91 of file ezmlm-cgi.c.

◆ VIEW_AUTHOR

#define VIEW_AUTHOR   3

Definition at line 94 of file ezmlm-cgi.c.

◆ VIEW_DATE

#define VIEW_DATE   4

Definition at line 95 of file ezmlm-cgi.c.

◆ VIEW_INDEX

#define VIEW_INDEX   5

Definition at line 96 of file ezmlm-cgi.c.

◆ VIEW_MESSAGE

#define VIEW_MESSAGE   1

Definition at line 92 of file ezmlm-cgi.c.

◆ VIEW_TOPIC

#define VIEW_TOPIC   2

Definition at line 93 of file ezmlm-cgi.c.

◆ WHO

#define WHO   "ezmlm-cgi"

Definition at line 35 of file ezmlm-cgi.c.

Function Documentation

◆ alink()

void alink ( struct msginfo * infop,
unsigned char item,
unsigned char view,
unsigned long msgnum,
const char * data,
unsigned int l )

links with targets other msgnum -> msgnum. If the link is for author, we still supply subject, since most navigation at the message level will be along threads rather than author and we don't have an author index. Works because all index views have at least a subject link.

Definition at line 571 of file ezmlm-cgi.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ anchor_put()

void anchor_put ( unsigned char * s,
unsigned int l )

Definition at line 458 of file ezmlm-cgi.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ auth2msg()

void auth2msg ( struct msginfo * infop)

Definition at line 1886 of file ezmlm-cgi.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cgierr()

void cgierr ( const char * s,
const char * s1,
const char * s2 )

Definition at line 209 of file ezmlm-cgi.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ check_boundary()

int check_boundary ( )

return 0 if no boundary, 1 if start, 2 if end

Definition at line 1371 of file ezmlm-cgi.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ checkhash()

int checkhash ( const char * s)

Definition at line 513 of file ezmlm-cgi.c.

Here is the caller graph for this function:

◆ clear_mime()

void clear_mime ( )

Definition at line 1203 of file ezmlm-cgi.c.

Here is the caller graph for this function:

◆ date2msg()

void date2msg ( struct msginfo * infop)

Definition at line 1900 of file ezmlm-cgi.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ date_links()

void date_links ( struct msginfo * infop,
unsigned long d,
char direction )

output a date with link back to thread index

Definition at line 865 of file ezmlm-cgi.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ decode_charset()

unsigned int decode_charset ( const char * s,
unsigned int l )

return charset code. CS_BAD: Means that base charset should be used, i.e. that charset is empty or likely invalid. Add other charsets here. Later we will add code to replace a detected charset name with another, and to connect conversion routines, such as between windows-1251/koi-8r/iso-8859-5. CS_NONE: Are charsets for which we don't need to do anything special.

Definition at line 245 of file ezmlm-cgi.c.

Here is the caller graph for this function:

◆ decode_cmd()

int decode_cmd ( char * cmd,
struct msginfo * infop )

decodes cmd into infop. Assures that no security problems slip through by checking everything cmd: ivd:123[:abc]. navigation: i what we want (item), v is the view, d the direction. msgnumber: 123 is the current message number. resource: abc is a date/subject/author hash, depending on view, or empty if not available. returns: 0 no cmd + msgnum. 1 empty or least cmd + msgnum. Guarantee: Only legal values accepted

Definition at line 1695 of file ezmlm-cgi.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ decode_direction()

char decode_direction ( char ch)

Definition at line 1671 of file ezmlm-cgi.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ decode_item()

char decode_item ( char ch)

Definition at line 1658 of file ezmlm-cgi.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ decode_mime_type()

void decode_mime_type ( char * s,
unsigned int l,
unsigned int flagmime )

Definition at line 1269 of file ezmlm-cgi.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ decode_transfer_encoding()

void decode_transfer_encoding ( char * s,
unsigned int l )

Definition at line 1348 of file ezmlm-cgi.c.

Here is the caller graph for this function:

◆ die_prog()

void die_prog ( const char * s)

Definition at line 198 of file ezmlm-cgi.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ drop_priv()

void drop_priv ( int flagchroot)

Definition at line 2081 of file ezmlm-cgi.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ finddate()

void finddate ( struct msginfo * infop)

DIRECT_SAME works as DIRECT_PREV, dvs returns previous date or last date.

Definition at line 896 of file ezmlm-cgi.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ findlastmsg()

void findlastmsg ( struct msginfo * infop)

Definition at line 1912 of file ezmlm-cgi.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ firstdate()

void firstdate ( struct msginfo * infop)

Definition at line 948 of file ezmlm-cgi.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gtdate()

void gtdate ( struct msginfo * infop,
int flagfail )

infop->date has to be 0 or valid on entry. Month outside of [1-12] on entry causes GIGO

Definition at line 961 of file ezmlm-cgi.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ home_link()

void home_link ( )

Definition at line 709 of file ezmlm-cgi.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ html_footer()

void html_footer ( int flagspecial)

Definition at line 842 of file ezmlm-cgi.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ html_header()

void html_header ( const char * t,
const char * s,
unsigned int l,
const char * class,
int flagspecial )

flagspecial: 0x1 => robot index; no style sheet, no BASE flagspecial: 0x2 => banner, if available

Definition at line 798 of file ezmlm-cgi.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ html_put()

void html_put ( const char * s,
unsigned int l )

At this time, us-ascii, iso-8859-? create no problems. We just encode some html chars. iso-2022 may have these chars as character components. cs is set for these, 3 for CN, 2 for others. Bit 0 set means 2 byte chars for SS2/SS3 shiftouts (JP doesn't use them, KR has single byte. If cs is set and we're shifted out (so set) we don't substitute. We also look for SI/SO to adjust so, and ESC to detect SS2/SS3. Need to ignore other ESC seqs correctly. JP doesn't use SI/SO, but uses ESC ( B/J and ESC $ B/@ analogously, so we use these to toggle so. "Roman", i.e. ESC ( J is treated as ascii.

  • no differences in html-relevant chars. Together, this allows us to deal with all iso-2022-* as a package. See rfc1468, 1554, 1557, 1922 for more info.

Line break at 84 to avoid splits with lines just a little too long.

Definition at line 294 of file ezmlm-cgi.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ index_links()

void index_links ( struct msginfo * infop)

Definition at line 976 of file ezmlm-cgi.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ index_messages()

void index_messages ( struct msginfo * infop,
unsigned char item )

for links from message view back to author/subject/threads index

Definition at line 621 of file ezmlm-cgi.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ justpress()

void justpress ( )

Definition at line 703 of file ezmlm-cgi.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ latestdate()

void latestdate ( struct msginfo * infop,
int flagfail )

Definition at line 936 of file ezmlm-cgi.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ list_list()

void list_list ( const char * listname)

Make one link [for list_set()] per set of 100 archive messages. Assumption: Any directory DIR/archive/xxx where 'xxx' is a numeric, is part of the list archive and has in it an index file and one or more messages.

Definition at line 2018 of file ezmlm-cgi.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ list_set()

void list_set ( unsigned long msgset)

Definition at line 2048 of file ezmlm-cgi.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ main()

int main ( int argc,
char ** argv )

Definition at line 2096 of file ezmlm-cgi.c.

Here is the call graph for this function:

◆ message_links()

void message_links ( struct msginfo * infop)

Creates the html for all links from one message view.

Definition at line 756 of file ezmlm-cgi.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mime_getarg()

void mime_getarg ( stralloc * sa,
char ** s,
unsigned int * l )

opies next token or "token" into sa and sets s & l appropriately for continuing the search

Definition at line 1240 of file ezmlm-cgi.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ msg2hash()

int msg2hash ( struct msginfo * infop)

Definition at line 1742 of file ezmlm-cgi.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nav_links()

void nav_links ( struct msginfo * infop,
unsigned char view,
unsigned char direction )

Creates using a maximum of available information only for links where the target is a message.

Definition at line 658 of file ezmlm-cgi.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ navigate()

int navigate ( struct msginfo * infop)

interprets msginfo to create msginfo. Upon return, msginfo can be trusted to have all info needed, and that all info is correct. There may be more info than needed. This can be used to build more specific links. NOTE: there is no guarantee that a message meeting the criteria actually exists

Definition at line 1930 of file ezmlm-cgi.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ new_mime()

void new_mime ( )

Definition at line 1213 of file ezmlm-cgi.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ object_links()

void object_links ( struct msginfo * infop,
char item )

Definition at line 1068 of file ezmlm-cgi.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ oput()

void oput ( const char * s,
unsigned int l )

Definition at line 185 of file ezmlm-cgi.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ oputs()

void oputs ( const char * s)

Definition at line 191 of file ezmlm-cgi.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_message()

void set_message ( struct msginfo * infop)

Reads the file corresponding to infop->view and assumes fname.s is set correctly for this. Sets up a msgnav structure and links it in correction for view=author/subject. For view=date it supports also direction=DIRECT_FIRST which will return the first message of the first thread in the date file. DIRECT_LAST is not supported. DIRECT_FIRST is supported ONLY for date.

Definition at line 1811 of file ezmlm-cgi.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ show_index()

int show_index ( struct msginfo * infop)

Definition at line 1002 of file ezmlm-cgi.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ show_message()

int show_message ( struct msginfo * infop)

Definition at line 1617 of file ezmlm-cgi.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ show_object()

int show_object ( struct msginfo * infop,
char item )

shows thread, threads, author infop has the info needed to access the author/subject/thread file

Definition at line 1098 of file ezmlm-cgi.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ show_part()

void show_part ( struct msginfo * infop,
int flagshowheaders,
int flagstartseen )

if flagshowheaders we display headers, otherwise not if flagstartseen we've already see the start boundary for this part, if not we'll ignore what's there up to it

Definition at line 1446 of file ezmlm-cgi.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ start_message_page()

void start_message_page ( struct msginfo * infop)

header etc for message. Delayed to collect subject so that we can put that in TITLE. This in turn needed for good looking robot index. Yep, not pretty, but it works and it's abhorrent to seek()/rewind* and another hack: it's hard to mix charsets within a doc. So, we disp messages entirely in the charset of the message. This is ok, since headers will be us-ascii or have encoded segments usually matching the charset in the message. Of course, we should be able to used e.g.

with internal resources as well as internal ones. One might make other-charset messages external resources as well. Now, the problem is that we need to "preview" MIME info before seeing the start boundary.

Definition at line 1420 of file ezmlm-cgi.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ subfaq_link()

void subfaq_link ( )

Definition at line 733 of file ezmlm-cgi.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ subj2msg()

void subj2msg ( struct msginfo * infop)

Definition at line 1893 of file ezmlm-cgi.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ toggle_flagpre()

void toggle_flagpre ( int flag)

Definition at line 226 of file ezmlm-cgi.c.

Here is the caller graph for this function:

◆ uri2fn()

int uri2fn ( stralloc * sa,
char item,
unsigned long n,
const char * hash )

from the inputs: item, num, and hash the normalized and relative file name URI of the target message is build and provided as 'sa'.

Definition at line 531 of file ezmlm-cgi.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ urlencode_put()

void urlencode_put ( const char * s,
unsigned int l )

Definition at line 439 of file ezmlm-cgi.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ urlencode_puts()

void urlencode_puts ( const char * s)

Definition at line 453 of file ezmlm-cgi.c.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ author

stralloc author = {0}

Definition at line 118 of file ezmlm-cgi.c.

◆ banner

char* banner = 0

Definition at line 109 of file ezmlm-cgi.c.

◆ bannerargs

char* bannerargs[4]

Definition at line 153 of file ezmlm-cgi.c.

◆ base

stralloc base = {0}

Definition at line 120 of file ezmlm-cgi.c.

◆ bi

buffer bi

Definition at line 177 of file ezmlm-cgi.c.

◆ bo

buffer bo = BUFFER_INIT(write,1,outbuf,sizeof(outbuf))

Definition at line 183 of file ezmlm-cgi.c.

◆ cache

int cache

Definition at line 142 of file ezmlm-cgi.c.

◆ cfline

stralloc cfline = {0}

Definition at line 123 of file ezmlm-cgi.c.

◆ charg

stralloc charg = {0}

Definition at line 116 of file ezmlm-cgi.c.

◆ charset

const char* charset = 0

Definition at line 110 of file ezmlm-cgi.c.

◆ charsetbase

stralloc charsetbase = {0}

Definition at line 129 of file ezmlm-cgi.c.

◆ child

int child

Definition at line 143 of file ezmlm-cgi.c.

◆ cn1

char cn1 = 0

Definition at line 150 of file ezmlm-cgi.c.

◆ cn2

char cn2 = 0

Definition at line 151 of file ezmlm-cgi.c.

◆ cntl

char* cntl = 0

Definition at line 112 of file ezmlm-cgi.c.

◆ content

stralloc content = {0}

Definition at line 128 of file ezmlm-cgi.c.

◆ cs

unsigned int cs

Definition at line 146 of file ezmlm-cgi.c.

◆ csbase

unsigned int csbase

Definition at line 146 of file ezmlm-cgi.c.

◆ curcharset

stralloc curcharset = {0}

Definition at line 130 of file ezmlm-cgi.c.

◆ decline

stralloc decline = {0}

Definition at line 122 of file ezmlm-cgi.c.

◆ dir

char* dir = 0

Definition at line 105 of file ezmlm-cgi.c.

◆ dt

struct datetime dt

Definition at line 174 of file ezmlm-cgi.c.

◆ dtline

stralloc dtline = {0}

Definition at line 125 of file ezmlm-cgi.c.

◆ enc_url

char enc_url[] = "%00"

Definition at line 437 of file ezmlm-cgi.c.

◆ encoding

stralloc encoding = {0}

Definition at line 127 of file ezmlm-cgi.c.

◆ euid

unsigned long euid

Definition at line 134 of file ezmlm-cgi.c.

◆ fd

int fd

Definition at line 141 of file ezmlm-cgi.c.

◆ flagmime

unsigned int flagmime

Definition at line 145 of file ezmlm-cgi.c.

◆ flagobscure

int flagobscure = 0

Definition at line 55 of file ezmlm-cgi.c.

◆ flagpre

int flagpre

Definition at line 148 of file ezmlm-cgi.c.

◆ flagrobot

int flagrobot

Definition at line 147 of file ezmlm-cgi.c.

◆ flagshowhtml

int flagshowhtml = 1

Definition at line 50 of file ezmlm-cgi.c.

◆ flagtoplevel

int flagtoplevel

Definition at line 144 of file ezmlm-cgi.c.

◆ fname

stralloc fname = {0}

Definition at line 124 of file ezmlm-cgi.c.

◆ hdr

stralloc hdr[NO_HDRS] = { {0},{0},{0},{0},{0},{0} }

Definition at line 72 of file ezmlm-cgi.c.

◆ headermap

struct constmap headermap

Definition at line 133 of file ezmlm-cgi.c.

◆ headers

stralloc headers = {0}

Definition at line 126 of file ezmlm-cgi.c.

◆ headers_shown

int headers_shown[] = {1,1,1,0,0,0}

Definition at line 62 of file ezmlm-cgi.c.

◆ headers_used

char headers_used[]
Initial value:
= "Subject\\From\\Date\\content-type\\"
"content-transfer-encoding\\mime-version"

Definition at line 59 of file ezmlm-cgi.c.

◆ hexchar

char hexchar[] = "0123456789ABCDEF"

Definition at line 436 of file ezmlm-cgi.c.

◆ home

char* home = 0

Definition at line 108 of file ezmlm-cgi.c.

◆ host

char* host = 0

Definition at line 107 of file ezmlm-cgi.c.

◆ inbuf

char inbuf[4096]

Definition at line 176 of file ezmlm-cgi.c.

◆ lastjp

char lastjp[] = "B"

Definition at line 152 of file ezmlm-cgi.c.

◆ line

stralloc line = {0}

Definition at line 121 of file ezmlm-cgi.c.

◆ listname

stralloc listname = {0}

Definition at line 132 of file ezmlm-cgi.c.

◆ local

char* local = 0

Definition at line 106 of file ezmlm-cgi.c.

◆ match

int match

Definition at line 140 of file ezmlm-cgi.c.

◆ mime_current

mime_info* mime_current = 0

Definition at line 170 of file ezmlm-cgi.c.

◆ mime_tmp

mime_info* mime_tmp = 0

Definition at line 171 of file ezmlm-cgi.c.

◆ msginfo

struct msginfo msginfo

◆ msgnav

unsigned long msgnav[5]

Definition at line 224 of file ezmlm-cgi.c.

◆ navstr

char navstr[5] = "xxx:"

Definition at line 90 of file ezmlm-cgi.c.

◆ newlevel

int newlevel

Definition at line 139 of file ezmlm-cgi.c.

◆ outbuf

char outbuf[4096]

Definition at line 182 of file ezmlm-cgi.c.

◆ pos

unsigned int pos

Definition at line 146 of file ezmlm-cgi.c.

◆ precharcount

int precharcount

Definition at line 149 of file ezmlm-cgi.c.

◆ recursion_level

int recursion_level

Definition at line 135 of file ezmlm-cgi.c.

◆ sainit

stralloc sainit = {0}

Definition at line 131 of file ezmlm-cgi.c.

◆ so

int so = 0

Definition at line 136 of file ezmlm-cgi.c.

◆ ss23

int ss23 = 0

Definition at line 137 of file ezmlm-cgi.c.

◆ state

int state = 0

Definition at line 138 of file ezmlm-cgi.c.

◆ strnum

char strnum[FMT_ULONG]

Definition at line 113 of file ezmlm-cgi.c.

◆ stylesheet

char* stylesheet = 0

Definition at line 111 of file ezmlm-cgi.c.

◆ subject

stralloc subject = {0}

Definition at line 119 of file ezmlm-cgi.c.

◆ uid

unsigned long uid

Definition at line 134 of file ezmlm-cgi.c.

◆ url

stralloc url = {0}

Definition at line 117 of file ezmlm-cgi.c.

◆ when

Definition at line 173 of file ezmlm-cgi.c.

◆ wstat

int wstat

Definition at line 143 of file ezmlm-cgi.c.