Back to index

courier  0.68.2
Classes | Defines | Functions | Variables
sqwebmail.c File Reference
#include "sqwebmail.h"
#include "sqconfig.h"
#include "auth.h"
#include "folder.h"
#include "pref.h"
#include "maildir.h"
#include "cgi/cgi.h"
#include "mailinglist.h"
#include "newmsg.h"
#include "pcp.h"
#include "acl.h"
#include "addressbook.h"
#include "autoresponse.h"
#include "http11/http11.h"
#include "random128/random128.h"
#include "maildir/maildirmisc.h"
#include "maildir/maildirinfo.h"
#include "maildir/maildiraclt.h"
#include "liblock/config.h"
#include "liblock/liblock.h"
#include "rfc822/rfc822hdr.h"
#include "courierauth.h"
#include <stdio.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <signal.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/socket.h>
#include <ctype.h>
#include "md5/md5.h"
#include <courierauthdebug.h>
#include "maildir/maildircache.h"
#include "maildir/maildirnewshared.h"
#include "mailfilter.h"
#include "numlib/numlib.h"
#include "gpglib/gpglib.h"
#include "gpg.h"
#include "htmllibdir.h"
#include "logindomainlist.h"
#include "strftime.h"

Go to the source code of this file.

Classes

struct  template_stack
struct  var_put_buf

Defines

#define MD5_INTERNAL
#define ALL_RIGHTS
#define ADD(s)   {const char *zz=(s); if (i) strcat(q, zz); l += strlen(zz);}
#define ADDE(ue)   { char *yy=cgiurlencode(ue); ADD(yy); free(yy); }
#define MKIMG(c)   (*output_func)((c), void_arg)

Functions

void spell_show ()
void spell_check_continue ()
void print_safe (const char *)
void ldaplist ()
int ldapsearch ()
void doldapsearch ()
void sent_gpgerrtxt ()
void sent_gpgerrresume ()
const char * redirect_hash (const char *)
int nochangepass ()
void attachments_head (const char *, const char *, const char *)
void attachments_opts (const char *)
void doattach (const char *, const char *)
static void timezonelist ()
char * trim_spaces (const char *s)
size_t get_timeoutsoft ()
size_t get_timeouthard ()
void fake_exit (int n)
void authexit (int n)
void rfc2045_error (const char *p)
void print_attrencodedlen (const char *p, size_t len, int oknl, FILE *fp)
void output_attrencoded_fp (const char *p, FILE *fp)
void output_attrencoded (const char *p)
void output_attrencoded_oknl_fp (const char *p, FILE *fp)
void output_attrencoded_oknl (const char *p)
void output_attrencoded_nltobr (const char *p)
void output_urlencoded (const char *p)
void output_loginscriptptr ()
const char * nonloginscriptptr ()
void output_scriptptr ()
void output_loginscriptptr_get ()
char * scriptptrget ()
void output_scriptptrget ()
void output_scriptptrpostinfo ()
void error (const char *errmsg)
void error2 (const char *file, int line)
void error3 (const char *file, int line, const char *msg1, const char *msg2, int err)
char * get_templatedir ()
char * get_imageurl ()
FILE * open_langform (const char *lang, const char *formname, int print_header)
int ishttps ()
static void var_put_buf_func (int c, void *p)
static void pass_image_through (int c, void *p)
static void output_image (FILE *f, void(*output_func)(int, void *), void *void_arg)
static int timezonefile (int(*callback_func)(const char *, const char *, void *), void *callback_arg)
static int callback_timezonelist (const char *, const char *, void *)
static int set_timezone (const char *p)
static int callback_get_timezone (const char *, const char *, void *)
static char * get_timezone ()
static FILE * do_open_form (const char *formname, int flag)
static void do_close_form ()
static void do_output_form_loop (FILE *)
static void fix_xml_header (FILE *f)
void output_form (const char *formname)
static FILE * openinclude (const char *)
void insert_include (const char *inc_name)
static void http_redirect_top (const char *app)
void http_redirect_argu (const char *fmt, unsigned long un)
void http_redirect_argss (const char *fmt, const char *arg1, const char *arg2)
void http_redirect_argsss (const char *fmt, const char *arg1, const char *arg2, const char *arg3)
void output_user_form (const char *formname)
void folder_cleanup ()
void maildir_cleanup ()
void mailfilter_cleanup ()
void cleanup ()
static RETSIGTYPE catch_sig (int n)
static void setlang ()
static void init_default_locale ()
void rename_sent_folder (int really)
static int valid_redirect ()
static void redirect (const char *url)
static void main2 ()
static void usage ()
static void call_main2 (void *dummy)
int main (int argc, char **argv)
static int setuidgid (uid_t u, gid_t g, const char *dir, void *dummy)

Variables

const char * sqwebmail_mailboxid = 0
const char * sqwebmail_folder = 0
char sqwebmail_folder_rights [sizeof(ALL_RIGHTS)]
const char * sqwebmail_sessiontoken = 0
const char * sqwebmail_content_language = 0
const char * sqwebmail_content_locale
const char * sqwebmail_system_charset = 0
static char * sys_locale_charset = 0
const char * sqwebmail_content_ispelldict
const char * sqwebmail_content_charset
dev_t sqwebmail_homedir_dev
ino_t sqwebmail_homedir_ino
static int noimages = 0
time_t login_time
static const char *const authvars []
static const char * sqwebmail_formname
static struct template_stacktemplate_stack = NULL

Class Documentation

struct template_stack

Definition at line 157 of file sqwebmail.c.

Collaboration diagram for template_stack:
Class Members
FILE * fp
struct template_stack * next
struct var_put_buf

Definition at line 501 of file sqwebmail.c.

Class Members
char argbuf
size_t argn
char * argp

Define Documentation

#define ADD (   s)    {const char *zz=(s); if (i) strcat(q, zz); l += strlen(zz);}
#define ADDE (   ue)    { char *yy=cgiurlencode(ue); ADD(yy); free(yy); }
#define ALL_RIGHTS
Value:
ACL_ADMINISTER \
       ACL_CREATE \
       ACL_EXPUNGE \
       ACL_INSERT \
       ACL_LOOKUP \
       ACL_READ \
       ACL_SEEN \
       ACL_DELETEMSGS \
       ACL_WRITE \
       ACL_DELETEFOLDER

Definition at line 108 of file sqwebmail.c.

#define MD5_INTERNAL

Definition at line 71 of file sqwebmail.c.

#define MKIMG (   c)    (*output_func)((c), void_arg)

Function Documentation

void attachments_head ( const char *  ,
const char *  ,
const char *   
)

Definition at line 92 of file attachments.c.

{
char *filename;
FILE   *fp;
struct rfc2045 *rfcp;
int    cnt=0;
struct rfc2045 *q;
int    foundtextplain=0;
const char    *noattach_lab=getarg("NOATTACH");
const char    *quotaerr=getarg("QUOTAERR");
const char    *limiterr=getarg("LIMITERR");
off_t  dummy;
int    fd2;

       CHECKFILENAME(draft);
       filename=maildir_find(INBOX "." DRAFTS, draft);
       if (!filename)       return;

       fd2=maildir_safeopen(filename, O_RDONLY, 0);

       fp=0;
       if (fd2 >= 0)
       {
              fp=fdopen(fd2, "r");
              if (fp == NULL)
                     close(fd2);
       }

       if (fp == NULL)
       {
              free(filename);
              return;
       }

       rfcp=rfc2045_fromfp(fp);
       fclose(fp);
       free(filename);

       if (strcmp(cgi("error"), "quota") == 0)
       {
              printf("%s", quotaerr);
       }

       if (strcmp(cgi("error"), "limits") == 0)
       {
              printf(limiterr, (unsigned long)(max_attach() / (1024 * 1024)));
       }

       if (strcmp(cgi("error"), "makemime") == 0)
       {
              printf(getarg("MAKEMIMEERR"), MAKEMIME);
       }
       newmsg_hiddenheader("pos", pos);
       newmsg_hiddenheader("draft", draft);
       tokennew();
       printf("<table width=\"100%%\" border=\"0\">");

       if (rfcp)
       {
              const char *content_type;
              const char *content_transfer_encoding;
              const char *charset;

              rfc2045_mimeinfo(rfcp, &content_type,
                     &content_transfer_encoding, &charset);

              if (content_type &&
                  strcmp(content_type, "multipart/alternative") == 0)
                     rfcp=NULL;

              /* No attachments here */
       }

       for (q=rfcp ? rfcp->firstpart:0; q; q=q->next)
       {
       const char *content_type;
       const char *content_transfer_encoding;
       const char *charset;
       const char *name;
       const char *cn;
       char *content_name;

       off_t start_pos, end_pos, start_body;

              if (q->isdummy)      continue;

              rfc2045_mimeinfo(q, &content_type,
                     &content_transfer_encoding, &charset);
              if (!foundtextplain && HASTEXTPLAIN(q))
              {
                     foundtextplain=1;
                     continue;
              }
              rfc2045_mimepos(q, &start_pos, &end_pos, &start_body,
                     &dummy, &dummy);

              ++cnt;
              printf("<tr><td align=\"left\"><input type=\"checkbox\" name=\"del%d\" id=\"del%d\" />&nbsp;",
                     cnt, cnt);

              if (rfc2231_udecodeType(q, "name", sqwebmail_content_charset,
                                   &content_name) < 0 ||
                  rfc2231_udecodeDisposition(q, "filename",
                                          sqwebmail_content_charset,
                                          &content_name) < 0)
                     content_name=NULL;

              if (!content_name &&
                  ((cn=rfc2045_getattr(q->content_type_attr, "name")) ||
                   (cn=rfc2045_getattr(q->content_disposition_attr,
                                    "filename"))))
              {
                     content_name =
                            rfc822_display_hdrvalue_tobuf("subject",
                                                       cn,
                                                       sqwebmail_content_charset,
                                                       NULL,
                                                       NULL);
              }

              if ((!content_name || !*content_name) &&
                  strcmp(content_type, "application/pgp-keys") == 0)
                     name=getarg("KEYDESCR");
              else
              {
                     name=content_name;
              }

              attachment_showname(name);
              if (content_name)
                     free(content_name);
              printf("</td><td align=\"left\">&nbsp;&nbsp;<label for=\"del%d\">", cnt);
              output_attrencoded( content_type );
              printf("</label></td><td align=\"right\">%s<br /></td></tr>",
                     showsize(end_pos - start_body));
       }

       if (cnt == 0)
              printf("<tr><td align=\"center\">%s<br /></td></tr>\n",
                     noattach_lab);
       printf("</table>\n");
}

Here is the call graph for this function:

Here is the caller graph for this function:

void attachments_opts ( const char *  )

Definition at line 235 of file attachments.c.

