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

Diff of /imapfilter/imapfilter.c

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

revision 1.23 by lefcha, Sun Nov 18 13:08:50 2001 UTC revision 1.24 by lefcha, Sat Dec 8 14:40:11 2001 UTC
# Line 1  Line 1 
1  #include <stdio.h>  #include <stdio.h>
2  #include <stdlib.h>  #include <stdlib.h>
3  #include <unistd.h>  #include <unistd.h>
 #include <getopt.h>  
4  #include <string.h>  #include <string.h>
5  #include <limits.h>  #include <limits.h>
6  #include <errno.h>  #include <errno.h>
# Line 15  extern account_t *accounts; Line 14  extern account_t *accounts;
14  extern filter_t *filters;  extern filter_t *filters;
15    
16  unsigned int options;           /* Program options. */  unsigned int options;           /* Program options. */
17    unsigned int capabilities;      /* Capabilities of mail server. */
18  char logfile[PATH_MAX];         /* Log file. */  char logfile[PATH_MAX];         /* Log file. */
19    
20    
# Line 28  int main(int argc, char *argv[]) Line 28  int main(int argc, char *argv[])
28      account_t *ca;              /* Current account. */      account_t *ca;              /* Current account. */
29      mbox_t *cm;                 /* Current mailbox. */      mbox_t *cm;                 /* Current mailbox. */
30    
31      options = OPTION_DETAILS_NORMAL;      options = (OPTION_DETAILS_NORMAL | OPTION_NAMESPACE);
32      *logfile = 0;      *logfile = 0;
33    
34      while ((c = getopt(argc, argv, "c:hl:qv")) != -1) {      while ((c = getopt(argc, argv, "c:hl:qv")) != -1) {
# Line 58  int main(int argc, char *argv[]) Line 58  int main(int argc, char *argv[])
58          }          }
59      }      }
60    
61        catch_signals();
62    
63      read_config(confile);      read_config(confile);
64      open_logfile();      open_logfile();
65    
     catch_signals();  
   
66      for (ca = accounts; ca; ca = ca->next) {      for (ca = accounts; ca; ca = ca->next) {
67    
68  #ifndef SSL_TLS  #ifndef SSL_TLS
# Line 81  int main(int argc, char *argv[]) Line 81  int main(int argc, char *argv[])
81          test();          test();
82  #endif  #endif
83    
84          if (r != RESPONSE_PREAUTH && login(ca->username, ca->password))          if (r != RESPONSE_PREAUTH) {
85              continue;              if (ca->nopassword)
86                    get_password(ca->username, ca->server, ca->password);
87                if (login(ca->username, ca->password))
88                    continue;
89            }
90    
91            check_namespace();
92    
93          for (cm = ca->mboxes; cm; cm = cm->next)          for (cm = ca->mboxes; cm; cm = cm->next)
94              if (!*cm->filters)              if (!*cm->filters)

Legend:
Removed from v.1.23  
changed lines
  Added in v.1.24

webmaster@linux.gr
ViewVC Help
Powered by ViewVC 1.1.26