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

Diff of /mailutils/sieve/sieve.c

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

revision 1.43 by gray, Fri Aug 29 19:12:32 2003 UTC revision 1.44 by polak, Fri Sep 5 11:43:48 2003 UTC
# Line 1  Line 1 
1  /* GNU Mailutils -- a suite of utilities for electronic mail  /* GNU Mailutils -- a suite of utilities for electronic mail
2     Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc.     Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
3    
4     GNU Mailutils is free software; you can redistribute it and/or modify     GNU Mailutils is free software; you can redistribute it and/or modify
5     it under the terms of the GNU General Public License as published by     it under the terms of the GNU General Public License as published by
# Line 97  struct options { Line 97  struct options {
97    int compile_only;    int compile_only;
98    char *mbox;    char *mbox;
99    char *tickets;    char *tickets;
100      int tickets_default;
101    int debug_level;    int debug_level;
102    int sieve_debug;    int sieve_debug;
103    int verbose;    int verbose;
# Line 113  parser (int key, char *arg, struct argp_ Line 114  parser (int key, char *arg, struct argp_
114      {      {
115      case ARGP_KEY_INIT:      case ARGP_KEY_INIT:
116        if (!opts->tickets)        if (!opts->tickets)
117          opts->tickets = mu_tilde_expansion ("~/.tickets", "/", NULL);          {
118              opts->tickets = mu_tilde_expansion ("~/.tickets", "/", NULL);
119              opts->tickets_default = 1;
120            }
121        if (!opts->debug_level)        if (!opts->debug_level)
122          opts->debug_level = MU_DEBUG_ERROR;          opts->debug_level = MU_DEBUG_ERROR;
123        log_facility = 0;        log_facility = 0;
# Line 150  parser (int key, char *arg, struct argp_ Line 154  parser (int key, char *arg, struct argp_
154      case 't':      case 't':
155        free (opts->tickets);        free (opts->tickets);
156        opts->tickets = mu_tilde_expansion (arg, "/", NULL);        opts->tickets = mu_tilde_expansion (arg, "/", NULL);
157          opts->tickets_default = 0;
158        break;        break;
159                
160      case 'd':      case 'd':
# Line 367  main (int argc, char *argv[]) Line 372  main (int argc, char *argv[])
372    /* Create a ticket, if we can. */    /* Create a ticket, if we can. */
373    if (opts.tickets)    if (opts.tickets)
374      {      {
375        if ((rc = wicket_create (&wicket, opts.tickets)) != 0)        if ((rc = wicket_create (&wicket, opts.tickets)) == 0)
376          {          {
377            mu_error (_("wicket_create <%s> failed: %s"),            if ((rc = wicket_get_ticket (wicket, &ticket, 0, 0)) != 0)
378                     opts.tickets, mu_strerror (rc));              {
379            goto cleanup;                mu_error (_("ticket_get failed: %s"), mu_strerror (rc));
380          }                goto cleanup;
381        if ((rc = wicket_get_ticket (wicket, &ticket, 0, 0)) != 0)              }
382          {          }
383            mu_error (_("ticket_get failed: %s"), mu_strerror (rc));        else if (!(opts.tickets_default && errno == ENOENT))
384            goto cleanup;          {
385          }            mu_error (_("wicket_create <%s> failed: %s"),
386        sieve_set_ticket (mach, ticket);                      opts.tickets, mu_strerror (rc));
387              goto cleanup;
388            }
389          if (ticket)
390            sieve_set_ticket (mach, ticket);
391      }      }
392    
393    /* Create a debug object, if needed. */    /* Create a debug object, if needed. */

Legend:
Removed from v.1.43  
changed lines
  Added in v.1.44

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