/[imapfilter]/imapfilter/imapfilter.c
ViewVC logotype

Diff of /imapfilter/imapfilter.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.11 by lefcha, Mon Sep 10 23:43:29 2001 UTC revision 1.12 by lefcha, Sun Sep 30 20:19:12 2001 UTC
# Line 25  int main(int argc, char **argv) Line 25  int main(int argc, char **argv)
25      char *confile = NULL;       /* Configuration file. */      char *confile = NULL;       /* Configuration file. */
26      account_t *ca;              /* Current account. */      account_t *ca;              /* Current account. */
27      mbox_t *cm;                 /* Current mailbox. */      mbox_t *cm;                 /* Current mailbox. */
28        
29      options = OPTION_DETAILS_NORMAL;      options = OPTION_DETAILS_NORMAL;
30      logfile[0] = 0;      *logfile = 0;
31    
32      while ((c = getopt(argc, argv, "c:hl:qv")) != -1) {      while ((c = getopt(argc, argv, "c:hl:qv")) != -1) {
33          switch (c) {          switch (c) {
# Line 36  int main(int argc, char **argv) Line 36  int main(int argc, char **argv)
36              break;              break;
37          case 'h':          case 'h':
38              usage();              usage();
39              exit(1);              exit(ERROR_UNDEFINED);
40              break;              break;
41          case 'l':          case 'l':
42              strncpy(logfile, optarg, PATH_MAX);              strncat(logfile, optarg, PATH_MAX - 1);
43              break;              break;
44          case 'q':          case 'q':
45              options &= OPTION_DETAILS_CLEAR;              options &= OPTION_DETAILS_CLEAR;
# Line 51  int main(int argc, char **argv) Line 51  int main(int argc, char **argv)
51              break;              break;
52          default:          default:
53              usage();              usage();
54              exit(1);              exit(ERROR_UNDEFINED);
55              break;              break;
56          }          }
57      }      }
58        
59      if (read_config(confile) || open_logfile())      read_config(confile);
60          exit(2);      open_logfile();
61            
62      for (ca = accounts; ca; ca = ca->next) {      for (ca = accounts; ca; ca = ca->next) {
63    
64          if (init_connection(ca->server, ca->port)) {          if (init_connection(ca->server, ca->port)) {
65              close_logfile();              close_logfile();
66              exit(3);              exit(ERROR_NETWORK);
67          }          }
68    
69          server_response();          server_response("\0");
70    
71  #ifdef DEBUG  #ifdef DEBUG
72          test();          test();
# Line 77  int main(int argc, char **argv) Line 77  int main(int argc, char **argv)
77          for (cm = ca->mboxes; cm; cm = cm->next) {          for (cm = ca->mboxes; cm; cm = cm->next) {
78              if (!*cm->filters)              if (!*cm->filters)
79                  continue;                  continue;
80                
81              examine_mailbox(cm->name);              select_mailbox(cm->name);
82    
83              apply_filters(cm->filters, cm->name);              apply_filters(cm->filters, cm->name);
84    

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.12

webmaster@linux.gr
ViewVC Help
Powered by ViewVC 1.1.26