diff options
Diffstat (limited to 'smtpd/enqueue.c')
-rw-r--r-- | smtpd/enqueue.c | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/smtpd/enqueue.c b/smtpd/enqueue.c index 2254a74c..4c959a6c 100644 --- a/smtpd/enqueue.c +++ b/smtpd/enqueue.c @@ -141,7 +141,7 @@ qp_encoded_write(FILE *fp, char *buf, size_t len) fprintf(fp, "=3D"); else if (*buf == ' ' || *buf == '\t') { char *p = buf; - + while (*p != '\n') { if (*p != ' ' && *p != '\t') break; @@ -226,7 +226,7 @@ enqueue(int argc, char *argv[]) build_from(fake_from, pw); - while(argc > 0) { + while (argc > 0) { rcpt_add(argv[0]); argv++; argc--; @@ -279,7 +279,7 @@ enqueue(int argc, char *argv[]) if (!msg.saw_from) send_line(fout, 0, "From: %s%s<%s>\n", msg.fromname ? msg.fromname : "", - msg.fromname ? " " : "", + msg.fromname ? " " : "", msg.from); /* add Date */ @@ -296,14 +296,17 @@ enqueue(int argc, char *argv[]) if (!msg.saw_mime_version) send_line(fout, 0, "MIME-Version: 1.0\n"); if (!msg.saw_content_type) - send_line(fout, 0, "Content-Type: text/plain; charset=unknown-8bit\n"); + send_line(fout, 0, "Content-Type: text/plain; " + "charset=unknown-8bit\n"); if (!msg.saw_content_disposition) send_line(fout, 0, "Content-Disposition: inline\n"); if (!msg.saw_content_transfer_encoding) - send_line(fout, 0, "Content-Transfer-Encoding: quoted-printable\n"); + send_line(fout, 0, "Content-Transfer-Encoding: " + "quoted-printable\n"); } if (!msg.saw_user_agent) - send_line(fout, 0, "User-Agent: OpenSMTPD enqueuer (Demoosh)\n"); + send_line(fout, 0, "User-Agent: OpenSMTPD enqueuer (%s)\n", + "Demoosh"); /* add separating newline */ if (noheader) @@ -329,7 +332,8 @@ enqueue(int argc, char *argv[]) line = buf; - if (msg.saw_content_transfer_encoding || noheader || inheaders || !msg.need_linesplit) { + if (msg.saw_content_transfer_encoding || noheader || + inheaders || !msg.need_linesplit) { send_line(fout, 0, "%.*s", (int)len, line); if (inheaders && buf[0] == '\n') inheaders = 0; @@ -343,7 +347,8 @@ enqueue(int argc, char *argv[]) break; } else { - qp_encoded_write(fout, line, LINESPLIT - 2 - dotted); + qp_encoded_write(fout, line, + LINESPLIT - 2 - dotted); send_line(fout, 0, "=\n"); line += LINESPLIT - 2 - dotted; len -= LINESPLIT - 2 - dotted; @@ -351,10 +356,10 @@ enqueue(int argc, char *argv[]) } while (len); } send_line(fout, verbose, ".\n"); - get_responses(fout, 1); + get_responses(fout, 1); send_line(fout, verbose, "QUIT\n"); - get_responses(fout, 1); + get_responses(fout, 1); fclose(fp); fclose(fout); @@ -373,7 +378,7 @@ get_responses(FILE *fin, int n) if ((e = ferror(fin))) errx(1, "ferror: %i", e); - while(n) { + while (n) { buf = fgetln(fin, &len); if (buf == NULL && ferror(fin)) err(1, "fgetln"); @@ -575,7 +580,7 @@ parse_addr(char *s, size_t len, int is_from) if (!pstate.comment && !pstate.quote && !pstate.esc) { if (s[pos] == ':') { /* group */ - for(pos++; pos < len && WSP(s[pos]); pos++) + for (pos++; pos < len && WSP(s[pos]); pos++) ; /* nothing */ pstate.wpos = 0; } @@ -634,7 +639,7 @@ parse_addr_terminal(int is_from) else rcpt_add(pstate.buf); pstate.wpos = 0; - } + } } static char * |