"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "libs/rfc2045/rfc2045reply.c" between
sqwebmail-5.9.3.tar.bz2 and sqwebmail-6.0.0.tar.bz2

About: SqWebMail is a CGI Webmail client for Maildir mailboxes (module of the Courier mail server).

rfc2045reply.c  (sqwebmail-5.9.3.tar.bz2):rfc2045reply.c  (sqwebmail-6.0.0.tar.bz2)
/* /*
** Copyright 2000-2011 Double Precision, Inc. See COPYING for ** Copyright 2000-2018 Double Precision, Inc. See COPYING for
** distribution information. ** distribution information.
*/ */
#include "rfc2045_config.h" #include "rfc2045_config.h"
#include "rfc2045.h" #include "rfc2045.h"
#include "rfc2045src.h" #include "rfc2045src.h"
#include "rfc3676parser.h" #include "rfc3676parser.h"
#include "rfc822/rfc2047.h" #include "rfc822/rfc2047.h"
#include "rfc2045charset.h" #include "rfc2045charset.h"
#include "rfc822/rfc822.h" #include "rfc822/rfc822.h"
skipping to change at line 776 skipping to change at line 776
/* /*
** There are attachments to copy ** There are attachments to copy
*/ */
if (attachment_is_message_rfc822) if (attachment_is_message_rfc822)
{ {
/* Copy everything as a message/rfc822 */ /* Copy everything as a message/rfc822 */
writes(ri, "\n--"); writes(ri, "\n--");
writes(ri, boundary); writes(ri, boundary);
writes(ri, "\nContent-Type: message/rfc822\n"); writes(ri, "\nContent-Type: ");
writes(ri, first_attachment->rfcviolation &
RFC2045_ERR8BITHEADER
? RFC2045_MIME_MESSAGE_GLOBAL
: RFC2045_MIME_MESSAGE_RFC822);
writes(ri, "\n");
if (ri->forwarddescr) if (ri->forwarddescr)
{ {
char *p=rfc2047_encode_str(ri->forwarddescr, char *p=rfc2047_encode_str(ri->forwarddescr,
ri->charset ? ri->charset ?
ri->charset ri->charset
: "utf-8", : "utf-8",
rfc2047_qp_allow_any rfc2047_qp_allow_any
); );
skipping to change at line 929 skipping to change at line 935
char *oldenvelope; char *oldenvelope;
char *header, *value; char *header, *value;
char *date; char *date;
char *newsgroup; char *newsgroup;
char *newsgroups; char *newsgroups;
char *whowrote; char *whowrote;
off_t start_pos, end_pos, start_body, dummy; off_t start_pos, end_pos, start_body, dummy;
int errflag=0; int errflag=0;
char *boundary; char *boundary;
char *dsn_report_type; const char *dsn_report_type;
int (*dsn_report_gen)(struct rfc2045_mkreplyinfo *); int (*dsn_report_gen)(struct rfc2045_mkreplyinfo *);
struct rfc2045headerinfo *hi; struct rfc2045headerinfo *hi;
oldtocc=0; oldtocc=0;
oldtolist=0; oldtolist=0;
oldfrom=0; oldfrom=0;
oldreplyto=0; oldreplyto=0;
subject=0; subject=0;
oldmsgid=0; oldmsgid=0;
skipping to change at line 1460 skipping to change at line 1466
if (ri->writesig_func) if (ri->writesig_func)
(*ri->writesig_func)(ri->voidarg); (*ri->writesig_func)(ri->voidarg);
writes(ri, "\n"); writes(ri, "\n");
if (boundary) if (boundary)
{ {
/* replydsn or replyfeedback */ /* replydsn or replyfeedback */
writes(ri, "\n--"); writes(ri, "\n--");
writes(ri, boundary); writes(ri, boundary);
writes(ri, "\nContent-Type: message/"); writes(ri, "\n");
writes(ri, dsn_report_type);
writes(ri, "\n"
"Content-Transfer-Encoding: 7bit\n\n");
if (errflag == 0) if (errflag == 0)
errflag=(*dsn_report_gen)(ri); errflag=(*dsn_report_gen)(ri);
writes(ri, "\n--"); writes(ri, "\n--");
writes(ri, boundary); writes(ri, boundary);
if (ri->fullmsg) if (ri->fullmsg)
{ {
off_t cnt=end_pos - start_pos; off_t cnt=end_pos - start_pos;
char buf[BUFSIZ]; char buf[BUFSIZ];
writes(ri, "\nContent-Type: message/rfc822\n" writes(ri, "\nContent-Type: ");
writes(ri, ri->rfc2045partp->rfcviolation &
RFC2045_ERR8BITHEADER
? RFC2045_MIME_MESSAGE_GLOBAL
: RFC2045_MIME_MESSAGE_RFC822);
writes(ri, "\n"
"Content-Disposition: attachment\n\n"); "Content-Disposition: attachment\n\n");
if (errflag == 0) if (errflag == 0)
errflag=SRC_SEEK(ri->src, start_pos); errflag=SRC_SEEK(ri->src, start_pos);
while (errflag == 0 && cnt > 0) while (errflag == 0 && cnt > 0)
{ {
int n=cnt > sizeof(BUFSIZ) ? BUFSIZ:(int)cnt; int n=cnt > sizeof(BUFSIZ) ? BUFSIZ:(int)cnt;
n=SRC_READ(ri->src, buf, n); n=SRC_READ(ri->src, buf, n);
skipping to change at line 1527 skipping to change at line 1536
writes(ri, rfc822_mkdate(now)); writes(ri, rfc822_mkdate(now));
writes(ri, "\n"); writes(ri, "\n");
} }
static void copyheaders(struct rfc2045_mkreplyinfo *ri) static void copyheaders(struct rfc2045_mkreplyinfo *ri)
{ {
struct rfc2045headerinfo *hi; struct rfc2045headerinfo *hi;
char *header, *value; char *header, *value;
writes(ri, "\nContent-Type: text/rfc822-headers; charset=\"utf-8\"\n" writes(ri, "\nContent-Type: ");
if (ri->rfc2045partp->rfcviolation & RFC2045_ERR8BITHEADER)
writes(ri, RFC2045_MIME_MESSAGE_GLOBAL_HEADERS);
else
writes(ri, RFC2045_MIME_MESSAGE_HEADERS);
writes(ri, "; charset=\"utf-8\"\n"
"Content-Disposition: attachment\n" "Content-Disposition: attachment\n"
"Content-Transfer-Encoding: 8bit\n\n" "Content-Transfer-Encoding: 8bit\n\n"
); );
hi=rfc2045header_start(ri->src, ri->rfc2045partp); hi=rfc2045header_start(ri->src, ri->rfc2045partp);
while (hi) while (hi)
{ {
if (rfc2045header_get(hi, &header, &value, if (rfc2045header_get(hi, &header, &value,
RFC2045H_NOLC) || !header) RFC2045H_NOLC) || !header)
skipping to change at line 1579 skipping to change at line 1595
copyheaders(ri); copyheaders(ri);
writes(ri, "\n--"); writes(ri, "\n--");
writes(ri, boundary); writes(ri, boundary);
writes(ri, "--\n"); writes(ri, "--\n");
free(boundary); free(boundary);
return 0; return 0;
} }
static int replydsn(struct rfc2045_mkreplyinfo *ri) static int replydsn(struct rfc2045_mkreplyinfo *ri)
{ {
const char *p;
int is8bit=0;
for (p=ri->dsnfrom; *p; ++p)
if (*p & 0x80)
{
is8bit=1;
break;
}
if (is8bit)
{
writes(ri, "Content-Type: "
RFC2045_MIME_MESSAGE_GLOBAL_DELIVERY_STATUS
"; charset=\"utf-8\"\n");
writes(ri, "Content-Transfer-Encoding: 8bit\n\n");
}
else
{
writes(ri, "Content-Type: "
RFC2045_MIME_MESSAGE_DELIVERY_STATUS
"\n");
writes(ri, "Content-Transfer-Encoding: 7bit\n\n");
}
dsn_arrival_date(ri); dsn_arrival_date(ri);
writes (ri, "\n" writes (ri, "\n"
"Final-Recipient: rfc822; "); "Final-Recipient: rfc822; ");
writes(ri, ri->dsnfrom); writes(ri, ri->dsnfrom);
writes(ri, "\n" writes(ri, "\n"
"Action: delivered\n" "Action: delivered\n"
"Status: 2.0.0\n"); "Status: 2.0.0\n");
return 0; return 0;
} }
static int replyfeedback(struct rfc2045_mkreplyinfo *ri) static int replyfeedback(struct rfc2045_mkreplyinfo *ri)
{ {
size_t i; size_t i;
writes(ri, "Content-Type: message/feedback-report; charset=\"utf-8\"\n");
writes(ri, "Content-Transfer-Encoding: 8bit\n\n");
dsn_arrival_date(ri); dsn_arrival_date(ri);
writes(ri, "User-Agent: librfc2045 " writes(ri, "User-Agent: librfc2045 "
RFC2045PKG "/" RFC2045VER RFC2045PKG "/" RFC2045VER
"\n" "\n"
"Version: 1\n"); "Version: 1\n");
for (i=0; ri->feedbackheaders && for (i=0; ri->feedbackheaders &&
ri->feedbackheaders[i] && ri->feedbackheaders[i+1]; ri->feedbackheaders[i] && ri->feedbackheaders[i+1];
i += 2) i += 2)
{ {
 End of changes. 8 change blocks. 
10 lines changed or deleted 54 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)