/[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.27 by gray, Tue Nov 19 13:48:40 2002 UTC revision 1.28 by gray, Wed Nov 20 12:31:19 2002 UTC
# Line 77  static struct argp_option options[] = Line 77  static struct argp_option options[] =
77    {"ticket", 't', "TICKET", 0,    {"ticket", 't', "TICKET", 0,
78     "Ticket file for mailbox authentication", 0},     "Ticket file for mailbox authentication", 0},
79    
   {"mailer-url", 'M', "MAILER", 0,  
    "Mailer URL (defaults to \"sendmail:\"). Use `--mailer-url none' to disable creating the mailer (it will disable reject and redirect actions as well)", 0},  
   
80    {"debug", 'd', "FLAGS", OPTION_ARG_OPTIONAL,    {"debug", 'd', "FLAGS", OPTION_ARG_OPTIONAL,
81     "Debug flags (defaults to \"" D_DEFAULT "\")", 0},     "Debug flags (defaults to \"" D_DEFAULT "\")", 0},
82    
# Line 100  struct options { Line 97  struct options {
97    int debug_level;    int debug_level;
98    int sieve_debug;    int sieve_debug;
99    int verbose;    int verbose;
   char *mailer;  
100    char *script;    char *script;
101  };  };
102    
# Line 115  parser (int key, char *arg, struct argp_ Line 111  parser (int key, char *arg, struct argp_
111      case ARGP_KEY_INIT:      case ARGP_KEY_INIT:
112        if (!opts->tickets)        if (!opts->tickets)
113          opts->tickets = mu_tilde_expansion ("~/.tickets", "/", NULL);          opts->tickets = mu_tilde_expansion ("~/.tickets", "/", NULL);
       if (!opts->mailer)  
         opts->mailer = strdup ("sendmail:");  
114        if (!opts->debug_level)        if (!opts->debug_level)
115          opts->debug_level = MU_DEBUG_ERROR;          opts->debug_level = MU_DEBUG_ERROR;
116        log_facility = 0;        log_facility = 0;
# Line 155  parser (int key, char *arg, struct argp_ Line 149  parser (int key, char *arg, struct argp_
149        opts->tickets = mu_tilde_expansion (arg, "/", NULL);        opts->tickets = mu_tilde_expansion (arg, "/", NULL);
150        break;        break;
151                
     case 'M':  
       free (opts->mailer);  
       opts->mailer = strdup (arg);  
       break;  
         
152      case 'd':      case 'd':
153        if (!arg)        if (!arg)
154          arg = D_DEFAULT;          arg = D_DEFAULT;
# Line 228  static const char *sieve_argp_capa[] = Line 217  static const char *sieve_argp_capa[] =
217    "mailbox",    "mailbox",
218    "license",    "license",
219    "logging",    "logging",
220      "mailer",
221    NULL    NULL
222  };  };
223    
# Line 309  main (int argc, char *argv[]) Line 299  main (int argc, char *argv[])
299    wicket_t wicket = 0;    wicket_t wicket = 0;
300    ticket_t ticket = 0;    ticket_t ticket = 0;
301    mu_debug_t debug = 0;    mu_debug_t debug = 0;
   mailer_t mailer = 0;  
302    mailbox_t mbox = 0;    mailbox_t mbox = 0;
303    int rc;    int rc;
304    struct options opts = {0};    struct options opts = {0};
# Line 401  main (int argc, char *argv[]) Line 390  main (int argc, char *argv[])
390        
391    sieve_set_debug_level (mach, debug, opts.sieve_debug);    sieve_set_debug_level (mach, debug, opts.sieve_debug);
392            
   /* Create a mailer. */  
   if (strcmp (opts.mailer, "none"))  
     {  
       if ((rc = mailer_create (&mailer, opts.mailer)))  
         {  
           mu_error ("mailer create <%s> failed: %s\n",  
                    opts.mailer, mu_errstring (rc));  
           goto cleanup;  
         }  
       if (debug && (rc = mailer_set_debug (mailer, debug)))  
         {  
           mu_error ("mailer_set_debug failed: %s\n",  
                    mu_errstring (rc));  
           goto cleanup;  
         }  
       sieve_set_mailer (mach, mailer);  
     }  
393    /* Create, give a ticket to, and open the mailbox. */    /* Create, give a ticket to, and open the mailbox. */
394    if ((rc = mailbox_create_default (&mbox, opts.mbox)) != 0)    if ((rc = mailbox_create_default (&mbox, opts.mbox)) != 0)
395      {      {

Legend:
Removed from v.1.27  
changed lines
  Added in v.1.28

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