80 |
int |
int |
81 |
mail_if (int argc, char **argv) |
mail_if (int argc, char **argv) |
82 |
{ |
{ |
83 |
struct mail_env_entry *mode; |
char *mode; |
84 |
int cond; |
int cond; |
85 |
|
|
86 |
if (argc != 2) |
if (argc != 2) |
95 |
return 1; |
return 1; |
96 |
} |
} |
97 |
|
|
98 |
mode = util_find_env("mode"); |
if (util_getenv (&mode, "mode", Mail_env_string, 1)) |
99 |
if (!mode) |
exit (EXIT_FAILURE); |
|
{ |
|
|
exit (EXIT_FAILURE); |
|
|
} |
|
100 |
|
|
101 |
if (if_cond() == 0) |
if (if_cond() == 0) |
102 |
/* Propagate negative condition */ |
/* Propagate negative condition */ |
106 |
switch (argv[1][0]) |
switch (argv[1][0]) |
107 |
{ |
{ |
108 |
case 's': /* Send mode */ |
case 's': /* Send mode */ |
109 |
cond = strcmp(mode->value, "send") == 0; |
cond = strcmp(mode, "send") == 0; |
110 |
break; |
break; |
111 |
case 'r': /* Read mode */ |
case 'r': /* Read mode */ |
112 |
cond = strcmp(mode->value, "send") != 0; |
cond = strcmp(mode, "send") != 0; |
113 |
break; |
break; |
114 |
case 't': /* Reading from a terminal */ |
case 't': /* Reading from a terminal */ |
115 |
cond = interactive; |
cond = interactive; |