View | Details | Raw Unified | Return to bug 4405
Collapse All | Expand All

(-)spamc.c (-5 / +15 lines)
Lines 161-166 Link Here
161
    usg("  -h                  Print this help message and exit.\n");
161
    usg("  -h                  Print this help message and exit.\n");
162
    usg("  -V                  Print spamc version and exit.\n");
162
    usg("  -V                  Print spamc version and exit.\n");
163
    usg("  -f                  (Now default, ignored.)\n");
163
    usg("  -f                  (Now default, ignored.)\n");
164
    usg("  -z path             Specify a Path to the user_prefs directory.\n");
164
    usg("\n");
165
    usg("\n");
165
}
166
}
166
167
Lines 173-185 Link Here
173
 */
174
 */
174
int
175
int
175
read_args(int argc, char **argv,
176
read_args(int argc, char **argv,
176
          int *max_size, char **username,
177
          int *max_size, char **username, char **userprefs,
177
          struct transport *ptrn)
178
          struct transport *ptrn)
178
{
179
{
179
#ifndef _WIN32
180
#ifndef _WIN32
180
    const char *opts = "-BcrRd:e:fyp:t:s:u:xSHU:ElhV";
181
    const char *opts = "-BcrRd:e:fyp:t:s:u:z:xSHU:ElhV";
181
#else
182
#else
182
    const char *opts = "-BcrRd:fyp:t:s:u:xSHElhV";
183
    const char *opts = "-BcrRd:fyp:t:s:u:z:xSHElhV";
183
#endif
184
#endif
184
    int opt;
185
    int opt;
185
    int ret = EX_OK;
186
    int ret = EX_OK;
Lines 280-285 Link Here
280
                *username = optarg;
281
                *username = optarg;
281
                break;
282
                break;
282
            }
283
            }
284
            case 'z':
285
            {
286
                *userprefs = optarg;
287
		break;
288
            }
283
#ifndef _WIN32
289
#ifndef _WIN32
284
            case 'U':
290
            case 'U':
285
            {
291
            {
Lines 455-460 Link Here
455
{
461
{
456
    int max_size;
462
    int max_size;
457
    char *username;
463
    char *username;
464
    char *userprefs;
458
    struct transport trans;
465
    struct transport trans;
459
    struct message m;
466
    struct message m;
460
    int out_fd = -1;
467
    int out_fd = -1;
Lines 476-482 Link Here
476
   /* Now parse the command line arguments. First, set the defaults. */
483
   /* Now parse the command line arguments. First, set the defaults. */
477
   max_size = 250 * 1024;
484
   max_size = 250 * 1024;
478
   username = NULL;
485
   username = NULL;
479
   if ((ret = read_args(argc, argv, &max_size, &username, &trans)) != EX_OK) {
486
   userprefs = NULL;
487
   if ((ret = read_args(argc, argv, &max_size, &username, &userprefs, &trans)) != EX_OK) {
480
       if (ret == EX_TEMPFAIL )
488
       if (ret == EX_TEMPFAIL )
481
           ret = EX_OK;
489
           ret = EX_OK;
482
       goto finish;
490
       goto finish;
Lines 518-525 Link Here
518
	
526
	
519
	if (ret == EX_OK) {
527
	if (ret == EX_OK) {
520
	    
528
	    
521
	    ret = message_filter(&trans, username, flags, &m);
529
	    ret = message_filter(&trans, username, userprefs, flags, &m);
522
	    free(username); username = NULL;
530
	    free(username); username = NULL;
531
            free(userprefs); userprefs = NULL;
523
	    
532
	    
524
	    if (ret == EX_OK) {
533
	    if (ret == EX_OK) {
525
		get_output_fd(&out_fd);
534
		get_output_fd(&out_fd);
Lines 543-548 Link Here
543
	}
552
	}
544
    }
553
    }
545
    free(username);
554
    free(username);
555
    free(userprefs);
546
556
547
/* FAIL: */
557
/* FAIL: */
548
    get_output_fd(&out_fd);
558
    get_output_fd(&out_fd);

Return to bug 4405