boundary was the very last line of the message.
* serv_smtp.c: toned down some of the command response verbage.
$Log$
+ Revision 573.133 2001/05/18 20:12:09 ajc
+ * Fixed bug in mime_parser.c that caused parts to be dropped when the last
+ boundary was the very last line of the message.
+ * serv_smtp.c: toned down some of the command response verbage.
+
Revision 573.132 2001/04/28 04:42:55 ajc
* Updated some of the docs. Bumped version number to 5.80 in anticipation
of going into a release cycle soon.
Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
* Initial CVS import
-
{
char ch;
char *ptr;
+ int len = 0; /* tally our own length to avoid strlen() delays */
ptr = start;
memset(buf, 0, maxlen);
while (1) {
ch = *ptr++;
- if ((ch == 10) || (ch == 0)) {
- if (strlen(buf) > 0)
- if (buf[strlen(buf) - 1] == 13)
- buf[strlen(buf) - 1] = 0;
- return ptr;
- }
- if (strlen(buf) < (maxlen - 1)) {
+ if ( (len < (maxlen - 1)) && (ch != 13) && (ch != 10) ) {
buf[strlen(buf) + 1] = 0;
buf[strlen(buf)] = ch;
+ ++len;
+ }
+ if ((ch == 10) || (ch == 0)) {
+ return ptr;
}
}
}
do {
part_end = ptr;
ptr = memreadline(ptr, buf, sizeof buf);
- if (*ptr == 0) goto END_MULTI; /* premature end */
if (content_end != NULL)
if (ptr >= content_end) goto END_MULTI;
- if ((!strcasecmp(buf, startary))
- || (!strcasecmp(buf, endary))) {
+
+ if ( (!strcasecmp(buf, startary))
+ || (!strcasecmp(buf, endary)) ) {
if (part_start != NULL) {
if (strlen(partnum) > 0) {
sprintf(nested_partnum, "%s.%d",
}
part_start = ptr;
}
- } while (strcasecmp(buf, endary));
+ } while ( (strcasecmp(buf, endary)) && (ptr != 0) );
END_MULTI: if (PostMultiPartCallBack != NULL) {
PostMultiPartCallBack("", "", partnum, "", NULL,
content_type, 0, encoding, userdata);
CtdlAllocUserData(SYM_SMTP_RECP, SIZ);
sprintf(SMTP_RECP, "%s", "");
- cprintf("220 Welcome to the Citadel/UX ESMTP server at %s\r\n",
+ cprintf("220 Citadel/UX ESMTP server at %s ready.\r\n",
config.c_fqdn);
}
* Implement HELP command.
*/
void smtp_help(void) {
- cprintf("214-Here's the frequency, Kenneth:\r\n");
+ cprintf("214-Commands accepted:\r\n");
cprintf("214- DATA\r\n");
cprintf("214- EHLO\r\n");
cprintf("214- EXPN\r\n");
cprintf("214- RCPT\r\n");
cprintf("214- RSET\r\n");
cprintf("214- VRFY\r\n");
- cprintf("214 I could tell you more, but then I'd have to kill you.\r\n");
+ cprintf("214 \r\n");
}
case rfc822_address_nonlocal:
if (SMTP->message_originated_locally == 0) {
- cprintf("551 Relaying denied\r\n");
+ cprintf("551 Third-party relaying denied.\r\n");
}
else {
cprintf("250 Remote recipient %s ok\r\n", recp);
CtdlFreeMessage(msg);
if (!retval) {
- cprintf("250 Message accepted for delivery.\r\n");
+ cprintf("250 ok terrific\r\n");
}
else {
cprintf("550 Internal delivery errors: %d\r\n", retval);
}
else {
- cprintf("502 I'm sorry Dave, I'm afraid I can't do that.\r\n");
+ cprintf("502 I'm afraid I can't do that.\r\n");
}
}