diff options
author | Eric S. Raymond <esr@thyrsus.com> | 1996-09-11 23:24:07 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 1996-09-11 23:24:07 +0000 |
commit | 1ccd1ef3797c85d2af2afa6489dede3d6654aa94 (patch) | |
tree | 3e8b75a5d807afc9013b0c860a39c9c99e1baf57 /smtp.c | |
parent | b2ed4d15f7bb1c53e5be028ffd4203aa3e0ce299 (diff) | |
download | fetchmail-1ccd1ef3797c85d2af2afa6489dede3d6654aa94.tar.gz fetchmail-1ccd1ef3797c85d2af2afa6489dede3d6654aa94.tar.bz2 fetchmail-1ccd1ef3797c85d2af2afa6489dede3d6654aa94.zip |
SMTP forwarding complete; now to debug it.
svn path=/trunk/; revision=82
Diffstat (limited to 'smtp.c')
-rw-r--r-- | smtp.c | 29 |
1 files changed, 23 insertions, 6 deletions
@@ -48,8 +48,7 @@ int SMTP_helo(int socket,char *host) arguments: socket TCP/IP socket for connection to SMTP - fromuser: user name of originator - fromhost: host name of originator. + from user name/host of originator Note: these args are likely to change, as we get fancier about handling the names. @@ -57,11 +56,11 @@ int SMTP_helo(int socket,char *host) return value: Result of SMTP_ok: based on codes in popclient.h. *********************************************************************/ -int SMTP_from(int socket,char *fromuser,char *fromhost) +int SMTP_from(int socket,char *from) { char buf[SMTPBUFSIZE]; /* it's as good as size as any... */ int ok; - SockPrintf(socket,"MAIL FROM %s@%s\n",fromuser,fromhost); + SockPrintf(socket, "MAIL FROM %s\n", from); ok = SMTP_ok(socket,buf); return ok; @@ -80,12 +79,12 @@ int SMTP_from(int socket,char *fromuser,char *fromhost) return value: Result of SMTP_OK: based on codes in popclient.h. *********************************************************************/ -int SMTP_rcpt(int socket,char *touser, char *tohost) +int SMTP_rcpt(int socket,char *to) { char buf[SMTPBUFSIZE]; /* it's as good as size as any... */ int ok; - SockPrintf(socket,"RCPT TO: %s@%s\n",touser,tohost); + SockPrintf(socket, "RCPT TO: %s\n", to); ok = SMTP_ok(socket,buf); return ok; @@ -105,6 +104,24 @@ int SMTP_data(int socket) SockPrintf(socket,"DATA\n"); } +/********************************************************************* + function: SMTP_eom + description: Send a message data termination to the SMTP server. + + arguments: + socket TCP/IP socket for connection to SMTP + return value: Result of SMTP_OK: based on codes in popclient.h. + + *********************************************************************/ + +int SMTP_eom(int socket) +{ + int ok; + + SockPuts(socket,"."); + ok = SMTP_ok(socket,NULL); + return ok; +} /********************************************************************* function: SMTP_rset |