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

Diff of /imapfilter/imapfilter.c

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

revision 1.54 by lefcha, Sun Aug 3 17:40:10 2003 UTC revision 1.54.2.3 by lefcha, Tue Jan 20 02:06:09 2004 UTC
# Line 1  Line 1 
1  #include <stdio.h>  #include <stdio.h>
2  #include <stdlib.h>  #include <stdlib.h>
3  #include <string.h>  #include <sys/types.h>
4  #include <unistd.h>  #include <unistd.h>
5    #include <string.h>
6  #include <errno.h>  #include <errno.h>
7  #include <limits.h>  #include <limits.h>
8  #include <setjmp.h>  #include <setjmp.h>
# Line 15  Line 16 
16  #include "buffer.h"  #include "buffer.h"
17    
18  #if defined SSL_TLS || defined ENCRYPTED_PASSWORDS || defined CRAM_MD5  #if defined SSL_TLS || defined ENCRYPTED_PASSWORDS || defined CRAM_MD5
19    #include <openssl/opensslv.h>
20  #include <openssl/crypto.h>  #include <openssl/crypto.h>
21  #endif  #endif
22    
# Line 47  main(int argc, char *argv[]) Line 49  main(int argc, char *argv[])
49  {  {
50          int c, r, f;          int c, r, f;
51          pid_t pid;          pid_t pid;
52          char *confile;          /* Configuration file. */          char *conffile;         /* Configuration file. */
53          account_t *ca;          /* Current account. */          account_t *ca;          /* Current account. */
54          mbox_t *cm;             /* Current mailbox. */          mbox_t *cm;             /* Current mailbox. */
55    
# Line 55  main(int argc, char *argv[]) Line 57  main(int argc, char *argv[])
57    
58          f = 0;          f = 0;
59          home = getenv("HOME");          home = getenv("HOME");
60          options = (OPTION_DETAILS_NORMAL | OPTION_NAMESPACE);          options = (OPTION_DETAILS_NORMAL | OPTION_NAMESPACE | OPTION_PEEK);
61          *charset = 0;          *charset = 0;
62          *logfile = 0;          *logfile = 0;
63          confile = NULL;          conffile = NULL;
64            connpri.sock = connaux.sock = -1;
65    
66          while ((c = getopt(argc, argv, "c:d:hkl:"          while ((c = getopt(argc, argv, "c:d:hkl:"
67  #ifdef ENCRYPTED_PASSWORDS  #ifdef ENCRYPTED_PASSWORDS
# Line 67  main(int argc, char *argv[]) Line 70  main(int argc, char *argv[])
70                      "qvV")) != -1) {                      "qvV")) != -1) {
71                  switch (c) {                  switch (c) {
72                  case 'c':                  case 'c':
73                          confile = optarg;                          conffile = optarg;
74                          break;                          break;
75                  case 'd':                  case 'd':
76                          options |= OPTION_DAEMON_MODE;                          options |= OPTION_DAEMON_MODE;
# Line 92  main(int argc, char *argv[]) Line 95  main(int argc, char *argv[])
95                          break;                          break;
96  #endif  #endif
97                  case 'q':                  case 'q':
98                          options &= OPTION_DETAILS_CLEAR;                          options &= ~(OPTION_DETAILS_QUIET |
99                                OPTION_DETAILS_NORMAL | OPTION_DETAILS_VERBOSE);
100                          options |= OPTION_DETAILS_QUIET;                          options |= OPTION_DETAILS_QUIET;
101                          break;                          break;
102                  case 'v':                  case 'v':
103                          options &= OPTION_DETAILS_CLEAR;                          options &= ~(OPTION_DETAILS_QUIET |
104                                OPTION_DETAILS_NORMAL | OPTION_DETAILS_VERBOSE);
105                          options |= OPTION_DETAILS_VERBOSE;                          options |= OPTION_DETAILS_VERBOSE;
106                          break;                          break;
107                  case 'V':                  case 'V':
# Line 122  main(int argc, char *argv[]) Line 127  main(int argc, char *argv[])
127          tty_store();          tty_store();
128          catch_signals();          catch_signals();
129    
130          read_config(confile);          read_config(conffile);
131    
132  #ifdef ENCRYPTED_PASSWORDS  #ifdef ENCRYPTED_PASSWORDS
133          read_passwords();          read_passwords();
# Line 144  main(int argc, char *argv[]) Line 149  main(int argc, char *argv[])
149    
150          if (options & OPTION_DAEMON_MODE) {          if (options & OPTION_DAEMON_MODE) {
151                  f = 1;                  f = 1;
152                  options &= OPTION_DETAILS_CLEAR;                  options &= ~(OPTION_DETAILS_QUIET |
153                        OPTION_DETAILS_NORMAL | OPTION_DETAILS_VERBOSE);
154                  options |= OPTION_DETAILS_QUIET;                  options |= OPTION_DETAILS_QUIET;
155          }          }
156          do {          do {
# Line 234  main(int argc, char *argv[]) Line 240  main(int argc, char *argv[])
240                  }                  }
241                  if (options & OPTION_DAEMON_MODE &&                  if (options & OPTION_DAEMON_MODE &&
242                      flags & FLAG_SIGUSR1_RECEIVED) {                      flags & FLAG_SIGUSR1_RECEIVED) {
243                          reread_config(confile);                          reread_config(conffile);
244                          continue;                          continue;
245                  }                  }
246                  if (interval)                  if (interval)
# Line 246  main(int argc, char *argv[]) Line 252  main(int argc, char *argv[])
252    
253          lockfile_remove();          lockfile_remove();
254    
255          return 0;          exit(0);
256  }  }
257    
258    

Legend:
Removed from v.1.54  
changed lines
  Added in v.1.54.2.3

webmaster@linux.gr
ViewVC Help
Powered by ViewVC 1.1.26