projects
/
apps
/
madmutt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
simplify parse_parameters tokenizer
[apps/madmutt.git]
/
sendlib.c
diff --git
a/sendlib.c
b/sendlib.c
index
761054b
..
02d0ee0
100644
(file)
--- a/
sendlib.c
+++ b/
sendlib.c
@@
-29,7
+29,7
@@
#include "copy.h"
#include "pager.h"
#include "charset.h"
#include "copy.h"
#include "pager.h"
#include "charset.h"
-#include
"mutt_crypt.h"
+#include
<lib-crypt/crypt.h>
#include "mutt_idna.h"
#include "lib/debug.h"
#include "mutt_idna.h"
#include "lib/debug.h"
@@
-363,9
+363,7
@@
int mutt_write_mime_header (BODY * a, FILE * f)
return (ferror (f) ? -1 : 0);
}
return (ferror (f) ? -1 : 0);
}
-# define write_as_text_part(a) (mutt_is_text_part(a) \
- || ((WithCrypto & APPLICATION_PGP)\
- && mutt_is_application_pgp(a)))
+# define write_as_text_part(a) (mutt_is_text_part(a) || mutt_is_application_pgp(a))
int mutt_write_mime_body (BODY * a, FILE * f)
{
int mutt_write_mime_body (BODY * a, FILE * f)
{
@@
-398,9
+396,7
@@
int mutt_write_mime_body (BODY * a, FILE * f)
}
/* This is pretty gross, but it's the best solution for now... */
}
/* This is pretty gross, but it's the best solution for now... */
- if ((WithCrypto & APPLICATION_PGP)
- && a->type == TYPEAPPLICATION
- && m_strcmp(a->subtype, "pgp-encrypted") == 0) {
+ if (a->type == TYPEAPPLICATION && !m_strcmp(a->subtype, "pgp-encrypted")) {
fputs ("Version: 1\n", f);
return 0;
}
fputs ("Version: 1\n", f);
return 0;
}
@@
-1180,14
+1176,12
@@
BODY *mutt_make_message_attach (CONTEXT * ctx, HEADER * hdr, int attach_msg)
BODY *body;
FILE *fp;
int cmflags, chflags;
BODY *body;
FILE *fp;
int cmflags, chflags;
- int pgp =
WithCrypto ? hdr->security : 0
;
+ int pgp =
hdr->security
;
- if (WithCrypto) {
- if ((option (OPTMIMEFORWDECODE) || option (OPTFORWDECRYPT)) &&
- (hdr->security & ENCRYPT)) {
- if (!crypt_valid_passphrase (hdr->security))
- return (NULL);
- }
+ if ((option (OPTMIMEFORWDECODE) || option (OPTFORWDECRYPT)) &&
+ (hdr->security & ENCRYPT)) {
+ if (!crypt_valid_passphrase (hdr->security))
+ return (NULL);
}
mutt_mktemp (buffer);
}
mutt_mktemp (buffer);
@@
-1212,26
+1206,20
@@
BODY *mutt_make_message_attach (CONTEXT * ctx, HEADER * hdr, int attach_msg)
if (!attach_msg && option (OPTMIMEFORWDECODE)) {
chflags |= CH_MIME | CH_TXTPLAIN;
cmflags = M_CM_DECODE | M_CM_CHARCONV;
if (!attach_msg && option (OPTMIMEFORWDECODE)) {
chflags |= CH_MIME | CH_TXTPLAIN;
cmflags = M_CM_DECODE | M_CM_CHARCONV;
- if ((WithCrypto & APPLICATION_PGP))
- pgp &= ~PGPENCRYPT;
- if ((WithCrypto & APPLICATION_SMIME))
- pgp &= ~SMIMEENCRYPT;
+ pgp &= ~(PGPENCRYPT|SMIMEENCRYPT);
}
}
- else if (WithCrypto && option (OPTFORWDECRYPT) && (hdr->security & ENCRYPT)) {
- if ((WithCrypto & APPLICATION_PGP)
- && mutt_is_multipart_encrypted (hdr->content)) {
+ else if (option (OPTFORWDECRYPT) && (hdr->security & ENCRYPT)) {
+ if (mutt_is_multipart_encrypted (hdr->content)) {
chflags |= CH_MIME | CH_NONEWLINE;
cmflags = M_CM_DECODE_PGP;
pgp &= ~PGPENCRYPT;
}
chflags |= CH_MIME | CH_NONEWLINE;
cmflags = M_CM_DECODE_PGP;
pgp &= ~PGPENCRYPT;
}
- else if ((WithCrypto & APPLICATION_PGP)
- && (mutt_is_application_pgp (hdr->content) & PGPENCRYPT)) {
+ else if (mutt_is_application_pgp (hdr->content) & PGPENCRYPT) {
chflags |= CH_MIME | CH_TXTPLAIN;
cmflags = M_CM_DECODE | M_CM_CHARCONV;
pgp &= ~PGPENCRYPT;
}
chflags |= CH_MIME | CH_TXTPLAIN;
cmflags = M_CM_DECODE | M_CM_CHARCONV;
pgp &= ~PGPENCRYPT;
}
- else if ((WithCrypto & APPLICATION_SMIME)
- && mutt_is_application_smime (hdr->content) & SMIMEENCRYPT) {
+ else if (mutt_is_application_smime (hdr->content) & SMIMEENCRYPT) {
chflags |= CH_MIME | CH_TXTPLAIN;
cmflags = M_CM_DECODE | M_CM_CHARCONV;
pgp &= ~SMIMEENCRYPT;
chflags |= CH_MIME | CH_TXTPLAIN;
cmflags = M_CM_DECODE | M_CM_CHARCONV;
pgp &= ~SMIMEENCRYPT;
@@
-1243,12
+1231,11
@@
BODY *mutt_make_message_attach (CONTEXT * ctx, HEADER * hdr, int attach_msg)
fflush (fp);
rewind (fp);
fflush (fp);
rewind (fp);
- body->hdr =
mutt_new_header
();
+ body->hdr =
header_new
();
body->hdr->offset = 0;
/* we don't need the user headers here */
body->hdr->env = mutt_read_rfc822_header (fp, body->hdr, 0, 0);
body->hdr->offset = 0;
/* we don't need the user headers here */
body->hdr->env = mutt_read_rfc822_header (fp, body->hdr, 0, 0);
- if (WithCrypto)
- body->hdr->security = pgp;
+ body->hdr->security = pgp;
mutt_update_encoding (body);
body->parts = body->hdr->content;
mutt_update_encoding (body);
body->parts = body->hdr->content;
@@
-2397,8
+2384,7
@@
int mutt_write_fcc (const char *path, HEADER * hdr, const char *msgid,
/* (postponment) if the mail is to be signed or encrypted, save this info */
/* (postponment) if the mail is to be signed or encrypted, save this info */
- if ((WithCrypto & APPLICATION_PGP)
- && post && (hdr->security & APPLICATION_PGP)) {
+ if (post && (hdr->security & APPLICATION_PGP)) {
fputs ("X-Mutt-PGP: ", msg->fp);
if (hdr->security & ENCRYPT)
fputc ('E', msg->fp);
fputs ("X-Mutt-PGP: ", msg->fp);
if (hdr->security & ENCRYPT)
fputc ('E', msg->fp);
@@
-2413,8
+2399,7
@@
int mutt_write_fcc (const char *path, HEADER * hdr, const char *msgid,
}
/* (postponment) if the mail is to be signed or encrypted, save this info */
}
/* (postponment) if the mail is to be signed or encrypted, save this info */
- if ((WithCrypto & APPLICATION_SMIME)
- && post && (hdr->security & APPLICATION_SMIME)) {
+ if (post && (hdr->security & APPLICATION_SMIME)) {
fputs ("X-Mutt-SMIME: ", msg->fp);
if (hdr->security & ENCRYPT) {
fputc ('E', msg->fp);
fputs ("X-Mutt-SMIME: ", msg->fp);
if (hdr->security & ENCRYPT) {
fputc ('E', msg->fp);