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

Diff of /imapfilter/imapfilter.c

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

revision 1.24 by lefcha, Sat Dec 8 14:40:11 2001 UTC revision 1.25 by lefcha, Mon Jan 14 18:12:38 2002 UTC
# Line 16  extern filter_t *filters; Line 16  extern filter_t *filters;
16  unsigned int options;           /* Program options. */  unsigned int options;           /* Program options. */
17  unsigned int capabilities;      /* Capabilities of mail server. */  unsigned int capabilities;      /* Capabilities of mail server. */
18  char logfile[PATH_MAX];         /* Log file. */  char logfile[PATH_MAX];         /* Log file. */
19    char *home = NULL;              /* User's home directory. */
20    
21    
22  /*  /*
# Line 30  int main(int argc, char *argv[]) Line 31  int main(int argc, char *argv[])
31    
32      options = (OPTION_DETAILS_NORMAL | OPTION_NAMESPACE);      options = (OPTION_DETAILS_NORMAL | OPTION_NAMESPACE);
33      *logfile = 0;      *logfile = 0;
34        home = getenv("HOME");
35    
36    #ifndef ENCRYPTED_PASSWORDS
37      while ((c = getopt(argc, argv, "c:hl:qv")) != -1) {      while ((c = getopt(argc, argv, "c:hl:qv")) != -1) {
38    #else
39        while ((c = getopt(argc, argv, "c:hl:pqv")) != -1) {
40    #endif
41          switch (c) {          switch (c) {
42          case 'c':          case 'c':
43              confile = optarg;              confile = optarg;
# Line 43  int main(int argc, char *argv[]) Line 49  int main(int argc, char *argv[])
49          case 'l':          case 'l':
50              strncat(logfile, optarg, PATH_MAX - 1);              strncat(logfile, optarg, PATH_MAX - 1);
51              break;              break;
52    #ifdef ENCRYPTED_PASSWORDS
53            case 'p':
54                options |= OPTION_PASSWORD_EDITOR;
55                break;
56    #endif
57          case 'q':          case 'q':
58              options &= OPTION_DETAILS_CLEAR;              options &= OPTION_DETAILS_CLEAR;
59              options |= OPTION_DETAILS_QUIET;              options |= OPTION_DETAILS_QUIET;
# Line 60  int main(int argc, char *argv[]) Line 71  int main(int argc, char *argv[])
71    
72      catch_signals();      catch_signals();
73    
74        create_homedir();
75    
76      read_config(confile);      read_config(confile);
77      open_logfile();      open_logfile();
78    
79    #ifdef ENCRYPTED_PASSWORDS
80        read_passwords();
81        
82        if ((options & OPTION_PASSWORD_EDITOR))
83            password_editor();
84    #endif
85    
86      for (ca = accounts; ca; ca = ca->next) {      for (ca = accounts; ca; ca = ca->next) {
87    
88  #ifndef SSL_TLS  #ifndef SSL_TLS
# Line 82  int main(int argc, char *argv[]) Line 102  int main(int argc, char *argv[])
102  #endif  #endif
103    
104          if (r != RESPONSE_PREAUTH) {          if (r != RESPONSE_PREAUTH) {
105              if (ca->nopassword)              if (ca->passwdattr == PASSWORD_NONE) {
106                  get_password(ca->username, ca->server, ca->password);                  printf("Enter password for %s@%s: ", ca->username, ca->server);
107                    get_password(ca->password, PASSWORD_LEN);
108                }
109              if (login(ca->username, ca->password))              if (login(ca->username, ca->password))
110                  continue;                  continue;
111          }          }
   
112          check_namespace();          check_namespace();
113    
114          for (cm = ca->mboxes; cm; cm = cm->next)          for (cm = ca->mboxes; cm; cm = cm->next)
# Line 115  int main(int argc, char *argv[]) Line 136  int main(int argc, char *argv[])
136   */   */
137  void usage(void)  void usage(void)
138  {  {
139    #ifndef ENCRYPTED_PASSWORDS
140        fprintf(stderr,
141                "usage: imapfilter [-hpqv] [-c configfile] [-l logfile]\n");
142    #else
143      fprintf(stderr,      fprintf(stderr,
144              "usage: imapfilter [-hqv] [-c configfile] [-l logfile]\n");              "usage: imapfilter [-hqv] [-c configfile] [-l logfile]\n");
145    #endif
146  }  }

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

webmaster@linux.gr
ViewVC Help
Powered by ViewVC 1.1.26