{
       char *filename;
       FILE *fp;

       CHECKFILENAME(draft);

       filename=maildir_find(INBOX "." DRAFTS, draft);
       if (!filename)
              return;
       fp=fopen(filename, "r");
       free(filename);
       if (!fp)
              return;

       printf("<label><input type=\"checkbox\" name=\"fcc\"%s />%s</label><br />",
              pref_noarchive ? "":" checked=\"checked\"",
              getarg("PRESERVELAB"));
       if (auth_getoptionenvint("wbnodsn") == 0)
              printf("<label><input type=\"checkbox\" name=\"dsn\" />%s</label><br />",
                     getarg("DSN"));

       if (libmail_gpg_has_gpg(GPGDIR) == 0)
       {
              char *all_addr;

              printf("<label><input type=\"checkbox\" "
                     "name=\"sign\" />%s</label><select name=\"signkey\">",
                     getarg("SIGNLAB"));
              gpgselectkey();
              printf("</select><br />\n");

              all_addr=newmsg_alladdrs(fp);

              printf("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">"
                     "<tr valign=\"middle\"><td><input type=\"checkbox\""
                     " name=\"encrypt\" id=\"encrypt\" /></td><td><label for=\"encrypt\">%s</label></td>"
                     "<td><select size=\"4\" multiple=\"multiple\" name=\"encryptkey\">",
                     getarg("ENCRYPTLAB"));
              gpgencryptkeys(all_addr);
              printf("</select></td></tr>\n");

              if (ishttps())
                     printf("<tr valign=\"middle\"><td>&nbsp;</td><td>%s</td><td><input type=\"password\" name=\"passphrase\" /></td></tr>\n",
                            getarg("PASSPHRASE"));

              printf("</table><br />\n");
              if (all_addr)
                     free(all_addr);
       }
       fclose(fp);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void authexit ( int  n)

Definition at line 201 of file sqwebmail.c.

{
       fake_exit(n);
}

Here is the call graph for this function:

static void call_main2 ( void *  dummy) [static]

Definition at line 2158 of file sqwebmail.c.

{
       main2();
       cleanup();
}

Here is the call graph for this function:

Here is the caller graph for this function:

static int callback_get_timezone ( const char *  tz,
const char *  n,
void *  dummy 
) [static]

Definition at line 720 of file sqwebmail.c.

{
       if (strcmp(tz, cgi("timezonelist")) == 0)
       {
              char **p=(char **)dummy;

              if (*p)
                     free(*p);

              *p=strdup(tz);
       }
       return (0);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static int callback_timezonelist ( const char *  tz,
const char *  n,
void *  dummy 
) [static]

Definition at line 662 of file sqwebmail.c.

{
       printf("<option value=\"%s\">", tz);
       output_attrencoded(n);
       printf("</option>\n");
       return (0);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static RETSIGTYPE catch_sig ( int  n) [static]

Definition at line 2005 of file sqwebmail.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void cleanup ( )

Definition at line 1969 of file sqwebmail.c.

{
       sqwebmail_formname = NULL;
       sqwebmail_mailboxid=0;
       sqwebmail_folder=0;
       sqwebmail_sessiontoken=0;
       sqwebmail_content_language=0;
       sqwebmail_content_locale=0;
       sqwebmail_system_charset=0;
       if (sys_locale_charset)
              free(sys_locale_charset);
       sys_locale_charset=0;
       sqwebmail_content_ispelldict=0;
       folder_cleanup();
       maildir_cleanup();
       mailfilter_cleanup();
#ifdef ISPELL
       ispell_cleanup();
#endif

#ifdef GZIP
       if (gzip_save_fd >= 0)      /* Restore original stdout */
       {
              dup2(gzip_save_fd, 1);
              close(gzip_save_fd);
              gzip_save_fd= -1;
       }
#endif

       libmail_gpg_cleanup();
       freeargs();
       sqpcp_close();
}

Here is the call graph for this function:

static void do_close_form ( ) [static]

Definition at line 761 of file sqwebmail.c.

{
       struct template_stack *ts=template_stack;

       if (!ts)
              enomem();

       fclose(ts->fp);
       template_stack=ts->next;
       free(ts);
}

Here is the caller graph for this function:

static FILE* do_open_form ( const char *  formname,
int  flag 
) [static]

Definition at line 736 of file sqwebmail.c.

{
       struct template_stack *ts;
       FILE   *f=NULL;

       if ((ts=(struct template_stack *)malloc(sizeof(struct template_stack)))
           == NULL)
              return (NULL);

       if (sqwebmail_content_language)
              f=open_langform(sqwebmail_content_language, formname, flag);
       if (!f)       f=open_langform(HTTP11_DEFAULTLANG, formname, flag);

       if (!f)
       {
              free(ts);
              return (NULL);
       }

       ts->next=template_stack;
       template_stack=ts;
       ts->fp=f;
       return (f);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void do_output_form_loop ( FILE *  f) [static]

Definition at line 926 of file sqwebmail.c.

{
       int    c, c2, c3;

       while ((c=getc(f)) >= 0)
       {
       char   kw[64];

              if (c != '[')
              {
                     putchar(c);
                     continue;
              }
              c=getc(f);
              if (c != '#')
              {
                     putchar('[');
                     ungetc(c,f);
                     continue;
              }
              c=getc(f);
              if (c == '?')
              {
                     c=getc(f);
                     if (c < '0' || c > '9')
                     {
                            putchar('[');
                            putchar('#');
                            putchar('?');
                            putchar(c);
                            continue;
                     }
                     if (
                         ( c == '0' && nochangepass()) ||
                         (c == '1' && strncmp(cgi("folderdir"),
                                           SHARED ".",
                                           sizeof(SHARED)) == 0) ||
                         (c == '2' && strncmp(cgi("folderdir"),
                                           SHARED ".",
                                           sizeof(SHARED))) ||
                         (c == '4' && maildir_filter_hasmaildirfilter(".")) ||
                         (c == '5' && libmail_gpg_has_gpg(GPGDIR)) ||
                         (c == '6' && !ishttps()) ||
                         (c == '7' && !sqpcp_has_calendar()) ||
                         (c == '8' && !sqpcp_has_groupware())
                         )
                     {
                            while ((c=getc(f)) != EOF)
                            {
                                   if (c != '[') continue;
                                   if ( getc(f) != '#') continue;
                                   if ( getc(f) != '?') continue;
                                   if ( getc(f) != '#') continue;
                                   if ( getc(f) == ']') break;
                            }
                     }
                     continue;
              }

              if (c == '$')
              {
                     struct var_put_buf buf;

                     buf.argp=buf.argbuf;
                     buf.argn=sizeof(buf.argbuf)-1;

                     while ((c=getc(f)) >= 0 && c != '\n')
                     {
                            if (c == '#')
                            {
                                   c=getc(f);
                                   if (c == ']') break;
                                   ungetc(c, f);
                                   c='#';
                            }

                            if (c == '@')
                            {
                                   c=getc(f);
                                   if (c == '@')
                                   {
                                          output_image(f,
                                                      var_put_buf_func,
                                                      &buf);
                                          continue;
                                   }
                                   ungetc(c, f);
                                   c='@';
                            }
                            var_put_buf_func(c, &buf);
                     }
                     *buf.argp=0;
                     addarg(buf.argbuf);
                     continue;
              }

              if (c == '@')
              {
                     output_image(f, pass_image_through, NULL);
                     c=getc(f);
                     if (c == '#')
                     {
                            c=getc(f);
                            if (c == ']')
                                   continue;
                     }
                     if (c != EOF)
                            ungetc(c, f);
                     continue;
              }

              if (!isalnum(c) && c != ':')
              {
                     putchar('[');
                     putchar('#');
                     ungetc(c, f);
                     continue;
              }
              c2=0;
              while (c != EOF && (isalnum(c) || c == ':' || c == '_'))
              {
                     if (c2 < sizeof(kw)-1)
                            kw[c2++]=c;
                     c=getc(f);
              }
              kw[c2]=0;
              c2=c;

              if (c2 != '#')
              {
                     putchar('[');
                     putchar('#');
                     printf("%s", kw);
                     ungetc(c2, f);
                     continue;
              }

              if ((c3=getc(f)) != ']')
              {
                     putchar('[');
                     putchar('#');
                     printf("%s", kw);
                     putchar(c2);
                     ungetc(c3, f);
                     continue;
              }

              if (strcmp(kw, "a") == 0)
              {
                     addressbook();
              }
              else if (strcmp(kw, "d") == 0)
              {
                     const char *f=cgi("folderdir");
                     char *origc, *c;
                     const char *sep="";

                     origc=c=folder_fromutf7(f);

                     if (*c && strcmp(c, INBOX))
                     {
                            printf(" - ");

                            if (strcmp(c, NEWSHAREDSP) == 0 ||
                                strncmp(c, NEWSHAREDSP ".",
                                       sizeof(NEWSHAREDSP)) == 0)
                            {
                                   printf("%s", getarg("PUBLICFOLDERS"));
                                   sep=".";
                            }

                            c=strchr(c, '.');
                            if (c)
                            {
                                   printf(sep);
                                   print_safe(c+1);
                            }
                     }
                     free(origc);
              }
              else if (strcmp(kw, "D") == 0)
              {
                     const char *p=cgi("folder");
                     const char *q=strrchr(p, '.');

                            if (q)
                            {
                            char   *r=malloc(q-p+1);

                                   if (!r)       enomem();
                                   memcpy(r, p, q-p);
                                   r[q-p]=0;
                                   output_urlencoded(r);
                                   free(r);
                            }
              }
              else if (strcmp(kw, "G") == 0)
              {
                     output_attrencoded(login_returnaddr());
              }
              else if (strcmp(kw, "r") == 0)
              {
                     output_attrencoded(cgi("redirect"));
              }
              else if (strcmp(kw, "s") == 0)
              {
                     output_scriptptrget();
              }
              else if (strcmp(kw, "S") == 0)
              {
                     output_loginscriptptr();
              }
              else if (strcmp(kw, "R") == 0)
              {
                     output_loginscriptptr_get();
              }
              else if (strcmp(kw, "p") == 0)
              {
                     output_scriptptr();
              }
              else if (strcmp(kw, "P") == 0)
              {
                     output_scriptptrpostinfo();
              }
              else if (strcmp(kw, "f") == 0)
              {
                     folder_contents_title();
              }
              else if (strcmp(kw, "F") == 0)
              {
                     folder_contents(sqwebmail_folder, atol(cgi("pos")));
              }
              else if (strcmp(kw, "n") == 0)
              {
                     folder_initnextprev(sqwebmail_folder, atol(cgi("pos")));
              }
              else if (strcmp(kw, "N") == 0)
              {
                     folder_nextprev();
              }
              else if (strcmp(kw, "m") == 0)
              {
                     folder_msgmove();
              }
              else if (strcmp(kw, "M") == 0)
              {
                     folder_showmsg(sqwebmail_folder, atol(cgi("pos")));
              }
              else if (strcmp(kw, "T") == 0)
              {
                     folder_showtransfer();
              }
              else if (strcmp(kw, "L") == 0)
              {
                     folder_list();
              }
              else if (strcmp(kw, "l") == 0)
              {
                     folder_list2();
              }
              else if (strcmp(kw, "E") == 0)
              {
                     folder_rename_list();
              }
              else if (strcmp(kw, "W") == 0)
              {
                     newmsg_init(sqwebmail_folder, cgi("pos"));
              }
              else if (strcmp(kw, "z") == 0)
              {
                     pref_isdisplayfullmsg();
              }
              else if (strcmp(kw, "y") == 0)
              {
                     pref_isoldest1st();
              }
              else if (strcmp(kw, "H") == 0)
              {
                     pref_displayhtml();
              }
              else if (strcmp(kw, "FLOWEDTEXT") == 0)
              {
                     pref_displayflowedtext();
              }
              else if (strcmp(kw, "NOARCHIVE") == 0)
              {
                     pref_displaynoarchive();
              }
              else if (strcmp(kw, "NOAUTORENAMESENT") == 0)
              {
                     pref_displaynoautorenamesent();
              }
              else if (strcmp(kw, "x") == 0)
              {
                     pref_setprefs();
              }
              else if (strcmp(kw, "w") == 0)
              {
                     pref_sortorder();
              }
              else if (strcmp(kw, "t") == 0)
              {
                     pref_signature();
              }
              else if (strcmp(kw, "u") == 0)
              {
                     pref_pagesize();
              }
              else if (strcmp(kw, "v") == 0)
              {
                     pref_displayautopurge();
              }
              else if (strcmp(kw, "A") == 0)
              {
                     attachments_head(sqwebmail_folder, cgi("pos"),
                            cgi("draft"));
              }
              else if (strcmp(kw, "ATTACHOPTS") == 0)
              {
                     attachments_opts(cgi("draft"));
              }
              else if (strcmp(kw, "GPGERR") == 0)
              {
                     sent_gpgerrtxt();
              }
              else if (strcmp(kw, "GPGERRRESUME") == 0)
              {
                     sent_gpgerrresume();
              }
#ifdef ISPELL
              else if (strcmp(kw, "K") == 0)
              {
                     spell_show();
              }
#endif
#ifdef BANNERPROG
              else if (strcmp(kw, "B") == 0)
              {
                     char banargbuf[31];
                     int    i=0;
                     int    wait_stat;
                     pid_t  p, p2;

                            if ((c=getc(f)) != '{')
                                   ungetc(c, f);
                            else   while ((c=getc(f)), isalnum(c))
                                          if (i < sizeof(banargbuf)-1)
                                                 banargbuf[i++]=c;
                            banargbuf[i]=0;
                            fflush(stdout);

                            if ( (p=fork()) == 0 )
                            {
                                   execl(BANNERPROG, BANNERPROG,
                                          sqwebmail_formname,
                                          banargbuf, (char *)0);
                                   _exit(0);
                            }
                            if (p > 0)
                            {
                                   while ((p2=wait(&wait_stat)) > 0 &&
                                          p2 != p)
                                          ;
                            }
              }
#endif
              else if (strcmp(kw, "h") == 0)
              {
                     FILE *fp=fopen(LOGINDOMAINLIST, "r");

                     if (fp) {
                            /* parse LOGINDOMAINLIST and print proper output */
                            print_logindomainlist(fp);
                            fclose(fp);
                     }
              }
              else if (strcmp(kw, "o") == 0)
              {
                     ldaplist();
              }
              else if (strcmp(kw, "O") == 0)
              {
                     doldapsearch();
              }
              else if (strcmp(kw, "IMAGEURL") == 0)
              {
                     printf("%s", get_imageurl());
              }                    
              else if (strcmp(kw, "LOADMAILFILTER") == 0)
              {
                     mailfilter_init();
              }
              else if (strcmp(kw, "MAILFILTERLIST") == 0)
              {
                     mailfilter_list();
              }
              else if (strcmp(kw, "MAILFILTERLISTFOLDERS") == 0)
              {
                     mailfilter_listfolders();
              }
              else if (strcmp(kw, "QUOTA") == 0)
              {
                     folder_showquota();
              }
              else if (strcmp(kw, "NICKLIST") == 0)
              {
                      ab_listselect();
              }
              else if (strcmp(kw, "LISTPUB") == 0)
              {
                     gpglistpub();
              }
              else if (strcmp(kw, "LISTSEC") == 0)
              {
                     gpglistsec();
              }
              else if (strcmp(kw, "KEYIMPORT") == 0)
              {
                     folder_keyimport(sqwebmail_folder, atol(cgi("pos")));
              }
              else if (strcmp(kw, "GPGCREATE") == 0)
              {
                     gpgcreate();
              }
              else if (strcmp(kw, "DOGPG") == 0)
              {
                     gpgdo();
              }
              else if (strcmp(kw, "ATTACHPUB") == 0)
              {
                     gpgselectpubkey();
              }
              else if (strcmp(kw, "ATTACHSEC") == 0)
              {
                     gpgselectprivkey();
              }
              else if (strcmp(kw, "MAILINGLISTS") == 0)
              {
                     char *p=getmailinglists();

                     /* <sigh> amaya inserts a bunch of spaces that mess
                     ** things up in Netscape.
                     */

                     output_attrencoded(p ? p:"");
                     if (p)
                            free(p);
              }
              else if (strcmp(kw, "AUTORESPONSE") == 0)
              {
                     autoresponse();
              }
              else if (strcmp(kw, "AUTORESPONSE_LIST") == 0)
              {
                     autoresponselist();
              }
              else if (strcmp(kw, "AUTORESPONSE_PICK") == 0)
              {
                     autoresponsepick();
              }
              else if (strcmp(kw, "AUTORESPONSE_DELETE") == 0)
              {
                     autoresponsedelete();
              }
              else if (strcmp(kw, "SQWEBMAILCSS") == 0)
              {
                     printf("%s/sqwebmail.css", get_imageurl());
              }
              else if (strcmp(kw, "timezonelist") == 0)
              {
                     timezonelist();
              }
              else if (strcmp(kw, "PREFWEEK") == 0)
              {
                     pref_displayweekstart();
              }
              else if (strcmp(kw, "NEWEVENT") == 0)
              {
                     sqpcp_newevent();
              }
              else if (strcmp(kw, "RECURRING") == 0)
              {
                     printf("%s", getarg("RECURRING"));
              }
              else if (strcmp(kw, "EVENTSTART") == 0)
              {
                     sqpcp_eventstart();
              }
              else if (strcmp(kw, "EVENTEND") == 0)
              {
                     sqpcp_eventend();
              }
              else if (strcmp(kw, "EVENTFROM") == 0)
              {
                     sqpcp_eventfrom();
              }
              else if (strcmp(kw, "EVENTTIMES") == 0)
              {
                     sqpcp_eventtimes();
              }
              else if (strcmp(kw, "EVENTPARTICIPANTS") == 0)
              {
                     sqpcp_eventparticipants();
              }
              else if (strcmp(kw, "EVENTTEXT") == 0)
              {
                     sqpcp_eventtext();
              }
              else if (strcmp(kw, "EVENTATTACH") == 0)
              {
                     sqpcp_eventattach();
              }
              else if (strcmp(kw, "EVENTSUMMARY") == 0)
              {
                     sqpcp_summary();
              }
              else if (strcmp(kw, "CALENDARTODAY") == 0)
              {
                     sqpcp_todays_date();
              }
              else if (strcmp(kw, "CALENDARWEEKLYLINK") == 0)
              {
                     sqpcp_weeklylink();
              }
              else if (strcmp(kw, "CALENDARMONTHLYLINK") == 0)
              {
                     sqpcp_monthlylink();
              }
              else if (strcmp(kw, "CALENDARTODAYV") == 0)
              {
                     sqpcp_todays_date_verbose();
              }
              else if (strcmp(kw, "CALENDARDAYVIEW") == 0)
              {
                     sqpcp_daily_view();
              }
              else if (strcmp(kw, "CALENDARPREVDAY") == 0)
              {
                     sqpcp_prevday();
              }
              else if (strcmp(kw, "CALENDARNEXTDAY") == 0)
              {
                     sqpcp_nextday();
              }
              else if (strcmp(kw, "CALENDARWEEK") == 0)
              {
                     sqpcp_show_cal_week();
              }
              else if (strcmp(kw, "CALENDARNEXTWEEK") == 0)
              {
                     sqpcp_show_cal_nextweek();
              }
              else if (strcmp(kw, "CALENDARPREVWEEK") == 0)
              {
                     sqpcp_show_cal_prevweek();
              }
              else if (strcmp(kw, "CALENDARWEEKVIEW") == 0)
              {
                     sqpcp_displayweek();
              }
              else if (strcmp(kw, "CALENDARMONTH") == 0)
              {
                     sqpcp_show_cal_month();
              }
              else if (strcmp(kw, "CALENDARNEXTMONTH") == 0)
              {
                     sqpcp_show_cal_nextmonth();
              }
              else if (strcmp(kw, "CALENDARPREVMONTH") == 0)
              {
                     sqpcp_show_cal_prevmonth();
              }
              else if (strcmp(kw, "CALENDARMONTHVIEW") == 0)
              {
                     sqpcp_displaymonth();
              }
              else if (strcmp(kw, "EVENTDISPLAYINIT") == 0)
              {
                     sqpcp_displayeventinit();
              }
              else if (strcmp(kw, "EVENTDELETEINIT") == 0)
              {
                     sqpcp_deleteeventinit();
              }
              else if (strcmp(kw, "EVENTDISPLAY") == 0)
              {
                     sqpcp_displayevent();
              }
              else if (strcmp(kw, "EVENTBACKLINK") == 0)
              {
                     sqpcp_eventbacklink();
              }
              else if (strcmp(kw, "EVENTEDITLINK") == 0)
              {
                     sqpcp_eventeditlink();
              }
              else if (strcmp(kw, "EVENTCANCELUNCANCELLINK") == 0)
              {
                     sqpcp_eventcanceluncancellink();
              }
              else if (strcmp(kw, "EVENTCANCELUNCANCELLINK") == 0)
              {
                     sqpcp_eventcanceluncancellink();
              }
              else if (strcmp(kw, "EVENTCANCELUNCANCELIMAGE") == 0)
              {
                     sqpcp_eventcanceluncancelimage();
              }
              else if (strcmp(kw, "EVENTCANCELUNCANCELTEXT") == 0)
              {
                     sqpcp_eventcanceluncanceltext();
              }
              else if (strcmp(kw, "EVENTDELETELINK") == 0)
              {
                     sqpcp_eventdeletelink();
              }
              else if (strcmp(kw, "EVENTACL") == 0)
              {
                     sqpcp_eventacl();
              }
              else if (strcmp(kw, "ABOOKNAMELIST") == 0)
              {
                     ab_addrselect();
              }
              else if (strcmp(kw, "LISTRIGHTS") == 0)
                     listrights();
              else if (strcmp(kw, "GETACL") == 0)
                     getacl();
              else if (strcmp(kw, "MSGPOS") == 0)
              {
                     printf("%ld", atol(cgi("pos"))+1);
              }
              else if (strncmp(kw, "radio:", 6) == 0)
              {
              const char *name=strtok(kw+6, ":");
              const char *value=strtok(0, ":");

                     if (name && value)
                     {
                            printf("<input type=\"radio\" name=\"%s\""
                                   " value=\"%s\"",
                                   name, value);
                            if ( strcmp(cgi(name), value) == 0)
                                   printf(" checked=\"checked\"");
                            printf(" />");
                     }
              }
              else if (strncmp(kw, "checkbox:", 9) == 0)
              {
              const char *name=strtok(kw+9, ":");
              const char *cgivar=strtok(0, ":");

                     if (name && cgivar)
                     {
                            printf("<input type=\"checkbox\" name=\"%s\""
                                   "%s />",
                                   name,
                                   *cgi(cgivar) ? " checked=\"checked\"":"");
                     }
              }
              else if (strncmp(kw, "input:", 6) == 0)
              {
                     output_attrencoded(cgi(kw+6));
              }
              else if (strncmp(kw, "select:", 7) == 0)
              {
              const char *name=strtok(kw+7, ":");
              const char *class=strtok(0, ":");
              const char *size=strtok(0, ":");

                     printf("<select name=\"%s\"", name ? name:"");
                     if (class)    printf(" class=\"%s\"", class);
                     if (size)     printf(" size=\"%s\"", size);
                     printf(">");
              }
              else if (strncmp(kw, "option:", 7) == 0)
              {
              const char *name=strtok(kw+7, ":");
              const char *cgivar=strtok(0, ":");
              const char *cgival=strtok(0, ":");

                     printf("<option value=\"%s\"", name ? name:"");
                     if (cgivar && cgival &&
                            strcmp(cgi(cgivar), cgival) == 0)
                            printf(" selected='selected'");
                     printf(">");
              }
              else if (strcmp(kw, "endoption") == 0)
                     printf("</option>");
              else if (strcmp(kw, "endselect") == 0)
                     printf("</select>");
              else if (strncmp(kw, "env:", 4) == 0) {
                     const char *val = getenv(kw+4);
                     if (val) output_attrencoded(val);
              }
              else if (strncmp(kw, "include:", 8) == 0)
              {
                     insert_include(kw+8);
              }
              else if (strcmp(kw, "endinclude") == 0)
              {
                     break;
              }
       }
}

Here is the caller graph for this function:

void doattach ( const char *  ,
const char *   
)

Definition at line 1067 of file attachments.c.

{
int    quotaflag=0;

       CHECKFILENAME(draft);
       if (*cgi("dodelete"))
       {
              if (!tokencheck())
              {
                     attach_delete(draft);
                     tokensave();
              }
       }
       else if (*cgi("upload"))
       {
              if (!tokencheck())
              {
                     quotaflag=attach_upload(draft, NULL, NULL);
                     tokensave();
              }
       }
       else if (*cgi("uppubkey") && libmail_gpg_has_gpg(GPGDIR) == 0)
       {
              if (!tokencheck())
              {
                     quotaflag=attach_upload(draft, cgi("pubkey"), NULL);
                     tokensave();
              }
       }
       else if (*cgi("upprivkey") && *cgi("really") &&
               libmail_gpg_has_gpg(GPGDIR) == 0)
       {
              if (!tokencheck())
              {
                     quotaflag=attach_upload(draft, NULL, cgi("privkey"));
                     tokensave();
              }
       }
       else if (*cgi("previewmsg"))
       {
              cgi_put("draft", draft);
              newmsg_do(folder);
              return;
       }
       else if (*cgi("sendmsg"))
       {
              cgi_put("draftmessage", draft);
              newmsg_do(folder);
              return;
       }
       else if (*cgi("savedraft"))
       {
              sendmsg_done();
              return;
       }

       if (quotaflag == -2)
        {
                http_redirect_argss(
                  "&form=attachments&pos=%s&draft=%s&error=limits",
                  cgi("pos"), draft);
        }
       else if (quotaflag == -3)
       {
                http_redirect_argss(
                  "&form=attachments&pos=%s&draft=%s&error=makemime",
                  cgi("pos"), draft);
       }
        else
        {
                http_redirect_argss(
                  (quotaflag ? "&form=attachments&pos=%s&draft=%s&error=quota":
                  "&form=attachments&pos=%s&draft=%s"), cgi("pos"),
                  draft);
        }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void doldapsearch ( )

Definition at line 231 of file ldaplist.c.

{
char   *f;
struct ldapabook *abooks[2];
const struct ldapabook *ptr;

       abooks[0]=ldapabook_read(LDAPADDRESSBOOK);
       abooks[1]=ldapabook_read(LOCALABOOK);

       ptr=ldapabook_find(abooks[0], cgi("ABOOK"));
       if (!ptr)
              ptr=ldapabook_find(abooks[1], cgi("ABOOK"));

       if (ptr && (f=getfilter()) != 0)
       {
              char   *tmpname=0;
              struct search_info si;
              struct maildir_tmpcreate_info createInfo;

              pref_setldap(ptr->name);
              printf("<pre>");
              fflush(stdout);


              si.fpw=NULL;
              si.errmsgbuf[0]=0;
              si.counter=0;

              maildir_tmpcreate_init(&createInfo);
              createInfo.uniq="ldap";
              createInfo.doordie=1;

              si.fpw=maildir_tmpcreate_fp(&createInfo);

              tmpname=createInfo.tmpname;
              createInfo.tmpname=NULL;
              maildir_tmpcreate_free(&createInfo);

              if (ldapabook_search(ptr, LDAPSEARCH, f, parsesearch,
                                 save_errmsg, &si) == 0)
              {
                     int    c;

                     printf("</pre>");

                     if (si.counter == 0)
                            printf("%s", getarg("NOTFOUND"));

                     printf("<table border=\"0\" cellpadding=\"4\">\n");
              
                     fflush(si.fpw);
                     rewind(si.fpw);
                     while ((c=getc(si.fpw)) != EOF)
                            putchar(c);

                     printf("<tr><td colspan=\"2\"><hr width=\"90%%\" />"
                            "<input type=\"hidden\" name=\"ADDYCNT\" value=\"%u\" />\n"
                            "</td></tr>\n", si.counter);
                     printf("<tr><td colspan=\"2\"><table>");

                     printf("<tr><td align=\"right\">%s</td><td>"
                            "<select name=\"nick1\"><option value=\"\"></option>\n", getarg("ADD"));
                     ab_listselect_fp(stdout);
                     printf("</select></td></tr>\n");
                     printf("<tr><td align=\"right\">%s</td><td>"
                            "<input type=\"text\" name=\"nick2\" /></td></tr>\n", getarg("CREATE"));
                     printf("<tr><td></td><td>"
                            "<input type=\"submit\" name=\"import\" value=\"%s\" /></td></tr>",
                            getarg("SUBMIT"));
                     printf("</table></td></tr></table>\n");
              }
              else if (si.errmsgbuf[0])
              {
                     output_attrencoded_oknl(si.errmsgbuf);
                     printf("</pre>");

              }
              fclose(si.fpw);

              if (tmpname)
              {
                     unlink(tmpname);
                     free(tmpname);
              }
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void error ( const char *  errmsg)

Definition at line 410 of file sqwebmail.c.

{
       cginocache();
       printf("Content-Type: text/html; charset=us-ascii\n\n"
              "<html><head><title>%s</title></head><body><h1>%s</h1></body></html>\n",
              errmsg, errmsg);
       cleanup();
       fake_exit(1);
}

Here is the call graph for this function:

void error2 ( const char *  file,
int  line 
)

Definition at line 420 of file sqwebmail.c.

{
       cginocache();
       printf("Content-Type: text/html; charset=us-ascii\n\n"
              "<html><head><title>Internal error</title></head><body>"
              "<h1>Internal error (module %s, line %d) - contact system administrator</h1>"
              "</body></html>\n",
              file, line);
       cleanup();
       fake_exit(1);
}

Here is the call graph for this function:

void error3 ( const char *  file,
int  line,
const char *  msg1,
const char *  msg2,
int  err 
)

Definition at line 432 of file sqwebmail.c.

{
       cginocache();
       if (err == -1) err = errno;
       printf("Content-Type: text/html; charset=us-ascii\n\n"
              "<html><head><title>Internal error</title></head><body>"
              "<h1>Internal error (module %s, line %d) - contact system administrator</h1>"
              "<pre>%s\n%s\n%s</pre>"
              "</body></html>\n",
              file, line, msg1?msg1:"", msg2?msg2:"", err?strerror(err):"");
       cleanup();
       fake_exit(1);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void fake_exit ( int  n)

Definition at line 192 of file sqwebmail.c.

Here is the call graph for this function:

Here is the caller graph for this function:

static void fix_xml_header ( FILE *  f) [static]

Definition at line 775 of file sqwebmail.c.

{
       char linebuf[80];

       /*
       ** Some templates now have an <?xml > header.  Adjust the
       ** encoding to match the selected default.  Yes, it's a dirty hack,
       ** and I'm proud of it, since it allows me to continue editing the
       ** HTML templates in Amaya.
       */

       if (fgets(linebuf, sizeof(linebuf), f) == NULL)
              return;

       if (strncasecmp(linebuf, "<?xml version=", 14) == 0)
              sprintf(linebuf, "<?xml version=\"1.0\" encoding=\"%s\"?>\n",
                     sqwebmail_content_charset);

       printf("%s", linebuf);
}

Here is the caller graph for this function:

void folder_cleanup ( )
char* get_imageurl ( )

Definition at line 457 of file sqwebmail.c.

{
char   *imageurl=getenv("SQWEBMAIL_IMAGEURL");
       
       if (!imageurl || !*imageurl)       imageurl=IMGPATH;

       return imageurl;
}

Here is the caller graph for this function:

char* get_templatedir ( )

Definition at line 447 of file sqwebmail.c.

{
char   *templatedir=getenv("SQWEBMAIL_TEMPLATEDIR");
       
       if (!templatedir || !*templatedir) templatedir=HTMLLIBDIR;

       return templatedir;
}

Here is the caller graph for this function:

size_t get_timeouthard ( )

Definition at line 179 of file sqwebmail.c.

{
       time_t n=TIMEOUTHARD;
       const char *p;

       p=getenv("SQWEBMAIL_TIMEOUTHARD");

       if (p && *p)
              n=atoi(p);

       return n;
}

Here is the caller graph for this function:

size_t get_timeoutsoft ( )

Definition at line 166 of file sqwebmail.c.

{
       time_t n=TIMEOUTSOFT;
       const char *p;

       p=getenv("SQWEBMAIL_TIMEOUTSOFT");

       if (p && *p)
              n=atoi(p);

       return n;
}

Here is the caller graph for this function:

static char* get_timezone ( ) [static]

Definition at line 696 of file sqwebmail.c.

{
       char *langptr=0;

       timezonefile(callback_get_timezone, &langptr);

       if (!langptr)
       {
              langptr=strdup("");
              if (!langptr)
                     enomem();
       }

       if (*langptr == 0)
       {
              free(langptr);
              langptr=strdup("*");
              if (!langptr)
                     enomem();
       }

       return(langptr);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void http_redirect_argss ( const char *  fmt,
const char *  arg1,
const char *  arg2 
)

Definition at line 1687 of file sqwebmail.c.

{
       http_redirect_argsss(fmt, arg1, arg2, "");
}

Here is the call graph for this function:

Here is the caller graph for this function:

void http_redirect_argsss ( const char *  fmt,
const char *  arg1,
const char *  arg2,
const char *  arg3 
)

Definition at line 1692 of file sqwebmail.c.

{
char *base=scriptptrget();
char *arg1s=cgiurlencode(arg1);
char *arg2s=cgiurlencode(arg2);
char *arg3s=cgiurlencode(arg3);
char *q;

       /* We generate a Location: redirected_url header.  The actual
       ** header is generated in cgiredirect, we just build it here */

       q=malloc(strlen(base)+strlen(fmt)+strlen(arg1s)+strlen(arg2s)+
                     strlen(arg3s)+1);
       if (!q)       enomem();
       strcpy(q, base);
       sprintf(q+strlen(q), fmt, arg1s, arg2s, arg3s);
       cgiredirect(q);
       free(q);
       free(arg1s);
       free(arg2s);
       free(arg3s);
       free(base);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void http_redirect_argu ( const char *  fmt,
unsigned long  un 
)

Definition at line 1679 of file sqwebmail.c.

{
char   buf[MAXLONGSIZE];

       sprintf(buf, "%lu", un);
       http_redirect_argss(fmt, buf, "");
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void http_redirect_top ( const char *  app) [static]

Definition at line 1666 of file sqwebmail.c.

{
const  char *p=nonloginscriptptr();
char   *buf=malloc(strlen(p)+strlen(app)+2);

       if (!buf)     enomem();
       strcat(strcpy(buf, p), app);
       cgiredirect(buf);
       free(buf);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void init_default_locale ( ) [static]

Definition at line 2029 of file sqwebmail.c.

{
char   *templatedir=get_templatedir();
char   *cl=http11_best_content_language(templatedir,
                     getenv("HTTP_ACCEPT_LANGUAGE"));

       sqwebmail_content_language=
                            http11_content_language(templatedir, cl);
       sqwebmail_content_locale=
                     http11_content_locale(templatedir, cl);
       sqwebmail_content_ispelldict=
                     http11_content_ispelldict(templatedir, cl);
       sqwebmail_content_charset=
                     http11_content_charset(templatedir, cl);

       free(cl);
#if    HAVE_LOCALE_H
#if    HAVE_SETLOCALE
       setlocale(LC_ALL, sqwebmail_content_locale);
#if    USE_LIBCHARSET
       setlocale(LC_CTYPE, sqwebmail_content_locale);
       sqwebmail_system_charset = locale_charset();
#elif  HAVE_LANGINFO_CODESET
       setlocale(LC_CTYPE, sqwebmail_content_locale);
       sqwebmail_system_charset = sys_locale_charset=strdup(nl_langinfo(CODESET));
#else
       sqwebmail_system_charset = NULL;
#endif /* USE_LIBCHARSET */
       setlocale(LC_CTYPE, "C");
       setlang();
#endif
#endif
}

Here is the call graph for this function:

Here is the caller graph for this function:

void insert_include ( const char *  inc_name)

Definition at line 919 of file sqwebmail.c.

{
       FILE *ff=openinclude(inc_name);
       do_output_form_loop(ff);
       do_close_form();
}

Here is the call graph for this function:

Here is the caller graph for this function:

int ishttps ( )

Definition at line 494 of file sqwebmail.c.

{
       const char *p=getenv("HTTPS");

       return (p && strcasecmp(p, "on") == 0);
}

Here is the caller graph for this function:

void ldaplist ( )

Definition at line 40 of file ldaplist.c.

{
struct ldapabook *abooks[2];
int    i;
struct ldapabook *p;
const char    *delabook=getarg("DELABOOK");
const char    *sysbook=getarg("SYSBOOK");

       if (!delabook)       delabook="";
       if (!sysbook) sysbook="";

       if (*cgi("addabook"))
       {
              struct ldapabook newbook;

              memset(&newbook, 0, sizeof(newbook));

              newbook.name=(char *)cgi("name");
              newbook.host=(char *)cgi("host");
              newbook.port=(char *)cgi("port");
              newbook.suffix=(char *)cgi("suffix");

              if (*newbook.name && *newbook.host &&
                     ldapabook_add(LOCALABOOK, &newbook) < 0)
              {
                     printf("<pre>\n");
                     perror("ldapabook_add");
                     printf("</pre>\n");
              }
       }

       if (*cgi("delabook"))
       {
              struct maildir_tmpcreate_info createInfo;
              int fd;
              maildir_tmpcreate_init(&createInfo);

              createInfo.uniq="abook";

              if ((fd=maildir_tmpcreate_fd(&createInfo)) >= 0)
              {
                     close(fd);
                     unlink(createInfo.tmpname);
                     ldapabook_del(LOCALABOOK, createInfo.tmpname,
                                  cgi("ABOOK"));
                     maildir_tmpcreate_free(&createInfo);
              }
       }

       abooks[0]=ldapabook_read(LDAPADDRESSBOOK);
       abooks[1]=ldapabook_read(LOCALABOOK);

       printf("<table border=\"0\" cellpadding=\"8\" width=\"100%%\">\n");
       for (i=0; i<2; i++)
       {
              for (p=abooks[i]; p; p=p->next)
              {
                     printf("<tr valign=\"top\"><td align=\"right\">");
                     printf("<input type=\"radio\" name=\"ABOOK\"");

                     if (pref_ldap && strcmp(pref_ldap, p->name) == 0)
                            printf(" checked=\"checked\"");

                     printf(" value=\"");
                     output_attrencoded(p->name);
                     printf("\" /></td><td><font size=\"+1\""
                            " class=\"ldaplist-name\">%s</font><br />"
                            "&nbsp;&nbsp;&nbsp;<span class=\"tt\"><font size=\"-2\""
                            " class=\"ldaplist-ldapurl\">ldap://", p->name);
                     if (*p->binddn || *p->bindpw)
                     {
                            printf("%s", p->binddn);
                            if (*p->bindpw)
                                   printf(":%s", p->bindpw);
                            printf("@");
                     }
                     printf("%s", p->host);
                     if (atoi(p->port) != 389)
                            printf(":%s", p->port);
                     if (*p->suffix)
                     {
                     char   *q;

                            printf("/");
                            q=cgiurlencode_noeq(p->suffix);
                            if (q)
                            {
                                   printf("%s", q);
                                   free(q);
                            }
                     }
                     printf("</font></span>%s</td></tr>",
                            i ? "":sysbook);
              }
       }

       if (abooks[1])
       {
              printf("<tr><td></td><td>");
              printf("<input type=\"submit\" name=\"delabook\" value=\"%s\" />",
                            delabook);
              printf("</td></tr>\n");
       }
       printf("</table>\n");
       ldapabook_free(abooks[0]);
       ldapabook_free(abooks[1]);
}

Here is the call graph for this function:

Here is the caller graph for this function:

int ldapsearch ( )

Definition at line 169 of file ldaplist.c.

{
       char *p;

       if (*cgi("ABOOK") == 0) return (-1);

       if ((p=getfilter()) == NULL)
              return -1;
       free(p);
       return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void maildir_cleanup ( )

Definition at line 3881 of file maildir.c.

{
       closedb();
}

Here is the call graph for this function:

Definition at line 691 of file mailfilter.c.

{
       internal_err=0;
}

Here is the caller graph for this function:

int main ( int  argc,
char **  argv 
)

Definition at line 2164 of file sqwebmail.c.

{
       const char *prefork;
       int n;

#if 0
       if (getenv("SQWEBMAIL_DEBUG"))
       {
              main2();
              return (0);
       }
#endif

       courier_authdebug_login_init();

       if (argc > 1)
              usage();

       prefork=getenv("SQWEBMAIL_PREFORK");

       n=prefork ? atoi(prefork):5;

       cgi_daemon(n, SOCKFILENAME, NULL, call_main2, NULL);

       return (0);
}

Here is the call graph for this function:

static void main2 ( ) [static]

Definition at line 2210 of file sqwebmail.c.

{
const char    *u;
const char    *ip_addr;
char   *pi;
char   *pi_malloced;
int    reset_cookie=0;
time_t timeouthard=get_timeouthard();


#ifdef GZIP
       gzip_save_fd= -1;
#endif
       u=ip_addr=pi=NULL;

       ip_addr=getenv("REMOTE_ADDR");

#if 0
       {
              FILE *f;

              f=fopen("/tmp/pid", "w");
              fprintf(f, "%d\n", (int)getpid());
              fclose(f);
              sleep(10);
       }
#endif

       /*
        * Note: if we get a signal during FastCGI processing, this means
        * means we need to terminate so that the webserver can respawn us.
        * Exception is SIGPIPE which we just ignore (this is what we get
        * if we try to write data to a client which goes away before
        * we finished sending them the reply)
        */

       signal(SIGHUP, catch_sig);
       signal(SIGINT, catch_sig);
       signal(SIGPIPE, catch_sig);
       signal(SIGTERM, catch_sig);

       if (!ip_addr) ip_addr="127.0.0.1";

       umask(0077);

       {
              timeouthard=get_timeouthard();
       }

       if (maildir_cache_init(timeouthard, CACHEDIR, CACHEOWNER, authvars))
       {
              printf("Content-Type: text/plain\n\nmaildir_cache_init() failed\n");
              fake_exit(0);
       }

       pi=getenv("PATH_INFO");

       pi_malloced=0;
       sqpcp_init();

       if (pi && strncmp(pi, "/printmsg/", 10) == 0)
       {
              /* See comment in output_user_form */

              pi_malloced=pi=cgi_cookie("sqwebmail-pi");
              if (*pi_malloced == 0)
              {
                     free(pi_malloced);
                     setgid(getgid());
                     setuid(getuid());
                     output_form("printnocookie.html");
                     return;
              }
              reset_cookie=1;
              cgi_setcookie("sqwebmail-pi", "DELETED");
       }

       if (pi && strncmp(pi, "/login/", 7) == 0)
       {
       const char    *p;
       time_t last_time, current_time;
       char   *q;
       time_t timeoutsoft=get_timeoutsoft();

              /* Logging into the mailbox */

              pi=strdup(pi);
              if (pi_malloced)     free(pi_malloced);

              if (!pi)      enomem();

              (void)strtok(pi, "/");      /* Skip login */
              u=strtok(NULL, "/"); /* mailboxid */
              sqwebmail_sessiontoken=strtok(NULL, "/"); /* sessiontoken */
              q=strtok(NULL, "/"); /* login time */
              login_time=0;
              while (q && *q >= '0' && *q <= '9')
                     login_time=login_time * 10 + (*q++ - '0');

              if (maildir_cache_search(u, login_time, setuidgid, NULL)
                  && prelogin(u))
              {
                     free(pi);
                     error("Unable to access your mailbox, sqwebmail permissions may be wrong.");
              }

              time(&current_time);

              /* Ok, boys and girls, time to validate the connection as
              ** follows */

              if (   !sqwebmail_sessiontoken

              /* 1. Read IPFILE.  Check that it's timestamp is current enough,
              ** and the session hasn't timed out.
              */

                     || !(p=read_sqconfig(".", IPFILE, &last_time))

/*                   || last_time > current_time */

                     || last_time + timeouthard < current_time

              /* 2. IPFILE will contain seven words - IP address, session
              ** token, language, locale, ispell dictionary,
              ** timezone, charset.  Validate both.
              */
                     || !(q=strdup(p))
                     || !(p=strtok(q, " "))
                     || (strcmp(p, ip_addr) && strcmp(p, "none"))
                     || !(p=strtok(NULL, " "))
                     || strcmp(p, sqwebmail_sessiontoken)
                     || !(p=strtok(NULL, " "))
                     || !(sqwebmail_content_language=strdup(p))
                     || !(p=strtok(NULL, " "))
                     || !(sqwebmail_content_locale=strdup(p))
                     || !(p=strtok(NULL, " "))
                     || !(sqwebmail_content_ispelldict=strdup(p))
                     || !(p=strtok(NULL, " "))
                     || set_timezone(p)
                     || !(p=strtok(NULL, " "))
                     || !(sqwebmail_content_charset=strdup(p))

              /* 3. Check the timestamp on the TIMESTAMP file.  See if the
              ** session has reached its soft timeout.
              */

                     || !read_sqconfig(".", TIMESTAMP, &last_time)

/*                   || last_time > current_time */

                     || last_time + timeoutsoft < current_time)
              {
                     setgid(getgid());
                     setuid(getuid());    /* Drop root prevs */
                     if (chdir("/") < 0)
                     {
                            output_form("expired.html");
                            return;
                     }
                     cgi_setup();
                     init_default_locale();
                     free(pi);

                     u=getenv("SQWEBMAIL_SHAREDMUNGENAMES");

                     maildir_info_munge_complex(u && *u);

                     if (strcmp(cgi("form"), "logout") == 0)
                            /* Already logged out, and the link
                            ** had target=_parent tag.
                            */
                     {
                            http_redirect_top("");
                            return;
                     }
                     output_form("expired.html");
                     return;
              }
              free(q);
              cgiformdatatempdir("tmp");
              cgi_setup();  /* Read CGI environment */
              if (reset_cookie)
                     cgi_put("setcookie", "0");

              /* Update soft timeout stamp */

              write_sqconfig(".", TIMESTAMP, "");

              /* We must always have the folder CGI arg */

              if (!*(sqwebmail_folder=cgi("folder")))
              {
                     init_default_locale();
                     output_form("expired.html");
                     free(pi);
                     return;
              }

              sqwebmail_mailboxid=u;

              {
                     struct stat stat_buf;

                     if (stat(".", &stat_buf) < 0)
                     {
                            output_form("expired.html");
                            free(pi);
                            return;
                     }

                     sqwebmail_homedir_dev=stat_buf.st_dev;
                     sqwebmail_homedir_ino=stat_buf.st_ino;
              }

#if    HAVE_LOCALE_H
#if    HAVE_SETLOCALE
              setlocale(LC_ALL, sqwebmail_content_locale);
#if    USE_LIBCHARSET
              setlocale(LC_CTYPE, sqwebmail_content_locale);
              sqwebmail_system_charset = locale_charset();
#elif  HAVE_LANGINFO_CODESET
              setlocale(LC_CTYPE, sqwebmail_content_locale);
              sqwebmail_system_charset = sys_locale_charset
                     = strdup(nl_langinfo(CODESET));
#else
              sqwebmail_system_charset = NULL;
#endif  /* USE_LIBCHARSET */
              setlocale(LC_CTYPE, "C");
              setlang();
#endif
#endif
              CHECKFILENAME(sqwebmail_folder);

              strcpy(sqwebmail_folder_rights, ALL_RIGHTS);
              acl_computeRightsOnFolder(sqwebmail_folder,
                                     sqwebmail_folder_rights);

              pref_init();
              (void)sqpcp_loggedin();
              if (auth_getoptionenvint("disableshared"))
              {
                     maildir_acl_disabled=1;
                     maildir_newshared_disabled=1;
              }

              if (strcmp(cgi("form"), "empty"))
              {
                     if (*cgi("refresh"))
                     {
                            printf("Refresh: %ld; URL=",
                                   (long)get_timeoutsoft()/2);
                            output_scriptptrget();
                            printf("&empty=1&refresh=1\n");
                     }
              }

              output_user_form(cgi("form"));
              free(pi);
       }
       else
              /* Must be one of those special forms */
       {
       char   *rm;
       long   n;

              if (pi_malloced)     free(pi_malloced);

              if ((rm=getenv("REQUEST_METHOD")) == 0 ||
                     (strcmp(rm, "POST") == 0 &&
                            ((rm=getenv("CONTENT_TYPE")) != 0 &&
                            strncasecmp(rm,"multipart/form-data;", 20)
                                   == 0)))
                     emsg("multipart/formdata posts not allowed","");

              /* Some additional safety checks */

              rm=getenv("CONTENT_LENGTH");
              n= rm ? atol(rm):0;
              if (n < 0 || n > 256)       enomem();

              cgi_setup();
              init_default_locale();

              if (*(u=trim_spaces(cgi("username"))))
                     /* Request to log in */
              {
              const char *p=cgi("password");
              const char *mailboxid;
              const char *u2=cgi("logindomain");
              char   *ubuf=malloc(strlen(u)+strlen(u2)+2);

                     if (ubuf == NULL) enomem();
                     strcpy(ubuf, u);
                     if (*u2)
                            strcat(strcat(ubuf, "@"), u2);

                     maildir_cache_start();

                     if (*p && (mailboxid=do_login(ubuf, p, ip_addr))
                         != 0)
                     {
                            char   *q;
                            const  char *saveip=ip_addr;
                            char   *tz;

                            sqwebmail_mailboxid=mailboxid;
                            sqwebmail_folder="INBOX";
                            sqwebmail_sessiontoken=random128();

                            tz=get_timezone();
                            if (*cgi("sameip") == 0)
                                   saveip="none";

                            q=malloc(strlen(saveip)
                                    +strlen(sqwebmail_sessiontoken)
                                    +strlen(sqwebmail_content_language)
                                    +strlen(sqwebmail_content_ispelldict)
                                    +strlen(sqwebmail_content_charset)
                                    +strlen(tz)
                                    +strlen(sqwebmail_content_locale)+7);
                            if (!q)       enomem();
                            sprintf(q, "%s %s %s %s %s %s %s", saveip,
                                   sqwebmail_sessiontoken,
                                   sqwebmail_content_language,
                                   sqwebmail_content_locale,
                                   sqwebmail_content_ispelldict,
                                   tz,
                                   sqwebmail_content_charset);
                            write_sqconfig(".", IPFILE, q);
                            free(q);
                            free(tz);
                            time(&login_time);
                            {
                                   char buf[1024];

                                   buf[sizeof(buf)-1]=0;
                                   if (getcwd(buf, sizeof(buf)-1) == 0)
                                   {
                                          fprintf(stderr,
                                                 "CRIT: getcwd() failed: %s\n",strerror(errno));
                                          fake_exit(1);
                                   } /* oops */

                                   maildir_cache_save(mailboxid,
                                                    login_time,
                                                    buf,
                                                    geteuid(), getegid()
                                                    );

                            }
                            write_sqconfig(".", TIMESTAMP, "");
#if    HAVE_LOCALE_H
#if    HAVE_SETLOCALE
                            setlocale(LC_ALL, sqwebmail_content_locale);
#if    USE_LIBCHARSET
                            setlocale(LC_CTYPE, sqwebmail_content_locale);
                            sqwebmail_system_charset = locale_charset();
#elif  HAVE_LANGINFO_CODESET
                            setlocale(LC_CTYPE, sqwebmail_content_locale);

                            sqwebmail_system_charset = sys_locale_charset
                                   = strdup(nl_langinfo(CODESET));
#else
                            sqwebmail_system_charset = NULL;
#endif /* USE_LIBCHARSET */
                            setlocale(LC_CTYPE, "C");
                            setlang();
#endif
#endif
                            pref_init();
                            (void)maildir_create(INBOX "." DRAFTS);

                            if (!pref_noautorenamesent)
                                   (void)rename_sent_folder(1);
                            (void)maildir_create(INBOX "." SENT);
                            (void)maildir_create(INBOX "." TRASH);
                            maildir_autopurge();
                            unlink(SHAREDPATHCACHE);

                            sqpcp_login(ubuf, p);
                            maildir_acl_reset(".");

                            http_redirect_argss(*cgi("inpublic") ?
                                              "&form=folders":
                                              "&form=refreshfr", "", "");
                            free(ubuf);
                            return;
                     }
                     maildir_cache_cancel();

                     free(ubuf);
                     setgid(getgid());
                     setuid(getuid());
                     output_form("invalid.html");       /* Invalid login */
                     return;
              }

              setgid(getgid());
              setuid(getuid());
              if ( *(u=cgi("redirect")))
                     /* Redirection request to hide the referral tag */
              {
                     redirect(u);
              }
              else if ( *cgi("noframes") == '1')
                     output_form("login.html");  /* Main frame */
              else
              if ( *cgi("empty") == '1')
              {
                     output_form("empty.html");  /* Minor frameset */
              }

/*
** Apparently we can't show just SCRIPT NAME as our frameset due to some
** weird bug in Communicator which, under certain conditions, will get
** confused figuring out which page views have expired.  POSTs with URLs
** referring to SCRIPT_NAME will be replied with an expiration header, and
** Communicator will assume that index.html also has expired, forcing a
** frameset reload the next time the Communicator window is resized,
** essentially logging the user off.
*/

              else if (*cgi("index") == '1')
                     output_form("index.html");  /* Frameset Window */
              else
              {
                     http_redirect_top("?index=1");
              }
                            
              return;
       }
       return;
}

Here is the caller graph for this function:

int nochangepass ( )

Definition at line 183 of file auth.c.

{
       if (auth_getoptionenvint("wbnochangepass")) return 1;
       if (access(SQWEBPASSWD, X_OK)) return 1;
       return 0;
}

Here is the caller graph for this function:

const char* nonloginscriptptr ( )

Definition at line 300 of file sqwebmail.c.

{
#if    USE_HTTPS
       return (cgihttpsscriptptr());
#elif  USE_RELATIVE_URL
       return (cgirelscriptptr());
#else
       return (cgihttpscriptptr());
#endif
}

Here is the call graph for this function:

Here is the caller graph for this function:

FILE* open_langform ( const char *  lang,
const char *  formname,
int  print_header 
)

Definition at line 467 of file sqwebmail.c.

{
char   *formpath;
FILE   *f;
char   *templatedir=get_templatedir();
       
       /* templatedir/lang/formname */

       if (!(formpath=malloc(strlen(templatedir)+3+
              strlen(lang)+strlen(formname))))
              error("Out of memory.");

       strcat(strcat(strcat(strcat(strcpy(formpath, templatedir), "/"),
              lang), "/"), formname);

       f=fopen(formpath, "r");

       free(formpath);
       
       if (f && print_header)
              printf("Content-Language: %s\n", lang);
       if (f)
              fcntl(fileno(f), F_SETFD, FD_CLOEXEC);
       return (f);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static FILE * openinclude ( const char *  p) [static]

Definition at line 1634 of file sqwebmail.c.

{
       char buffer[BUFSIZ];
       FILE *f;

       buffer[0]=0;
       strncat(buffer, p, 100);
       strcat(buffer, ".inc.html");

       f=do_open_form(buffer, 0);

       if (!f)
              error("Can't open form template.");

       while (fgets(buffer, sizeof(buffer), f))
       {
              const char *p=strchr(buffer, '[');

              if (!p)
                     continue;

              if (strncmp(p, "[#begininclude#]", 16) == 0)
              {
                     break;
              }
       }
       return (f);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void output_attrencoded ( const char *  p)

Definition at line 259 of file sqwebmail.c.

{
       output_attrencoded_fp(p, stdout);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void output_attrencoded_fp ( const char *  p,
FILE *  fp 
)

Definition at line 254 of file sqwebmail.c.

{
       print_attrencodedlen(p, strlen(p), 0, fp);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void output_attrencoded_nltobr ( const char *  p)

Definition at line 274 of file sqwebmail.c.

{
       print_attrencodedlen(p, strlen(p), 2, stdout);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void output_attrencoded_oknl ( const char *  p)

Definition at line 269 of file sqwebmail.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void output_attrencoded_oknl_fp ( const char *  p,
FILE *  fp 
)

Definition at line 264 of file sqwebmail.c.

{
       print_attrencodedlen(p, strlen(p), 1, fp);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void output_form ( const char *  formname)

Definition at line 796 of file sqwebmail.c.

{
       FILE   *f;

#ifdef GZIP
       int    dogzip;
       int    pipefd[2];
       pid_t  pid= -1;
#endif

       noimages= auth_getoptionenvint("wbnoimages");

       f=do_open_form(formname, 1);

       sqwebmail_formname=formname;

       if (!f)       error("Can't open form template.");

       /*
       ** Except for the dummy frame window (and the tiny empty frame),
       ** and the window containing the print preview of the message,
       ** expire everything.
       */

       if (strcmp(formname, "index.html") && strcmp(formname, "empty.html") &&
              strcmp(formname, "print.html"))
              cginocache();

#ifdef GZIP

       dogzip=0;
       if (strcmp(formname, "readmsg.html") == 0 ||
           strcmp(formname, "folder.html") == 0 ||
           strcmp(formname, "folders.html") == 0 ||
           strcmp(formname, "gpg.html") == 0)
       {
       const char *p=getenv("HTTP_ACCEPT_ENCODING");

              if (p)
              {
              char   *q=strdup(p), *r;

                     if (!q)       enomem();
                     for (r=q; *r; r++)
                            *r= tolower((int)(unsigned char)*r);
                     for (r=q; (r=strtok(r, ", ")) != 0; r=0)
                            if (strcmp(r, "gzip") == 0)
                            {
                                   dogzip=1;
                                   if (pipe(pipefd))
                                          enomem();
                            }
                     free(q);
              }
       }
#endif

       /* Do not send a Vary header for attachment downloads */

       if (*cgi("download") == 0)
              printf("Vary: Accept-Language\n");

#ifdef GZIP
       if (dogzip)
              printf("Content-Encoding: gzip\n");
#endif

       printf("Content-Type: text/html");

       if (sqwebmail_content_charset)
              printf("; charset=%s", sqwebmail_content_charset);

       printf("\n\n");

#ifdef GZIP
       if (dogzip)
       {
              fflush(stdout);
              while ((pid=fork()) == -1)
                     sleep(5);
              if (pid == 0)
              {
                     dup2(pipefd[0], 0);
                     close(pipefd[0]);
                     close(pipefd[1]);
                     execl(GZIP, "gzip", "-c", (char *)0);
                     fprintf(stderr, 
                            "ERR: Cannot execute " GZIP ": %s\n",
                            strerror(errno));
                     exit(1);
              }

              gzip_save_fd=dup(1);
              dup2(pipefd[1], 1);
              close(pipefd[1]);
              close(pipefd[0]);
       }
#endif
       fix_xml_header(f);
       do_output_form_loop(f);
       do_close_form();

#ifdef GZIP
       if (pid > 0)
       {
       int    waitstat;
       pid_t  p2;

              /* Restore original stdout */

              fflush(stdout);
              dup2(gzip_save_fd, 1);
              close(gzip_save_fd);
              gzip_save_fd= -1;
              while ((p2=wait(&waitstat)) >= 0 && p2 != pid)
                     ;
       }
#endif
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void output_image ( FILE *  f,
void(*)(int, void *)  output_func,
void *  void_arg 
) [static]

Definition at line 523 of file sqwebmail.c.

{
       int c;

       /*
         Conditional image.  It's formatted as follows:

         @@filename,width=x height=y@text@
            ^
            |
           ----- we're at this point now.

         If images are enabled, we replace that with an IMG tag we build from
         filename,width=x, height=y.
         If images are disabled, we replace all of this with text.

       */

#define       MKIMG(c)      (*output_func)((c), void_arg)

       if (noimages)
       {
              while ((c=getc(f)) >= 0
                     && c != '@')
                     ;
              while ((c=getc(f)) >= 0
                     && c != '@')
                     MKIMG(c);
       }
       else
       {
              char   *p;

              MKIMG('<');
              MKIMG('i');
              MKIMG('m');
              MKIMG('g');
              MKIMG(' ');
              MKIMG('s');
              MKIMG('r');
              MKIMG('c');
              MKIMG('=');
              MKIMG('"');
              for (p=get_imageurl(); *p; p++)
                     MKIMG(*p);

              MKIMG('/');
              while ((c=getc(f)) >= 0
                     && c != '@' && c != ',')
                     MKIMG(c);
              MKIMG('"');
              MKIMG(' ');
              if (c == ',')
                     c=getc(f);
              while (c >= 0 && c != '@')
              {
                     MKIMG(c);
                     c=getc(f);
              }
              while ((c=getc(f)) >= 0 && c != '@')
                     ;
              MKIMG(' ');
              MKIMG('/');
              MKIMG('>');
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 287 of file sqwebmail.c.

{
#if    USE_HTTPS_LOGIN
const  char *p=cgihttpsscriptptr();
#elif  USE_RELATIVE_URL
const  char *p=cgirelscriptptr();
#else
const  char *p=cgihttpscriptptr();
#endif

       printf("%s", p);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 329 of file sqwebmail.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void output_scriptptr ( )

Definition at line 312 of file sqwebmail.c.

{
const  char *p=nonloginscriptptr();

       printf("%s", p);
       if (sqwebmail_mailboxid)
       {
       char   *q=cgiurlencode(sqwebmail_mailboxid);
       char   buf[NUMBUFSIZE];

              printf("/login/%s/%s/%s", q,
                     sqwebmail_sessiontoken ?  sqwebmail_sessiontoken:" ",
                     libmail_str_time_t(login_time, buf));
              free(q);
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 384 of file sqwebmail.c.

{
char   *p=scriptptrget();

       printf("%s", p);
       free(p);
       return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 393 of file sqwebmail.c.

{
       if (sqwebmail_folder)
       {
              printf("<input type=\"hidden\" name=\"folder\" value=\"");
              output_attrencoded(sqwebmail_folder);
              printf("\" />");
       }

       if (*cgi("folderdir"))      /* In folders.html */
       {
              printf("<input type=\"hidden\" name=\"folderdir\" value=\"");
              output_attrencoded(cgi("folderdir"));
              printf("\" />");
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void output_urlencoded ( const char *  p)

Definition at line 279 of file sqwebmail.c.

{
char   *q=cgiurlencode(p);

       printf("%s", q);
       free(q);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void output_user_form ( const char *  formname)

Definition at line 1717 of file sqwebmail.c.

{
char   *p;

       if (!*formname || strchr(formname, '.') || strchr(formname, '/'))
              error("Invalid request.");

       if ((strcmp(formname, "filter") == 0
            || strcmp(formname, "autoresponse") == 0)
           && maildir_filter_hasmaildirfilter("."))
              /* Script kiddies... */
              formname="nofilter";

       if (strcmp(formname, "filter") == 0 && *cgi("do.submitfilter"))
              mailfilter_submit();

       if (strcmp(formname, "gpg") == 0 && libmail_gpg_has_gpg(GPGDIR))
              error("Invalid request.");

       if (strcmp(formname, "gpgcreate") == 0 && libmail_gpg_has_gpg(GPGDIR))
              error("Invalid request.");

       if (*cgi("ldapsearch"))     /* Special voodoo for LDAP address book stuff */
       {
              if (ldapsearch() == 0)
              {
                     output_form("ldapsearch.html");
                     return;
              }
       }

       /*
       ** In order to hide the session ID in the URL of the message what
       ** we do is that the initial URL, that contains setcookie=1, results
       ** in us setting a temporary cookie that contains the session ID,
       ** then we return a redirect to a url which has /printmsg/ in the
       ** PATH_INFO, instead of the session ID.  The code in main()
       ** traps /printmsg/ PATH_INFO, fetches the path info from the
       ** cookie, and punts after resetting setcookie to 0.
       */

       if (strcmp(formname, "print") == 0 && *cgi("setcookie") == '1')
       {
       const char *qs=getenv("QUERY_STRING");
       const char *pi=getenv("PATH_INFO");
       const char *nl;
       char   *buf;

              if (!pi)      pi="";
              if (!pi)      pi="";

              nl=nonloginscriptptr();

              buf=malloc(strlen(nl) + sizeof("/printmsg/print?")+strlen(qs));
              if (!buf)     enomem();
              strcat(strcat(strcpy(buf, nl), "/printmsg/print?"), qs);
              cginocache();
              cgi_setcookie("sqwebmail-pi", pi);
              printf("Refresh: 0; URL=%s\n", buf);
              free(buf);
              output_form("printredirect.html");
              return;
       }

       if (strcmp(cgi("fromscreen"), "mailfilter") == 0)
              maildir_filter_endmaildirfilter(".");     /* Remove the temp file */

       if (strcmp(formname, "logout") == 0)
       {
              unlink(IPFILE);
              http_redirect_top("");
              return;
       }

       if (strcmp(formname, "fetch") == 0)
       {
              folder_download( sqwebmail_folder, atol(cgi("pos")),
                     cgi("mimeid") );
              return;
       }

       if (strcmp(formname, "delmsg") == 0)
       {
              folder_delmsg( atol(cgi("pos")));
              return;
       }

       if (strcmp(formname, "donewmsg") == 0)
       {
              newmsg_do(sqwebmail_folder);
              return;
       }

       if (strcmp(formname, "doattach") == 0)
       {
              doattach(sqwebmail_folder, cgi("draft"));
              return;
       }

       if (strcmp(formname, "folderdel") == 0)
       {
              folder_delmsgs(sqwebmail_folder, atol(cgi("pos")));
              return;
       }
       if (strcmp(formname, "spellchk") == 0)
       {
#ifdef ISPELL
              spell_check_continue();
#else
              printf("Status: 404");
#endif
              return;
       }

       if (sqpcp_loggedin())
       {
              if (*cgi("do.neweventpreview"))
              {
                     sqpcp_preview();
                     return;
              }

              if (*cgi("do.neweventsave"))
              {
                     sqpcp_save();
                     return;
              }

              if (*cgi("do.neweventpostpone"))
              {
                     sqpcp_postpone();
                     return;
              }

              if (*cgi("do.neweventdeleteattach"))
              {
                     sqpcp_deleteattach();
                     return;
              }

              if (*cgi("do.neweventupload"))
              {
                     sqpcp_uploadattach();
                     return;
              }

              if (*cgi("do.neweventuppubkey"))
              {
                     sqpcp_attachpubkey();
                     return;
              }

              if (*cgi("do.neweventupprivkey"))
              {
                     sqpcp_attachprivkey();
                     return;
              }
              if (*cgi("do.eventdelete"))
              {
                     sqpcp_dodelete();
                     return;
              }
       }

       if (strcmp(formname, "event-edit") == 0)
       {
              formname="folders";
              if (sqpcp_loggedin())
              {
                     formname="eventshow";       /* default */
                     if (sqpcp_eventedit() == 0)
                            formname="newevent";
              }
       }


       if (strcmp(formname, "open-draft") == 0)
       {
              formname="newmsg";
              if (sqpcp_has_calendar())
                     /* DRAFTS may contain event files */
              {
                     const char *n=cgi("draft");
                     char *filename;
                     FILE *fp;

                     CHECKFILENAME(n);

                     filename=maildir_find(INBOX "." DRAFTS, n);

                     if (filename)
                     {
                            if ((fp=fopen(filename, "r")) != NULL)
                            {
                                   struct rfc822hdr h;

                                   rfc822hdr_init(&h, 8192);

                                   while (rfc822hdr_read(&h, fp, NULL, 0)
                                          == 0)
                                   {
                                          if (strcasecmp(h.header,
                                                        "X-Event") == 0)
                                          {
                                                 formname="newevent";
                                                 cgi_put("draftmessage",
                                                        cgi("draft"));
                                                 break;
                                          }
                                   }
                                   rfc822hdr_free(&h);
                                   fclose(fp);
                            }
                            free(filename);
                     }
              }
       }

       if (strcmp(formname, "newevent") == 0 ||
           strcmp(formname, "eventdaily") == 0 ||
           strcmp(formname, "eventweekly") == 0 ||
           strcmp(formname, "eventmonthly") == 0 ||
           strcmp(formname, "eventshow") == 0 ||
           strcmp(formname, "eventacl") == 0)
       {
              if (!sqpcp_has_calendar() ||
                  !sqpcp_loggedin())
                     formname="folders";  /* Naughty boy */
       }

       if (*cgi("do.search"))
       {
              folder_search(sqwebmail_folder, atol(cgi("pos")));
              return;
       }
       p=malloc(strlen(formname)+6);
       if (!p)       enomem();

       strcat(strcpy(p, formname),".html");
       output_form(p);
       free(p);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void pass_image_through ( int  c,
void *  p 
) [static]

Definition at line 518 of file sqwebmail.c.

{
       putchar(c);
}

Here is the caller graph for this function:

void print_attrencodedlen ( const char *  p,
size_t  len,
int  oknl,
FILE *  fp 
)

Definition at line 215 of file sqwebmail.c.

{
       for (; len; p++, --len)
       {
              switch (*p)   {
              case '<':
                     fprintf(fp, "&lt;");
                     continue;
              case '>':
                     fprintf(fp, "&gt;");
                     continue;
              case '&':
                     fprintf(fp, "&amp;");
                     continue;
              case '"':
                     fprintf(fp, "&quot;");
                     continue;
              case '\n':
                     if (oknl)
                     {
                            if (oknl == 2)
                            {
                                   fprintf(fp, "<br />");
                                   continue;
                            }
                            putc('\n', fp);
                            continue;
                     }
              default:
                     if (!ISCTRL(*p))
                     {
                            putc(*p, fp);
                            continue;
                     }
              }
              fprintf(fp, "&#%d;", (int)(unsigned char)*p);
       }
}

Here is the caller graph for this function:

void print_safe ( const char *  )

Definition at line 150 of file folder.c.

Here is the call graph for this function:

static void redirect ( const char *  url) [static]

Definition at line 2112 of file sqwebmail.c.

{
       if (valid_redirect())
       {
              printf("Refresh: 0; URL=%s\n", url);
              output_form("redirect.html");
              return;
       }

       printf("Content-Type: text/plain\n\n"
              "The URL you clicked on is no longer valid.\n");
       return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

const char* redirect_hash ( const char *  )

Definition at line 2060 of file folder.c.

{
       struct stat stat_buf;

       char buffer[NUMBUFSIZE*2+10];
       const char *p=getenv("SQWEBMAIL_RANDSEED");

       if (strlen(timestamp) >= NUMBUFSIZE)
              return "";

       strcat(strcpy(buffer, timestamp), " ");

       if (p && *p)
              strncat(buffer, p, NUMBUFSIZE);
       else
       {
              if (stat(SENDITSH, &stat_buf) < 0)
                     return "";

              libmail_str_ino_t(stat_buf.st_ino, buffer+strlen(buffer));
       }

       return md5_hash_courier(buffer);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void rename_sent_folder ( int  really)

Definition at line 2063 of file sqwebmail.c.

{
       char buf[128];
       char yyyymm[128];
       const char *yyyymmp;

       time_t t;
       struct tm *tm;
       char *pp;

       if (really)
              (void)maildir_create(INBOX "." SENT); /* No matter what */

       time(&t);
       tm=localtime(&t);
       if (!tm)
              return;

       if (tm->tm_mon == 0)
       {
              tm->tm_mon=11;
              --tm->tm_year;
       }
       else
              --tm->tm_mon;

       if (strftime (yyyymm, sizeof(yyyymm), "%Y%m", tm) == 0)
              return;

       if ((yyyymmp=read_sqconfig(".", SENTSTAMP, NULL)) != NULL &&
           strcmp(yyyymm, yyyymmp) == 0)
              return;

       if (strftime (buf, sizeof(buf), "." SENT ".%Y.%m-%b", tm) == 0)
              return;

       pp=folder_toutf7(buf);

       if (really)
              rename("." SENT, pp);
       free(pp);
       if (really)
              (void)maildir_create(INBOX "." SENT);

       write_sqconfig(".", SENTSTAMP, yyyymm);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void rfc2045_error ( const char *  p)

Definition at line 210 of file sqwebmail.c.

{
       error(p);
}

Here is the call graph for this function:

char* scriptptrget ( )

Definition at line 344 of file sqwebmail.c.

{
char   *q=0;
size_t l=0;
int    i;
char   buf[NUMBUFSIZE];

#define       ADD(s) {const char *zz=(s); if (i) strcat(q, zz); l += strlen(zz);}
#define ADDE(ue) { char *yy=cgiurlencode(ue); ADD(yy); free(yy); }

       for (i=0; i<2; i++)
       {
              if (i && (q=malloc(l+1)) == 0)     enomem();
              if (i) *q=0;
              ADD( nonloginscriptptr() );
              if (!sqwebmail_mailboxid)
              {
                     ADD("?");
                     continue;
              }

              ADD("/login/");
              ADDE(sqwebmail_mailboxid);
              ADD("/");
              ADD(sqwebmail_sessiontoken ? sqwebmail_sessiontoken:" ");
              ADD("/");
              ADD(libmail_str_time_t(login_time, buf));

              ADD( "?" );
              if (sqwebmail_folder)
              {
                     ADD("folder=");
                     ADDE(sqwebmail_folder);
              }
       }
#undef ADD
#undef ADDE
       return (q);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 658 of file gpg.c.

{
       output_scriptptrget();
       printf("&form=newmsg&pos=%s&draft=%s", cgi("pos"),
              cgi("draftmessage"));
}

Here is the call graph for this function:

Here is the caller graph for this function:

void sent_gpgerrtxt ( )

Definition at line 638 of file gpg.c.

{
       const char *p;

       for (p=gpgerrbuf; *p; p++)
       {
              switch (*p) {
              case '<':
                     printf("&lt;");
                     break;
              case '>':
                     printf("&gt;");
                     break;
              default:
                     putchar((int)(unsigned char)*p);
                     break;
              }
       }
}

Here is the caller graph for this function:

static int set_timezone ( const char *  p) [static]

Definition at line 670 of file sqwebmail.c.

{
       static char *s_buffer=0;
       char *buffer;

       if (!p || !*p || strcmp(p, "*") == 0)
              return (0);

       buffer=malloc(strlen(p)+10);
       if (!buffer)
              return (0);
       strcat(strcpy(buffer, "TZ="), p);

       putenv(buffer);

       if (s_buffer)
              free(buffer);
       s_buffer=buffer;

       return (0);
}

Here is the caller graph for this function:

static void setlang ( ) [static]

Definition at line 2013 of file sqwebmail.c.

{
       static char *lang_buf=0;
       char *p;

       if (sqwebmail_content_locale && *sqwebmail_content_locale
           && (p=malloc(sizeof("LANG=")+strlen(sqwebmail_content_locale)))!=0)
       {
              strcat(strcpy(p, "LANG="), sqwebmail_content_locale);
              putenv(p);
              if (lang_buf)
                     free(lang_buf);
              lang_buf=p;
       }
}

Here is the caller graph for this function:

static int setuidgid ( uid_t  u,
gid_t  g,
const char *  dir,
void *  dummy 
) [static]

Definition at line 2191 of file sqwebmail.c.

{
       if (setgid(g) || setuid(u))
       {
              fprintf(stderr,
                     "CRIT: Cache - can't setuid/setgid to %u/%u\n",
                     (unsigned)u, (unsigned)g);
              return (-1);
       }

       if (chdir(dir))
       {
              fprintf(stderr,
                     "CRIT: Cache - can't chdir to %s: %s\n", dir, strerror(errno));
              return (-1);
       }
       return (0);
}

Here is the caller graph for this function:

Definition at line 646 of file sqispell.c.

{
const char *filename=cgi("draftmessage");
unsigned parnum=atol(cgi("row"));
unsigned pos=atol(cgi("col"));
char   *draftfilename;

       CHECKFILENAME(filename);
       draftfilename=maildir_find(INBOX "." DRAFTS, filename);
       if (!draftfilename)
       {
              output_form("folder.html");
              return;
       }

       if (search_spell(draftfilename, parnum, pos) &&
              *cgi("continue"))
              output_form("spellchk.html");
       else
       {
              cgi_put("draft", cgi("draftmessage"));
              cgi_put("previewmsg","SPELLCHK");
              output_form("newmsg.html");
       }
       free(draftfilename);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void spell_show ( )

Definition at line 423 of file sqispell.c.

{
const char *draftmessage=cgi("draftmessage");
struct ispell_misspelled *msp;
struct ispell_suggestion *isps;
size_t p, l=strlen(ispellline), n;
const char *ignorelab=getarg("IGNORE");
const char *ignorealllab=getarg("IGNOREALL");
const char *replacelab=getarg("REPLACE");
const char *replacealllab=getarg("REPLACEALL");
const char *insertlab=getarg("INSERT");
const char *continuelab=getarg("CONTINUE");
const char *finishlab=getarg("FINISH");

       if (!ispellptr)      enomem();

       if (!ignorelab)             ignorelab="";
       if (!ignorealllab)   ignorealllab="";
       if (!replacelab)     replacelab="";
       if (!replacealllab)  replacealllab="";
       if (!continuelab)    continuelab="";
       if (!finishlab)             finishlab="";

       for (msp=ispellptr->first_misspelled; msp; msp=msp->next)
              if (msp->misspelled_word)   break;
       if (!msp)     enomem();

       CHECKFILENAME(draftmessage);

       printf("<input type=\"hidden\" name=\"form\" value=\"spellchk\" />\n");
       printf("<input type=\"hidden\" name=\"pos\" value=\"%s\" />\n", cgi("pos"));
       if (*cgi("globignore"))
       {
              printf("<input type=\"hidden\" name=\"globignore\" value=\"");
              output_attrencoded(cgi("globignore"));
              printf("\" />\n");
       }
       if (*cgi("globreplace"))
       {
              printf("<input type=\"hidden\" name=\"globreplace\" value=\"");
              output_attrencoded(cgi("globreplace"));
              printf("\" />\n");
       }

       printf("<input type=\"hidden\" name=\"draftmessage\" value=\"");
       output_attrencoded(draftmessage);
       printf("\" />");
       printf("<input type=\"hidden\" name=\"row\" value=\"%u\" /><input type=\"hidden\" name=\"col\" value=\"%u\" /><input type=\"hidden\" name=\"word\" value=\"",
              (unsigned)paragraph,
              (unsigned)msp->word_pos);
       output_attrencoded(msp->misspelled_word);

       printf("\" /><table border=\"0\" cellspacing=\"0\" cellpadding=\"1\" "
              "class=\"box-small-outer\"><tr><td>");
       printf("<table border=\"0\" cellspacing=\"0\" class=\"spellcheck-background\"><tr><td>");

       printf("<table border=\"1\" cellspacing=\"0\" cellpadding=\"8\" class=\"spellcheck-excerpt\"><tr><td align=\"center\"><span style=\"color: #000000\" class=\"spellcheck-excerpt\">");

       if (msp->word_pos > 30)
       {
              p=msp->word_pos-30;
              for (n=p; n<msp->word_pos; n++)
                     if (ispellline[n] == ' ')
                     {
                            while (n < p && ispellline[n] == ' ')
                                   ++n;
                            p=n;
                            break;
                     }
              printf("...&nbsp;");
       }
       else
              p=0;


       show_part(ispellline+p, msp->word_pos-p);
       printf("<strong>");
       show_part(ispellline+msp->word_pos, strlen(msp->misspelled_word));
       printf("</strong>");

       p=msp->word_pos+strlen(msp->misspelled_word);
       if (l-p < 30)
       {
              n=l-p;
       }
       else   n=30;

       while (n)
       {
              if (ispellline[n+p] != ' ')
              {
                     --n;
                     continue;
              }
              while (n && ispellline[n+p-1] == ' ')
                     --n;
              break;
       }

       show_part(ispellline+p, n);

       if (n != l-p)
              printf("&nbsp;...");
       printf("</span></td></tr></table><br />");
       printf("<table border=\"1\" cellpadding=\"8\" class=\"spellcheck-main\"><tr><td>");

       printf("<table border=\"0\">");
       for (isps=msp->first_suggestion; isps; isps=isps->next)
       {
              printf("<tr><td>%s</td><td><input type=\"radio\" name=\"REPLACE\" value=\"%s\" /></td><td>%s</td></tr>\n",
                     replacelab,
                     isps->suggested_word,
                     isps->suggested_word);
              replacelab=" ";
       }
       printf("<tr><td>%s</td><td><input type=\"radio\" name=\"REPLACE\" value=\"#other\" /></td><td><input type=\"text\" name=\"OTHER\" size=\"20\" /></td></tr>\n",
              replacelab);
       printf("<tr><td> </td><td><input type=\"radio\" name=\"REPLACE\" value=\"#insert\" /></td><td>%s</td></tr>\n",
              insertlab);

       printf("<tr><td> </td><td><input type=\"checkbox\" name=\"REPLACEALL\" /></td><td>%s</td></tr>\n",
              replacealllab);
       printf("<tr><td> </td><td colspan=\"2\"><hr width=\"100%%\" /></td></tr>\n");
       printf("<tr><td> </td><td><input type=\"radio\" name=\"REPLACE\" value=\"#ignore\" /></td><td>%s</td></tr>\n",
              ignorelab);
       printf("<tr><td> </td><td><input type=\"radio\" name=\"REPLACE\" value=\"#ignoreall\" /></td><td>%s</td></tr>\n",
              ignorealllab);
       printf("</table>");
       printf("</td></tr></table><br />");
       printf("<table border=\"1\" cellpadding=\"8\" class=\"spellcheck-continue\"><tr><td>");
       printf("<input type=\"submit\" name=\"continue\" value=\"%s\" />\n",
                     continuelab);
       printf("<input type=\"submit\" name=\"finish\" value=\"%s\" />\n",
                     finishlab);
       printf("</td></tr></table>\n");
       printf("</td></tr></table>\n");
       printf("</td></tr></table>\n");
}

Here is the call graph for this function:

Here is the caller graph for this function:

static int timezonefile ( int(*)(const char *, const char *, void *)  callback_func,
void *  callback_arg 
) [static]

Definition at line 593 of file sqwebmail.c.

{
       FILE *f=NULL;
       char buffer[BUFSIZ];

       if (sqwebmail_content_language)
              f=open_langform(sqwebmail_content_language, "TIMEZONELIST", 0);

       if (!f)       f=open_langform(HTTP11_DEFAULTLANG, "TIMEZONELIST", 0);

       if (!f)
              return (0);

       while (fgets(buffer, sizeof(buffer), f) != NULL)
       {
              char *p=strchr(buffer, '\n');
              char *tz;
              int rc;

              if (p) *p=0;

              p=strchr(buffer, '#');
              if (p) *p=0;

              for (p=buffer; *p; p++)
                     if (!isspace((int)(unsigned char)*p))
                            break;

              if (!*p)
                     continue;

              tz=p;
              while (*p)
              {
                     if (isspace((int)(unsigned char)*p))
                            break;
                     ++p;
              }
              if (*p) *p++=0;
              while (*p && isspace((int)(unsigned char)*p))
                     ++p;

              if (strcmp(p, "*") == 0)
                     p="";
              if (strcmp(tz, "*") == 0)
                     tz="";

              rc= (*callback_func)(tz, p, callback_arg);

              if (rc)
              {
                     fclose(f);
                     return (rc);
              }
       }
       fclose(f);
       return (0);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void timezonelist ( ) [static]

Definition at line 655 of file sqwebmail.c.

{
       printf("<select name=\"timezonelist\" class=\"timezonelist\">");
       timezonefile(callback_timezonelist, NULL);
       printf("</select>\n");
}

Here is the call graph for this function:

Here is the caller graph for this function:

char * trim_spaces ( const char *  s)

Definition at line 2724 of file sqwebmail.c.

{
       char *p, *q;

       p=strdup(s);
       if (!p)
              enomem();

       if (*p)
       {
              for (q=p+strlen(p)-1; q >= p && isspace(*q); q--)
                     *q=0;

              for (q=p; *q && isspace(*q); q++)
                     ;
              if (p != q)
                     p=q;
       }

       return (p);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void usage ( ) [static]

Definition at line 2151 of file sqwebmail.c.

{
       fprintf(stderr, "sqwebmaild does not accept command arguments.\n"
              "Use sqwebmaild.rc script to start sqwebmaild as a daemon.\n");
       exit(1);
}
static int valid_redirect ( ) [static]

Definition at line 2126 of file sqwebmail.c.

{
       const char *timestamp=cgi("timestamp"), *p;
       unsigned long timestamp_n;
       time_t timestamp_t;
       time_t now;

       if (sscanf(timestamp, "%lu", &timestamp_n) != 1)
              return 0;

       timestamp_t=(time_t)timestamp_n;
       time(&now);

       if (now < timestamp_t || now > timestamp_t + get_timeouthard())
              return 0;

       p=redirect_hash(timestamp);

       if (*p == 0 || strcmp(cgi("md5"), p))
              return 0;
       return 1;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void var_put_buf_func ( int  c,
void *  p 
) [static]

Definition at line 507 of file sqwebmail.c.

{
       struct var_put_buf *pp=(struct var_put_buf *)p;

       if (pp->argn)
       {
              *pp->argp++=c;
              --pp->argn;
       }
}

Here is the caller graph for this function:


Variable Documentation

const char* const authvars[] [static]
Initial value:
 { "AUTHADDR", "AUTHFULLNAME",
                                    "OPTIONS", "AUTHENTICATED", 0 }

Definition at line 141 of file sqwebmail.c.

time_t login_time

Definition at line 136 of file sqwebmail.c.

int noimages = 0 [static]

Definition at line 134 of file sqwebmail.c.

Definition at line 129 of file sqwebmail.c.

Definition at line 128 of file sqwebmail.c.

const char* sqwebmail_content_language = 0

Definition at line 123 of file sqwebmail.c.

Definition at line 124 of file sqwebmail.c.

const char* sqwebmail_folder = 0

Definition at line 106 of file sqwebmail.c.

Definition at line 119 of file sqwebmail.c.

const char* sqwebmail_formname [static]

Definition at line 149 of file sqwebmail.c.

Definition at line 131 of file sqwebmail.c.

Definition at line 132 of file sqwebmail.c.

const char* sqwebmail_mailboxid = 0

Definition at line 105 of file sqwebmail.c.

const char* sqwebmail_sessiontoken = 0

Definition at line 121 of file sqwebmail.c.

const char* sqwebmail_system_charset = 0

Definition at line 125 of file sqwebmail.c.

char* sys_locale_charset = 0 [static]

Definition at line 126 of file sqwebmail.c.

struct template_stack* template_stack = NULL [static]

Definition at line 162 of file sqwebmail.c.