Msg->HostLookup.DNSReplyFree(Msg->HostLookup.VParsedDNSReply);
FreeURL(&Msg->Relay);
FreeStrBuf(&Msg->msgtext);
+ FreeStrBuf(&Msg->MultiLineBuf);
FreeAsyncIOContents(&Msg->IO);
memset (Msg, 0, sizeof(SmtpOutMsg)); /* just to be shure... */
free(Msg);
if (StrLength(IO->IOBuf) < 4)
continue;
if (ChrPtr(IO->IOBuf)[3] == '-')
+ {
+ SmtpOutMsg *Msg;
+ Msg = (SmtpOutMsg *)IO->Data;
+ if (Msg->MultiLineBuf == NULL)
+ Msg->MultiLineBuf = NewStrBuf ();
+ else
+ StrBufAppendBufPlain(Msg->MultiLineBuf, HKEY("\n"), 0);
+ StrBufAppendBuf(Msg->MultiLineBuf, IO->IOBuf, 0);
Finished = eBufferNotEmpty;
+ }
else
return Finished;
break;
{
if (strstr(ChrPtr(Msg->IO.IOBuf), "LOGIN") != NULL)
Msg->SendLogin = 1;
+ else if ((Msg->MultiLineBuf != NULL) &&
+ strstr(ChrPtr(Msg->MultiLineBuf), "LOGIN") != NULL)
+ {
+ Msg->SendLogin = 1;
+ }
}
}
/* else we fall back to 'helo' */
encodedlen = CtdlEncodeBase64(
encoded,
- Msg->pCurrRelay->User,
- strlen(Msg->pCurrRelay->User),
+ Msg->pCurrRelay->Pass,
+ strlen(Msg->pCurrRelay->Pass),
0);
StrBufPlain(Msg->IO.SendBuf.Buf,
ParsedURL *pCurrRelay;
StrBuf *msgtext;
StrBuf *QMsgData;
+ StrBuf *MultiLineBuf;
const char *envelope_from;
char user[1024];
}
#endif
+static inline int XMPP_GetUtf8SequenceLength(const char *CharS, const char *CharE)
+{
+ /* if this is is migrated to strbuf, remove this copy. */
+ int n = 0;
+ unsigned char test = (1<<7);
+
+ if ((*CharS & 0xC0) != 0xC0)
+ return 1;
+
+ while ((n < 8) &&
+ ((test & ((unsigned char)*CharS)) != 0))
+ {
+ test = test >> 1;
+ n ++;
+ }
+ if ((n > 6) || ((CharE - CharS) < n))
+ n = 0;
+ return n;
+}
/*
char *xmlesc(char *buf, char *str, int bufsiz)
{
char *ptr;
+ char *eiptr;
unsigned char ch;
+ int inlen;
int len = 0;
+ int IsUtf8Sequence;
if (!buf) return(NULL);
buf[0] = 0;
return(buf);
}
+ inlen = strlen(str);
+ eiptr = str + inlen;
+
for (ptr=str; *ptr; ptr++) {
ch = *ptr;
if (ch == '<') {
buf[len] = 0;
}
else {
- char oct[10];
- sprintf(oct, "&#%o;", ch);
- strcpy(&buf[len], oct);
- len += strlen(oct);
+ char oct[32];
+
+ IsUtf8Sequence = XMPP_GetUtf8SequenceLength(&buf[len], eiptr);
+ if (IsUtf8Sequence)
+ {
+ while (IsUtf8Sequence > 0){
+ buf[len] = *ptr;
+ len ++;
+ if (--IsUtf8Sequence)
+ ptr++;
+ }
+ buf[len] = '\0';
+ }
+ else
+ {
+ sprintf(oct, "&#%o;", ch);
+ strcpy(&buf[len], oct);
+ len += strlen(oct);
+ }
}
if ((len + 6) > bufsiz) {
return(buf);
./bootstrap
-export `grep PACKAGE_VERSION= configure |sed -e "s;';;g" -e "s;PACKAGE;LIBCITADEL;" -e "s;3.;;"`
+export `grep PACKAGE_VERSION= configure |sed -e "s;';;g" -e "s;PACKAGE;LIBCITADEL;" -e "s;4.;;"`
DATE=`date '+%a, %d %b %Y %H:%I:00 %z'`
ACTUAL_DIR=`pwd`