}
/* write all the headers */
- if (ctl->mda[0])
+ n = 0;
+ if (sinkfp)
n = fwrite(headers, 1, oldlen, sinkfp);
- else if (sinkfp)
- n = SockWrite(headers, oldlen, sinkfp);
if (n < 0)
{
strcat(errmsg, "\n");
- if (ctl->mda[0])
+ if (sinkfp)
fputs(errmsg, sinkfp);
- else if (sinkfp)
- SockWrite(errmsg, strlen(errmsg), sinkfp);
}
free_str_list(&xmit_names);
/* SMTP byte-stuffing */
if (*bufp == '.' && ctl->mda[0] == 0)
if (sinkfp)
- SockWrite(".", 1, sinkfp);
+ fputs(".", sinkfp);
/* replace all LFs with CR-LF in the line */
if (!ctl->mda[0])
}
/* ship out the text line */
- if (ctl->mda[0])
+ n = 0;
+ if (sinkfp)
n = fwrite(bufp, 1, strlen(bufp), sinkfp);
- else if (sinkfp)
- n = SockWrite(bufp, strlen(bufp), sinkfp);
if (!ctl->mda[0])
free(bufp);
va_end(ap);
strcat(buf, "\r\n");
- SockWrite(buf, strlen(buf), sockfp);
+ fputs(buf, sockfp);
if (outlevel == O_VERBOSE)
{
va_end(ap);
strcat(buf, "\r\n");
- SockWrite(buf, strlen(buf), sockfp);
+ fputs(buf, sockfp);
if (outlevel == O_VERBOSE)
{
char *cp;
{
int ok;
- SockPrintf(sockfp,"HELO %s\r\n", host);
+ fprintf(sockfp,"HELO %s\r\n", host);
if (outlevel == O_VERBOSE)
error(0, 0, "SMTP> HELO %s", host);
ok = SMTP_ok(sockfp);
{
int ok;
- SockPrintf(sockfp,"MAIL FROM:<%s>\r\n", from);
+ fprintf(sockfp,"MAIL FROM:<%s>\r\n", from);
if (outlevel == O_VERBOSE)
error(0, 0, "SMTP> MAIL FROM:<%s>", from);
ok = SMTP_ok(sockfp);
{
int ok;
- SockPrintf(sockfp,"RCPT TO:<%s>\r\n", to);
+ fprintf(sockfp,"RCPT TO:<%s>\r\n", to);
if (outlevel == O_VERBOSE)
error(0, 0, "SMTP> RCPT TO:<%s>", to);
ok = SMTP_ok(sockfp);
{
int ok;
- SockPrintf(sockfp,"DATA\r\n");
+ fprintf(sockfp,"DATA\r\n");
if (outlevel == O_VERBOSE)
error(0, 0, "SMTP> DATA");
ok = SMTP_ok(sockfp);
{
int ok;
- SockPrintf(sockfp,"QUIT\r\n");
+ fprintf(sockfp,"QUIT\r\n");
if (outlevel == O_VERBOSE)
error(0, 0, "SMTP> QUIT");
ok = SMTP_ok(sockfp);
{
int ok;
- SockPrintf(sockfp,".\r\n");
+ fprintf(sockfp,".\r\n");
if (outlevel == O_VERBOSE)
error(0, 0, "SMTP>. (EOM)");
ok = SMTP_ok(sockfp);
*/
int SockGets(char *buf, int len, FILE *sockfp);
-/* Ship a character array to the socket */
-#define SockWrite(buf, len, sockfp) fwrite(buf, 1, len, sockfp)
-
-/*
-Send formatted output to the socket, followed
-by a CR-LF. Returns 0 for success.
-*/
-#define SockPrintf fprintf
-
#endif /* SOCKET__ */