|
|
| |
#define ARPADATE_LENGTH 32 /* Current date in RFC format */ | #define ARPADATE_LENGTH 32 /* Current date in RFC format */ |
char arpadate[ARPADATE_LENGTH]; | char arpadate[ARPADATE_LENGTH]; |
char *auth_user = (char)NULL; |
char *auth_user = (char *)NULL; |
char *auth_pass = (char)NULL; |
char *auth_pass = (char *)NULL; |
char *auth_method = (char)NULL; /* Mechanism for SMTP authentication */ |
char *auth_method = (char *)NULL; /* Mechanism for SMTP authentication */ |
char *mail_domain = (char)NULL; |
char *mail_domain = (char *)NULL; |
char *from = (char)NULL; /* Use this as the From: address */ |
char *from = (char *)NULL; /* Use this as the From: address */ |
char *hostname; | char *hostname; |
char *mailhost = "mailhub"; | char *mailhost = "mailhub"; |
char *minus_f = (char)NULL; |
char *minus_f = (char *)NULL; |
char *minus_F = (char)NULL; |
char *minus_F = (char *)NULL; |
char *gecos; | char *gecos; |
char *prog = (char)NULL; |
char *prog = (char *)NULL; |
char *root = NULL; | char *root = NULL; |
char *tls_cert = "/etc/ssl/certs/ssmtp.pem"; /* Default Certificate */ | char *tls_cert = "/etc/ssl/certs/ssmtp.pem"; /* Default Certificate */ |
char *uad = (char)NULL; |
char *uad = (char *)NULL; |
char *config_file = (char)NULL; /* alternate configuration file */ |
char *config_file = (char *)NULL; /* alternate configuration file */ |
| |
headers_t headers, *ht; | headers_t headers, *ht; |
| |
|
|
| |
p = (str + strlen(str)); | p = (str + strlen(str)); |
while(isspace(*--p)) { | while(isspace(*--p)) { |
*p = (char)NULL; |
*p = '\0'; |
} | } |
| |
return(p); | return(p); |
|
|
q++; | q++; |
| |
if((p = strchr(q, '>'))) { | if((p = strchr(q, '>'))) { |
*p = (char)NULL; |
*p = '\0'; |
} | } |
| |
#if 0 | #if 0 |
|
|
q = strip_post_ws(p); | q = strip_post_ws(p); |
if(*q == ')') { | if(*q == ')') { |
while((*--q != '(')); | while((*--q != '(')); |
*q = (char)NULL; |
*q = '\0'; |
} | } |
(void)strip_post_ws(p); | (void)strip_post_ws(p); |
| |
|
|
char *p; | char *p; |
| |
if((p = strchr(str, '\n'))) { | if((p = strchr(str, '\n'))) { |
*p = (char)NULL; |
*p = '\0'; |
} | } |
| |
/* Any line beginning with a dot has an additional dot inserted; | /* Any line beginning with a dot has an additional dot inserted; |
|
|
while(fgets(buf, sizeof(buf), fp)) { | while(fgets(buf, sizeof(buf), fp)) { |
/* Make comments invisible */ | /* Make comments invisible */ |
if((p = strchr(buf, '#'))) { | if((p = strchr(buf, '#'))) { |
*p = (char)NULL; |
*p = '\0'; |
} | } |
| |
/* Ignore malformed lines and comments */ | /* Ignore malformed lines and comments */ |
|
|
die("from_format() -- snprintf() failed"); | die("from_format() -- snprintf() failed"); |
} | } |
} | } |
|
else { |
|
if(snprintf(buf, BUF_SZ, "%s", str) == -1) { |
|
die("from_format() -- snprintf() failed"); |
|
} |
|
} |
} | } |
| |
#if 0 | #if 0 |
|
|
#endif | #endif |
| |
/* Ignore missing usernames */ | /* Ignore missing usernames */ |
if(*str == (char)NULL) { |
if(*str == '\0') { |
return; | return; |
} | } |
| |
|
|
} | } |
| |
/* End of string? */ | /* End of string? */ |
if(*(q + 1) == (char)NULL) { |
if(*(q + 1) == '\0') { |
got_addr = True; | got_addr = True; |
} | } |
| |
|
|
if((*q == ',') && (in_quotes == False)) { | if((*q == ',') && (in_quotes == False)) { |
got_addr = True; | got_addr = True; |
| |
*q = (char)NULL; |
*q = '\0'; |
} | } |
| |
if(got_addr) { | if(got_addr) { |
|
|
if(strncasecmp(ht->string, "From:", 5) == 0) { | if(strncasecmp(ht->string, "From:", 5) == 0) { |
#if 1 | #if 1 |
/* Hack check for NULL From: line */ | /* Hack check for NULL From: line */ |
if(*(p + 6) == (char)NULL) { |
if(*(p + 6) == '\0') { |
return; | return; |
} | } |
#endif | #endif |
|
|
size_t size = BUF_SZ, len = 0; | size_t size = BUF_SZ, len = 0; |
char *p = (char *)NULL, *q; | char *p = (char *)NULL, *q; |
bool_t in_header = True; | bool_t in_header = True; |
char l = (char)NULL; |
char l = '\0'; |
int c; | int c; |
| |
while(in_header && ((c = fgetc(stream)) != EOF)) { | while(in_header && ((c = fgetc(stream)) != EOF)) { |
|
|
in_header = False; | in_header = False; |
| |
default: | default: |
*q = (char)NULL; |
*q = '\0'; |
if((q = strrchr(p, '\n'))) { | if((q = strrchr(p, '\n'))) { |
*q = (char)NULL; |
*q = '\0'; |
} | } |
header_save(p); | header_save(p); |
| |
|
|
in_header = False; | in_header = False; |
| |
default: | default: |
*q = (char)NULL; |
*q = '\0'; |
if((q = strrchr(p, '\n'))) { | if((q = strrchr(p, '\n'))) { |
*q = (char)NULL; |
*q = '\0'; |
} | } |
header_save(p); | header_save(p); |
| |
|
|
char *rightside; | char *rightside; |
/* Make comments invisible */ | /* Make comments invisible */ |
if((p = strchr(buf, '#'))) { | if((p = strchr(buf, '#'))) { |
*p = (char)NULL; |
*p = '\0'; |
} | } |
| |
/* Ignore malformed lines and comments */ | /* Ignore malformed lines and comments */ |
|
|
int i = 0; | int i = 0; |
char c; | char c; |
| |
while((i < size) && (fd_getc(fd, &c) == 1)) { |
while((i < size - 1) && (fd_getc(fd, &c) == 1)) { |
if(c == '\r'); /* Strip <CR> */ | if(c == '\r'); /* Strip <CR> */ |
else if(c == '\n') { | else if(c == '\n') { |
break; | break; |
|
|
buf[i++] = c; | buf[i++] = c; |
} | } |
} | } |
buf[i] = (char)NULL; |
buf[i] = '\0'; |
| |
return(buf); | return(buf); |
} | } |
|
|
j = 0; | j = 0; |
| |
add = 1; | add = 1; |
while(argv[i][++j] != (char)NULL) { |
while(argv[i][++j] != '\0') { |
switch(argv[i][j]) { | switch(argv[i][j]) { |
#ifdef INET6 | #ifdef INET6 |
case '6': | case '6': |