Back to index

courier  0.68.2
Classes | Defines | Functions
folder.h File Reference
#include <sys/types.h>
#include <sys/stat.h>
#include <time.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  MSGINFO
struct  MATCHEDSTR

Defines

#define MSGINFO_FILENAME(n)   ((const char *)(n)->filename)
#define MSGINFO_DATE(n)   ((const char *)(n)->date_s)
#define MSGINFO_FROM(n)   ((const char *)(n)->from_s)
#define MSGINFO_SUBJECT(n)   ((const char *)(n)->subject_s)
#define MSGINFO_SIZE(n)   ((const char *)(n)->size_s)
#define MSGTYPE_NEW   'N'
#define MSGTYPE_DELETED   'D'
#define MSGTYPE_REPLIED   'R'

Functions

void folder_search (const char *, size_t)
void folder_contents_title ()
void folder_contents (const char *, size_t)
void folder_navigate (const char *, size_t, long, int, int, unsigned long *)
void folder_delmsgs (const char *, size_t)
void folder_showmsg (const char *, size_t)
void folder_keyimport (const char *, size_t)
void folder_initnextprev (const char *, size_t)
void folder_nextprev ()
void folder_msgmove ()
void folder_delmsg (size_t)
void folder_list ()
void folder_list2 ()
void folder_rename_list ()
void folder_showtransfer ()
void folder_download (const char *, size_t, const char *)
void folder_showquota ()

Class Documentation

struct MSGINFO

Definition at line 35 of file folder.h.

Class Members
time_t date_n
char * date_s
char * filename
char * from_s
ino_t mi_ino
time_t mi_mtime
size_t msgnum
unsigned long size_n
char * size_s
char * subject_s
struct MATCHEDSTR

Definition at line 74 of file folder.h.

Class Members
char * match
char * prefix
char * suffix

Define Documentation

#define MSGINFO_DATE (   n)    ((const char *)(n)->date_s)

Definition at line 49 of file folder.h.

#define MSGINFO_FILENAME (   n)    ((const char *)(n)->filename)

Definition at line 48 of file folder.h.

#define MSGINFO_FROM (   n)    ((const char *)(n)->from_s)

Definition at line 50 of file folder.h.

#define MSGINFO_SIZE (   n)    ((const char *)(n)->size_s)

Definition at line 52 of file folder.h.

#define MSGINFO_SUBJECT (   n)    ((const char *)(n)->subject_s)

Definition at line 51 of file folder.h.

#define MSGTYPE_DELETED   'D'

Definition at line 71 of file folder.h.

#define MSGTYPE_NEW   'N'

Definition at line 70 of file folder.h.

#define MSGTYPE_REPLIED   'R'

Definition at line 72 of file folder.h.


Function Documentation

void folder_contents ( const char *  ,
size_t   
)

Definition at line 427 of file folder.c.

