diff options
author | Eduardo Chappa <chappa@washington.edu> | 2014-12-07 19:42:37 -0700 |
---|---|---|
committer | Eduardo Chappa <chappa@washington.edu> | 2014-12-07 19:42:37 -0700 |
commit | 20d433c77e32dc05c2accf8ab943c2a7d9738239 (patch) | |
tree | 4cf7be2b55ec529067a2867eb29ebcfe6c5758aa /pith/reply.c | |
parent | 121a42f3d82c1b98c384857960d14b2057a95c41 (diff) | |
download | alpine-20d433c77e32dc05c2accf8ab943c2a7d9738239.tar.xz |
* new version 2.19.9993
* Aggregate operations allows bouncing a list of messages using a role.
Suggested by Ulf-Dietrich Braumann.
* Compilation error of module pith/reply.c if SMIME is not defined (as in
Windows Alpine). There was a misplaced parenthesis.
* Update to S/MIME to explain how to use a PKCS12 certificate in
Alpine.
* Fix error in compare_certs function, that would modify the name of
the certificates after sorting them, and return when no certificates
are given.
* When replying to several messages, subject will be decoded first,
and then stripped from re/fwd before they are compared to determine
the subject of the replied message.
* Add $(LIBINTL) to the flags to link rpdump, rpload, alpined and
alpineldap because MAC OSX 10.8 x86_64 needs it.
* When the download of an attachment is interrumpted, Alpine stills
caches what was downloaded, making the download incomplete for
subsequent calls of Alpine attempting to open the attachment. In the
future, Alpine will not cache any downloaded part of the attachment
when it is interrupted.
Diffstat (limited to 'pith/reply.c')
-rw-r--r-- | pith/reply.c | 37 |
1 files changed, 35 insertions, 2 deletions
diff --git a/pith/reply.c b/pith/reply.c index ec8293db..0b3aaa62 100644 --- a/pith/reply.c +++ b/pith/reply.c @@ -67,6 +67,39 @@ int (*pith_opt_reply_to_all_prompt)(int *); char *(*pith_opt_user_agent_prefix)(void); +/* compare two subjects and return if they are the same. + We compare stripped subjects, that is, those that do + not have re/fwd. Before we compare the subjects, we + decode them in case they were encoded. + Return value: 0 - not the same subject, 1 - same subject. +*/ + +int +same_subject(char *s, char *t) +{ + int rv = 0; + int i, j, len; + char *s1, *s2; /* holds decoded subjects from s and t */ + char *u, *v; + + if (s == NULL || t == NULL) + return s == t ? 1 : 0; + + i = strlen(s); j = strlen(t); + len = i < j ? j : i; + u = fs_get(6*len+1); + v = fs_get(6*len+1); + s1 = (char *) rfc1522_decode_to_utf8(u, 6*len + 1, s); + s2 = (char *) rfc1522_decode_to_utf8(v, 6*len + 1, t); + mail_strip_subject(s1, &u); + mail_strip_subject(s2, &v); + + rv = !strucmp(u, v); + + fs_give((void **) &u); + fs_give((void **) &v); + return rv; +} /* * reply_harvest - @@ -2259,9 +2292,9 @@ forward_body(MAILSTREAM *stream, ENVELOPE *env, struct mail_bodystruct *orig_bod && orig_body->nested.part->body.subtype && (!strucmp(orig_body->nested.part->body.subtype, OUR_PKCS7_ENCLOSURE_SUBTYPE) || !strucmp(orig_body->nested.part->body.subtype, "signed"))) - || !strucmp(orig_body->subtype, OUR_PKCS7_ENCLOSURE_SUBTYPE)) + || !strucmp(orig_body->subtype, OUR_PKCS7_ENCLOSURE_SUBTYPE) #endif /* SMIME */ - ){ + )){ /* only operate on the signed data (not the signature) */ body = forward_body(stream, env, &orig_body->nested.part->body, msgno, |