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 |
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; |
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; |
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': |
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. */ |