{
MSGINFO       **contents;
MATCHEDSTR **matches;
int    i, found;
int    morebefore, moreafter;
const char    *nomsg, *selectalllab;
 const char   *unselectalllab;
const char    *qerrmsg;
long highend;
unsigned long last_message_searched=0;
unsigned long *last_message_searched_ptr=NULL;

       qerrmsg=getarg("PERMERR");

       if (strcmp(cgi("error"), "quota") == 0)
              printf("%s", qerrmsg);

       if (strcmp(cgi("error"), "nodel") == 0)
              printf("%s", getarg("NODELPERM"));

       if (strcmp(cgi("error"), "noinsert") == 0)
              printf("%s", getarg("NOINSERTPERM"));

       if (strcmp(cgi("error"), "othererror") == 0)
              printf("%s", getarg("OTHERERROR"));

       if (strchr(sqwebmail_folder_rights, ACL_READ[0]) == NULL)
       {
              printf("%s", getarg("ACL"));
              return;
       }

       maildir_reload(dir);

       if (*cgi("search"))
       {
#if 0
       {
              FILE *fp=fopen("/tmp/pid", "w");

              if (fp)
              {
                     fprintf(fp, "%d", (int)getpid());
                     fclose(fp);
                     sleep(10);
              }
       }
#endif

              morebefore=0;
              moreafter=0;
              maildir_loadsearch(pref_flagpagesize, &contents, &matches,
                               &last_message_searched);

              for (i=0; i<pref_flagpagesize; i++)
              {
                     if (contents[i] == 0)       continue;

                     last_message_searched_ptr= &last_message_searched;
                     break;
              }
       }
       else
       {
              contents=maildir_read(dir, pref_flagpagesize, &pos,
                                  &morebefore, &moreafter);
              matches=NULL;
       }

       time(&current_time);
       nomsg=getarg("NOMESSAGES");
       selectalllab=getarg("SELECTALL");
       unselectalllab=getarg("UNSELECTALL");

       if (maildir_countof(dir) <= pos + pref_flagpagesize - 1)
              highend = (long)(maildir_countof(dir) - 1);
       else
              highend = (long)(pos + pref_flagpagesize - 1);
       if (highend < 0) highend = 0;

       if (!qerrmsg) qerrmsg="";

       folder_navigate(dir, pos, highend, morebefore, moreafter,
                     last_message_searched_ptr);

       printf("<table width=\"100%%\" border=\"0\" cellspacing=\"0\" cellpadding=\"4\"><tr class=\"folder-index-header\"><th align=\"center\">%s</th><th>&nbsp;</th><th>%s</th><th>%s</th><th>%s</th><th>%s</th></tr>\n",
              getarg("NUM"),
              getarg("DATE"),
              (strncmp(dir, INBOX "." SENT, sizeof(INBOX)+sizeof(SENT)-1) &&
               strncmp(dir, INBOX "." DRAFTS, sizeof(INBOX)+sizeof(DRAFTS)-1))
                     ? getarg("FROM") : getarg("TO"),
              getarg("SUBJECT"),
              getarg("SIZE"));

       found=0;
       for (i=0; i<pref_flagpagesize; i++)
       {
              if (contents[i] == 0)       continue;
              found=1;

              show_msg(dir, contents[i], matches ? matches[i]:NULL, i,
                      sqwebmail_content_charset);
       }

       if (found)
       {
              puts("<tr class=\"folder-index-bg-1\"><td colspan=\"6\"><hr /></td></tr>");
              puts("<tr class=\"folder-index-bg-2\"><td>&nbsp;</td>");
              puts("<td colspan=\"5\">");

              puts("<script type=\"text/javascript\">");
              puts("/* <![CDATA[ */");
              puts("function setAll(input, chk) {");
              printf("for (i = %ld; i <= %ld; i++) {\n",
                     (long)pos, highend);
              puts("if (document.getElementById) e = document.getElementById('MOVE-' + i);");
              puts("else if (document.all) e = document['MOVE-' + i];");
              puts("if (e != null) { e.checked = chk; e.onchange(); }} }");
              puts("/* ]]> */");
              puts("</script>\n");

              puts("<script type=\"text/javascript\">");
              puts("/* <![CDATA[ */");
              printf("document.write('<button type=\"button\" onclick=\"setAll(this, true); return false;\">%s<\\/button>\\n&nbsp;');\n",
                     selectalllab);
              printf("document.write('<button type=\"button\" onclick=\"setAll(this, false); return false;\">%s<\\/button>\\n');\n",
                     unselectalllab);
              puts("/* ]]> */");
              puts("</script>\n");

              printf("<noscript><label><input type=\"checkbox\" name=\"SELECTALL\" />&nbsp;%s</label></noscript>\n",
                     selectalllab);
              puts("</td></tr>");

              printf("</table>\n");
              folder_navigate(dir, pos, highend, morebefore, moreafter,
                            last_message_searched_ptr);
       }
       if (!found && nomsg)
       {
              puts("<tr class=\"folder-index-bg-1\"><td colspan=\"6\" align=\"left\"><p>");
              puts(nomsg);
              puts("<br /></p></td></tr>");
              printf("</table>\n");
       }

       maildir_free(contents, pref_flagpagesize);
       if (matches)
              matches_free(matches, pref_flagpagesize);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 160 of file folder.c.

{
const char *lab;
const char *f;
const char *inbox_lab, *drafts_lab, *trash_lab, *sent_lab;
int in_utf8;

       lab=getarg("FOLDERTITLE");

       if (*cgi("search"))
              lab=getarg("SEARCHRESULTSTITLE");

       inbox_lab=getarg("INBOX");
       drafts_lab=getarg("DRAFTS");
       trash_lab=getarg("TRASH");
       sent_lab=getarg("SENT");

       f=sqwebmail_folder;
       in_utf8=1;

       if (strcmp(f, INBOX) == 0)  f=inbox_lab;
       else if (strcmp(f, INBOX "." DRAFTS) == 0)       f=drafts_lab;
       else if (strcmp(f, INBOX "." SENT) == 0)  f=sent_lab;
       else if (strcmp(f, INBOX "." TRASH) == 0) f=trash_lab;
       else in_utf8=0;

       if (lab)
       {
              char *ff, *origff;

              printf("%s", lab);

              origff=ff=in_utf8 ?
                     libmail_u_convert_fromutf8(f,
                                             sqwebmail_content_charset,
                                             NULL)
                     : folder_fromutf7(f);

              if (strcmp(ff, NEWSHAREDSP) == 0 ||
                  strncmp(ff, NEWSHAREDSP ".", sizeof(NEWSHAREDSP)) == 0)
              {
                     printf("%s", getarg("PUBLICFOLDERS"));
                     ff=strchr(ff, '.');
                     if (!ff)
                            ff="";
              }
              output_attrencoded(ff);
              free(origff);
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void folder_delmsg ( size_t  )

Definition at line 1523 of file folder.c.

{
MSGINFO       **info;
int    dummy;
const  char *f=cgi("posfile");
size_t newpos;
int    rc=0;
char nbuf[MAXLONGSIZE+10];

       CHECKFILENAME(f);

       if (*cgi("move1"))
       {
              rc=maildir_msgmovefile(sqwebmail_folder, f, cgi("list1"), pos);
              maildir_savefoldermsgs(sqwebmail_folder);
       }
       else if (*cgi("move2"))
       {
              rc=maildir_msgmovefile(sqwebmail_folder, f, cgi("list2"), pos);
              maildir_savefoldermsgs(sqwebmail_folder);
       }
       else
       {
              maildir_msgdeletefile(sqwebmail_folder, f, pos);
              maildir_savefoldermsgs(sqwebmail_folder);
       }

       if (rc)
       {
              http_redirect_argu("&form=readmsg&pos=%s&error=quota",
                     (unsigned long)pos);
              return;
       }

       newpos=pos+1;
       info=maildir_read(sqwebmail_folder, 1, &newpos, &dummy, &dummy);

       if (info[0] && newpos != pos)
       {
              sprintf(nbuf, "%lu", (unsigned long)newpos);
       }
       else
       {
              sprintf(nbuf, "%lu", (unsigned long)pos);
       }

       maildir_free(info, 1);

       if (*cgi("search"))
       {
              http_redirect_argss("&form=readmsg&pos=%s&search=1&"
                                SEARCHRESFILENAME "=%s", nbuf,
                                cgi(SEARCHRESFILENAME));
       }
       else
       {
              http_redirect_argss("&form=readmsg&pos=%s", nbuf, "");
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void folder_delmsgs ( const char *  ,
size_t   
)

Definition at line 334 of file folder.c.

{
       const char *status=do_folder_delmsgs(dir, pos);
       
       if (*cgi("search"))
              http_redirect_argsss("&error=%s&form=folder&pos=%s&search=1&"
                                 SEARCHRESFILENAME "=%s", status,
                                 cgi("pos"), cgi(SEARCHRESFILENAME));
       else
              http_redirect_argss("&error=%s&form=folder&pos=%s", status,
                                cgi("pos"));
}

Here is the call graph for this function:

Here is the caller graph for this function:

void folder_download ( const char *  ,
size_t  ,
const char *   
)

Definition at line 3579 of file folder.c.

{
       char   *filename;
       FILE *fp=NULL;
       int    fd;

       filename=get_msgfilename(folder, &pos);

       fd=maildir_semisafeopen(filename, O_RDONLY, 0);
       if (fd >= 0)
       {
              if ((fp=fdopen(fd, "r")) == 0)
                     close(fd);
       }

       if (!fp)
       {
              free(filename);
              error("Message not found.");
              return;
       }
       free(filename);

       cginocache();
       msg2html_download(fp, mimeid, *cgi("download") == '1',
                       sqwebmail_content_charset);

       fclose(fp);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void folder_initnextprev ( const char *  ,
size_t   
)

Definition at line 943 of file folder.c.

{
       MSGINFO       **info;
       const  char *p;
       const  char *msg_numlab, *msg_numnewlab;
       static char *filename=0;
       int fd;

       MSGINFO *recp;
       MSGINFO **search_contents=NULL;
       MATCHEDSTR **search_matches=NULL;
       unsigned long last_message_searched=0;

       cgi_put(MIMEGPGFILENAME, "");

       if (filename)
              free(filename);
       filename=0;


       if (*cgi("mimegpg") && (filename=maildir_posfind(dir, &pos)) != 0)
       {
              char *tptr;
              int nfd;

              fd=maildir_semisafeopen(filename, O_RDONLY, 0);

              if (fd >= 0)
              {
                     struct maildir_tmpcreate_info createInfo;

                     maildir_purgemimegpg();

                     maildir_tmpcreate_init(&createInfo);

                     createInfo.uniq=":mimegpg:";
                     createInfo.doordie=1;

                     if ((nfd=maildir_tmpcreate_fd(&createInfo)) < 0)
                     {
                            free(filename);
                            error("Can't create new file.");
                     }

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

                     chmod(tptr, 0600);

                     /*
                     ** Decrypt/check message into a temporary file
                     ** that's immediately marked as deleted, so that it
                     ** gets purged at the next sweep.
                     */

                     if (gpgdecode(fd, nfd) < 0)
                     {
                            close(nfd);
                            unlink(tptr);
                            free(tptr);
                     }
                     else
                     {
                            close(fd);
                            free(filename);
                            filename=tptr;
                            fd=nfd;

                            cgi_put(MIMEGPGFILENAME,
                                   strrchr(filename, '/')+1);
                     }
                     close(fd);
              }
       }

       initnextprevcnt=0;
       msg_nextlab=getarg("NEXTLAB");
       msg_prevlab=getarg("PREVLAB");
       msg_deletelab=getarg("DELETELAB");
       msg_purgelab=getarg("PURGELAB");

       msg_folderlab=getarg("FOLDERLAB");

       msg_replylab=getarg("REPLY");
       msg_replyalllab=getarg("REPLYALL");
       msg_replylistlab=getarg("REPLYLIST");

       msg_forwardlab=getarg("FORWARD");
       msg_forwardattlab=getarg("FORWARDATT");

       msg_numlab=getarg("MSGNUM");
       msg_numnewlab=getarg("MSGNEWNUM");

       msg_fullheaderlab=getarg("FULLHDRS");

       msg_movetolab=getarg("MOVETO");
       msg_print=getarg("PRINT");

       folder_inbox=getarg("INBOX");
       folder_drafts=getarg("DRAFTS");
       folder_trash=getarg("TRASH");
       folder_sent=getarg("SENT");

       p=getarg("CREATEFAIL");
       if (strcmp(cgi("error"),"quota") == 0)
              printf("%s", p);

       msg_golab=getarg("GOLAB");
       msg_add=getarg("QUICKADD");

       msg_searchpos=atol(cgi("searchrow"));

       info=maildir_read(dir, 1, &pos, &msg_hasprev, &msg_hasnext);

       recp=info[0];
       msg_pos=pos;
       msg_prevpos=msg_pos-1;
       msg_nextpos=msg_pos+1;
       msg_prev_searchpos=msg_prevpos;
       msg_next_searchpos=msg_nextpos;

       if (*cgi("search"))
              maildir_loadsearch(pref_flagpagesize,
                               &search_contents,
                               &search_matches,
                               &last_message_searched);


       if (search_contents)
       {
              if (msg_searchpos < pref_flagpagesize &&
                  search_contents[msg_searchpos])
              {
                     recp=search_contents[msg_searchpos];

                     msg_pos=recp->msgnum;
                     if ((msg_hasprev=msg_searchpos > 0 &&
                          search_contents[msg_searchpos-1]) != 0)
                     {
                            msg_prevpos=search_contents
                                   [msg_searchpos-1]->msgnum;
                            msg_prev_searchpos=msg_searchpos-1;
                     }

                     if ((msg_hasnext=msg_searchpos + 1 <
                          pref_flagpagesize &&
                          search_contents[msg_searchpos+1]) != 0)
                     {
                            msg_nextpos=search_contents
                                   [msg_searchpos+1]->msgnum;
                            msg_next_searchpos=msg_searchpos+1;
                     }

              }
       }

       p=strrchr(MSGINFO_FILENAME(recp), '/');
       if (p) p++;
       else   p=MSGINFO_FILENAME(recp);
       msg_posfile=strdup(p);
       if (!msg_posfile)    enomem();

       if ((msg_type=maildirfile_type(MSGINFO_FILENAME(recp)))
              == MSGTYPE_NEW) msg_numlab=msg_numnewlab;

       msg_msglab=msg_numlab;
       msg_count=maildir_countof(dir);
       maildir_free(info, 1);
       if (search_contents)
              maildir_free(search_contents, pref_flagpagesize);
       if (search_matches)
              matches_free(search_matches, pref_flagpagesize);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void folder_keyimport ( const char *  ,
size_t   
)

Definition at line 2256 of file folder.c.

{
       char   *filename;
       FILE   *fp;
       struct rfc2045 *rfc;
       int    fd;

       filename=get_msgfilename(dir, &pos);

       fp=0;
       fd=maildir_semisafeopen(filename, O_RDONLY, 0);
       if (fd >= 0)
       {
              if ((fp=fdopen(fd, "r")) == 0)
                     close(fd);
       }

       if (!fp)
       {
              free(filename);
              return;
       }

       rfc=rfc2045_fromfp(fp);


       if (libmail_gpg_has_gpg(GPGDIR) == 0)
       {
              struct rfc2045 *part;

              if (*cgi("pubkeyimport")
                  && (part=rfc2045_find(rfc, cgi("keymimeid"))) != 0)
              {
                     dokeyimport(fp, part, 0);
              }
              else if (*cgi("privkeyimport")
                  && (part=rfc2045_find(rfc, cgi("keymimeid"))) != 0)
              {
                     dokeyimport(fp, part, 1);
              }
       }
       rfc2045_free(rfc);
       fclose(fp);
       free(filename);

       printf("<p><a href=\"");
       output_scriptptrget();
       printf("&amp;form=readmsg&amp;pos=%s", cgi("pos"));
       printf("\">%s</a>", getarg("KEYIMPORT"));
}

Here is the call graph for this function:

Here is the caller graph for this function:

void folder_list ( )
void folder_list2 ( )
void folder_msgmove ( )

Definition at line 1505 of file folder.c.

{
       ++initnextprevcnt;
       printf("<table border=\"0\" class=\"box-small-outer\"><tr><td>\n");
       printf("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td class=\"folder-move-background\">&nbsp;%s&nbsp;<select name=\"list%d\">\n", msg_movetolab, initnextprevcnt);

       show_transfer_dest(sqwebmail_folder);

       printf("</select><input type=\"submit\"%s name=\"move%d\" value=\"%s\" /></td></tr></table>\n",
              (msg_type == MSGTYPE_DELETED ? " disabled":""),
              initnextprevcnt,
              msg_golab ? msg_golab:"");
       printf("<input type=\"hidden\" name=\"pos\" value=\"%s\" />", cgi("pos"));
       printf("<input type=\"hidden\" name=\"posfile\" value=\"");
       output_attrencoded(msg_posfile ? msg_posfile:"");
       printf("\" /></td></tr></table>\n");
}

Here is the call graph for this function:

Here is the caller graph for this function:

void folder_navigate ( const char *  ,
size_t  ,
long  ,
int  ,
int  ,
unsigned long *   
)

Definition at line 834 of file folder.c.

{
       printf("<table width=\"100%%\" class=\"folder-nextprev-background\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr>");

       if (*cgi("search"))
       {
              printf("<td class=\"folder-return-link\">");
              printf("<a href=\"");
              output_scriptptrget();
              printf("&amp;form=folder&amp;pos=%ld\">%s</a>",
                     (long)pos, getarg("RETURNTOFOLDER"));
              printf("</td>");

              printf("<td class=\"folder-last-message-searched\">");
              if (last_message_searched_ptr)
              {
                     printf(getarg("LASTMESSAGESEARCHED"),
                            *last_message_searched_ptr+1);
              }
              else
              {
                     printf("&nbsp;");
              }
              printf("</td>");
       }
       else
       {
              printf("<td align=\"left\">");
              do_folder_navigate(dir, pos, highend, morebefore, moreafter);
              printf("</td>");
       }

       printf("</tr></table>");
}

Here is the call graph for this function:

Here is the caller graph for this function:

void folder_nextprev ( )

Definition at line 3502 of file folder.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void folder_search ( const char *  ,
size_t   
)

Definition at line 402 of file folder.c.

{
       maildir_reload(dir);
       maildir_search(dir,
                     pos,
                     cgi("searchtxt"),
                     sqwebmail_content_charset,
                     pref_flagpagesize);

       http_redirect_argss("&search=1&form=folder&pos=%s&"
                         SEARCHRESFILENAME "=%s", cgi("pos"),
                         cgi(SEARCHRESFILENAME));
}

Here is the call graph for this function:

Here is the caller graph for this function:

void folder_showmsg ( const char *  ,
size_t   
)

Definition at line 2111 of file folder.c.

{
       char   *filename;
       FILE   *fp;
       struct rfc2045 *rfc;
       char   buf[BUFSIZ];
       int    n;
       int    fd;

       struct msg2html_info *info;

       const char *script_name=nonloginscriptptr();


       if (*cgi("addnick"))
       {
              const char *name=cgi("newname");
              const char *addr=cgi("newaddr");

              const char *nick1=cgi("newnick1");
              const char *nick2=cgi("newnick2");

              while (*nick1 && isspace((int)(unsigned char)*nick1))
                     ++nick1;

              while (*nick2 && isspace((int)(unsigned char)*nick2))
                     ++nick2;

              if (*nick2)
                     nick1=nick2;

              if (*nick1)
              {
                     ab_add(name, addr, nick1);
              }
       }

       filename=get_msgfilename(dir, &pos);

       fp=0;
       fd=maildir_semisafeopen(filename, O_RDONLY, 0);
       if (fd >= 0)
       {
              if ((fp=fdopen(fd, "r")) == 0)
                     close(fd);
       }

       if (!fp)
       {
              free(filename);
              return;
       }

       msg_pos=pos;
       rfc=rfc2045_alloc();

       while ((n=fread(buf, 1, sizeof(buf), fp)) > 0)
              rfc2045_parse(rfc, buf, n);
       rfc2045_parse_partial(rfc);

       info=script_name ? msg2html_alloc(sqwebmail_content_charset):NULL;

       if (info)
       {
              char nowbuffer[NUMBUFSIZE];
              time_t now;
              char *hash;
              char *washpfix;
              char *washpfixmailto;
              char *scriptnameget=scriptptrget();
              static const char formbuf[]="&form=newmsg&to=";

              info->mimegpgfilename=cgi(MIMEGPGFILENAME);
              if (*info->mimegpgfilename)
                     CHECKFILENAME(info->mimegpgfilename);

              info->gpgdir=GPGDIR;
              info->fullheaders=pref_flagfullheaders || *cgi("fullheaders");
              info->noflowedtext=pref_noflowedtext;
              info->showhtml=pref_showhtml;

              info->charset_warning=charset_warning;
              info->html_content_follows=html_warning;
              info->get_url_to_mime_part=get_url_to_mime_part;

              time(&now);
              libmail_str_time_t(now, nowbuffer);

              hash=cgiurlencode(redirect_hash(nowbuffer));

              washpfix=malloc(strlen(script_name)
                            + strlen(hash ? hash:"") + strlen(nowbuffer)
                            + 100);
              if (!washpfix)       enomem();

              strcat(strcat(strcat(strcat(strcat(strcpy(washpfix,
                                                   script_name),
                                             "?timestamp="),
                                       nowbuffer),
                                 "&md5="),
                           (hash ? hash:"")),
                     "&redirect=");

              if (hash)
                     free(hash);

              washpfixmailto=malloc(strlen(scriptnameget)+sizeof(formbuf));
              if (!washpfixmailto) enomem();
              strcat(strcpy(washpfixmailto, scriptnameget), formbuf);
              free(scriptnameget);

              info->wash_http_prefix=washpfix;
              info->wash_mailto_prefix=washpfixmailto;

              init_smileys(info);

              info->email_address_start=email_address_start;
              info->email_address_end=email_address_end;
              info->email_header=email_header;
              info->email_header_date_fmt=email_header_date_fmt;
              info->get_textlink=get_textlink;
              info->message_rfc822_action=message_rfc822_action;
              info->inline_image_action=inline_image_action;
              info->unknown_attachment_action=unknown_attachment_action;
              info->application_pgp_keys_action=
                     application_pgp_keys_action;
              info->gpg_message_action=gpg_message_action;

              info->is_gpg_enabled=is_gpg_enabled();
              info->is_preview_mode=is_preview_mode();

              msg2html(fp, rfc, info);
              msg2html_free(info);

              free(washpfix);
              free(washpfixmailto);
       }

       rfc2045_free(rfc);
       fclose(fp);
       if (*cgi(MIMEGPGFILENAME) == 0)
              maildir_markread(dir, pos);
       free(filename);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void folder_showquota ( )

Definition at line 3646 of file folder.c.

{
       const char    *quotamsg;
       struct maildirsize quotainfo;

       quotamsg=getarg("QUOTAUSAGE");

       if (maildir_openquotafile(&quotainfo, "."))
              return;

       if (quotainfo.quota.nmessages != 0 ||
           quotainfo.quota.nbytes != 0)
              printf(quotamsg, maildir_readquota(&quotainfo));

       maildir_closequotafile(&quotainfo);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 3609 of file folder.c.

{
       const char    *deletelab, *purgelab, *movelab, *golab;

       deletelab=getarg("DELETE");
       purgelab=getarg("PURGE");
       movelab=getarg("ORMOVETO");
       golab=getarg("GO");
       folder_inbox=getarg("INBOX");
       folder_drafts=getarg("DRAFTS");
       folder_trash=getarg("TRASH");
       folder_sent=getarg("SENT");

       printf("<input type=\"hidden\" name=\"pos\" value=\"%s\" />", cgi("pos"));

       if (*cgi("search"))
       {
              printf("<input type=\"hidden\" name=\"search\" value=\"1\" />"
                     "<input type=\"hidden\" name=\"" SEARCHRESFILENAME
                     "\" value=\"");
              output_attrencoded(cgi(SEARCHRESFILENAME));
              printf("\" />");
       }

       if ((strcmp(sqwebmail_folder, INBOX "." TRASH) == 0) && (strlen(getarg("PURGEALL"))))
           printf("<input type=\"submit\" name=\"cmdpurgeall\" value=\"%s\" onclick=\"javascript: return deleteAll();\" />", 
              getarg("PURGEALL"));
       printf("<input type=\"submit\" name=\"cmddel\" value=\"%s\" />%s<select name=\"moveto\">",
              strcmp(sqwebmail_folder, INBOX "." TRASH) == 0
              ? purgelab:deletelab,
              movelab);

       show_transfer_dest(sqwebmail_folder);
       printf("</select><input type=\"submit\" name=\"cmdmove\" value=\"%s\" />\n",
              golab);
}

Here is the call graph for this function:

Here is the caller graph for this function: