/[mailutils]/mailutils/pop3d/pop3d.c
ViewVC logotype

Diff of /mailutils/pop3d/pop3d.c

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

revision 1.64 by gray, Fri Oct 10 08:53:57 2003 UTC revision 1.65 by gray, Sat Oct 11 10:59:03 2003 UTC
# Line 41  int tls_done; Line 41  int tls_done;
41  volatile size_t children;  volatile size_t children;
42  /* Should all the messages be undeleted on startup */  /* Should all the messages be undeleted on startup */
43  int undelete_on_startup;  int undelete_on_startup;
44    #ifdef ENABLE_LOGIN_DELAY
45    /* Minimum allowed delay between two successive logins */
46    time_t login_delay = 0;
47    char *login_stat_file = LOGIN_STAT_FILE;
48    #endif
49    
50  static int pop3d_mainloop       __P ((int fd, FILE *, FILE *));  static int pop3d_mainloop       __P ((int fd, FILE *, FILE *));
51  static void pop3d_daemon_init   __P ((void));  static void pop3d_daemon_init   __P ((void));
# Line 52  static void pop3d_log_connection __P((in Line 57  static void pop3d_log_connection __P((in
57  const char *program_version = "pop3d (" PACKAGE_STRING ")";  const char *program_version = "pop3d (" PACKAGE_STRING ")";
58  static char doc[] = N_("GNU pop3d -- the POP3 daemon");  static char doc[] = N_("GNU pop3d -- the POP3 daemon");
59    
60    #define OPT_LOGIN_DELAY 257
61    #define OPT_STAT_FILE   258
62    
63  static struct argp_option options[] = {  static struct argp_option options[] = {
64    {"undelete", 'u', NULL, 0,    {"undelete", 'u', NULL, 0,
65     N_("undelete all messages on startup"), 0},     N_("Undelete all messages on startup"), 0},
66    #ifdef ENABLE_LOGIN_DELAY
67      {"login-delay", OPT_LOGIN_DELAY, N_("SECONDS"), 0,
68       N_("Allowed delay between the two successive logins"), 0},
69      {"stat-file", OPT_STAT_FILE, N_("FILENAME"), 0,
70       N_("Name of login statistics file"), 0},
71    #endif
72    {NULL, 0, NULL, 0, NULL, 0}    {NULL, 0, NULL, 0, NULL, 0}
73  };  };
74    
# Line 83  static const char *pop3d_argp_capa[] = { Line 97  static const char *pop3d_argp_capa[] = {
97  static error_t  static error_t
98  pop3d_parse_opt (int key, char *arg, struct argp_state *astate)  pop3d_parse_opt (int key, char *arg, struct argp_state *astate)
99  {  {
100      char *p;
101      
102    switch (key)    switch (key)
103      {      {
104      case ARGP_KEY_INIT:      case ARGP_KEY_INIT:
# Line 92  pop3d_parse_opt (int key, char *arg, str Line 108  pop3d_parse_opt (int key, char *arg, str
108      case 'u':      case 'u':
109        undelete_on_startup = 1;        undelete_on_startup = 1;
110        break;        break;
111    
112    #ifdef ENABLE_LOGIN_DELAY
113        case OPT_LOGIN_DELAY:
114          login_delay = strtoul (arg, &p, 10);
115          if (*p)
116            {
117              argp_error (state, _("Invalid number"));
118              exit (1);
119            }
120          break;
121    
122        case OPT_STAT_FILE:
123          login_stat_file = arg;
124          break;
125                
126    #endif  
127      default:      default:
128        return ARGP_ERR_UNKNOWN;        return ARGP_ERR_UNKNOWN;
129      }      }
# Line 394  pop3d_mainloop (int fd, FILE *infile, FI Line 425  pop3d_mainloop (int fd, FILE *infile, FI
425        else if (status == ERR_TLS_ACTIVE)        else if (status == ERR_TLS_ACTIVE)
426          pop3d_outf ("-ERR " TLS_ACTIVE "\r\n");          pop3d_outf ("-ERR " TLS_ACTIVE "\r\n");
427  #endif /* WITH_TLS */  #endif /* WITH_TLS */
428          else if (status == ERR_LOGIN_DELAY)
429            pop3d_outf ("-ERR [LOGIN-DELAY] " LOGIN_DELAY "\r\n");
430        else        else
431          pop3d_outf ("-ERR unknown error\r\n");          pop3d_outf ("-ERR unknown error\r\n");
432    

Legend:
Removed from v.1.64  
changed lines
  Added in v.1.65

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26