From dc6c0f8d846e14fc6841516ad772553fc5975bd6 Mon Sep 17 00:00:00 2001 From: Eduardo Chappa Date: Mon, 4 Feb 2013 23:48:14 -0700 Subject: Fix SMTP bug --- imap/src/c-client/smtp.c | 28 +++++++++++++++------------- pith/pine.hlp | 31 +++++++++++++++++++++++++------ 2 files changed, 40 insertions(+), 19 deletions(-) diff --git a/imap/src/c-client/smtp.c b/imap/src/c-client/smtp.c index 0a3cf489..1b748b71 100644 --- a/imap/src/c-client/smtp.c +++ b/imap/src/c-client/smtp.c @@ -420,34 +420,36 @@ SENDSTREAM *smtp_close (SENDSTREAM *stream) long smtp_mail (SENDSTREAM *stream,char *type,ENVELOPE *env,BODY *body) { RFC822BUFFER buf; - char tmp[SENDBUFLEN+1]; + char tmp[SENDBUFLEN+1], smtpserver[SENDBUFLEN+1]; long error = NIL; long retry = NIL; buf.f = smtp_soutr; /* initialize buffer */ buf.s = stream->netstream; buf.end = (buf.beg = buf.cur = tmp) + SENDBUFLEN; tmp[SENDBUFLEN] = '\0'; /* must have additional null guard byte */ + smtpserver[SENDBUFLEN] = '\0'; if (!(env->to || env->cc || env->bcc)) { /* no recipients in request */ smtp_seterror (stream,SMTPHARDERROR,"No recipients specified"); return NIL; } - do { /* make sure stream is in good shape */ + /* get this now in case the rug is pulled from under us */ + sprintf (smtpserver,"{%.200s/smtp%s}", + (long) mail_parameters (NIL,GET_TRUSTDNS,NIL) ? + ((long) mail_parameters (NIL,GET_SASLUSESPTRNAME,NIL) ? + net_remotehost (stream->netstream) : + net_host (stream->netstream)) : + stream->host, + (stream->netstream->dtb == + (NETDRIVER *) mail_parameters (NIL,GET_SSLDRIVER,NIL)) ? + "/ssl" : ""); + do { smtp_send (stream,"RSET",NIL); if (retry) { /* need to retry with authentication? */ NETMBX mb; /* yes, build remote name for authentication */ - sprintf (tmp,"{%.200s/smtp%s}", - (long) mail_parameters (NIL,GET_TRUSTDNS,NIL) ? - ((long) mail_parameters (NIL,GET_SASLUSESPTRNAME,NIL) ? - net_remotehost (stream->netstream) : - net_host (stream->netstream)) : - stream->host, - (stream->netstream->dtb == - (NETDRIVER *) mail_parameters (NIL,GET_SSLDRIVER,NIL)) ? - "/ssl" : ""); - mail_valid_net_parse (tmp,&mb); - if (!smtp_auth (stream,&mb,tmp)) return NIL; + mail_valid_net_parse (smtpserver,&mb); + if (!smtp_auth (stream,&mb,smtpserver)) return NIL; retry = NIL; /* no retry at this point */ } diff --git a/pith/pine.hlp b/pith/pine.hlp index 3af1062e..b4cb5283 100644 --- a/pith/pine.hlp +++ b/pith/pine.hlp @@ -3,8 +3,8 @@ # T H E A L P I N E M E S S A G E S Y S T E M # #/* ======================================================================== -# * Copyright 2006-2008 University of Washington # * Copyright 2013 Eduardo Chappa +# * Copyright 2006-2008 University of Washington # * # * Licensed under the Apache License, Version 2.0 (the "License"); # * you may not use this file except in compliance with the License. @@ -155,8 +155,8 @@ Version () (built ) -
Copyright 2006-2008 University of Washington
Copyright 2013 Eduardo Chappa +
Copyright 2006-2008 University of Washington

@@ -179,6 +179,25 @@ addresses bugs found in previous releases and has a few additions as well. Additions include:

+

    +
  • Quota command includes subcommands for printing, forwarding, etc. +
+ +

+Bugs that have been addressed include: +

+

    +
  • Crash when a non-compliant SMTP server closes a connection without a LOGOUT +
+ +

+Version 2.10 addresses bugs found in previous releases and has a few +additions as well. + +

+Additions include: +

+

  • Quota report for IMAP folders that support it (press the "@" command in the index screen of such folder).
  • Search a folder for the content of any header with the ";" command. @@ -544,8 +563,8 @@ page at
    http://www.washington.edu/alpine/credits

    -Alpine Copyright 2006-2008 University of Washington, -Copyright 2013 Eduardo Chappa. +Alpine Copyright 2013 Eduardo Chappa, +Copyright 2006-2008 University of Washington.

    Additional legal notices can be found here @@ -1415,8 +1434,8 @@ Version
    (built ) -

    Copyright 2006-2008 University of Washington -
    Copyright 2013 Eduardo Chappa +
    Copyright 2013 Eduardo Chappa, +
    Copyright 2006-2008 University of Washington.

    -- cgit v1.2.3-54-g00ecf