Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
mailutils
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
1d95c0dd
...
1d95c0ddbb712a575604e8a398402c6ca2073ea2
authored
2002-11-28 16:40:55 +0000
by
Frederic Gobry
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
set the content-transfer-encoding of a mime message with one part
1 parent
e130b702
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
2 deletions
ChangeLog
mailbox/mime.c
ChangeLog
View file @
1d95c0d
...
...
@@ -2,6 +2,10 @@
*
mailbox
/
filter_trans
.
c
(
qp_encode
)
:
fixed
quoted
-
printable
encoding
.
*
mailbox
/
mime
.
c
(
_mime_set_content_type
)
:
when
a
MIME
message
has
only
one
part
,
set
the
Content
-
transfer
-
encoding
of
the
message
to
be
the
one
of
the
part
.
2002
-
11
-
27
Frederic
Gobry
<
frederic
.
gobry
@smartdata
.
ch
>
...
...
mailbox/mime.c
View file @
1d95c0d
...
...
@@ -399,10 +399,11 @@ _mimepart_body_lines (body_t body, size_t *plines)
static
int
_mime_set_content_type
(
mime_t
mime
)
{
char
content_type
[
256
];
char
content_type
[
256
]
,
*
content_te
;
char
boundary
[
128
];
header_t
hdr
=
NULL
;
size_t
size
;
int
ret
;
/* Delayed the creation of the header 'til they create the final message via
mime_get_message() */
...
...
@@ -424,6 +425,8 @@ _mime_set_content_type(mime_t mime)
strcat
(
content_type
,
mime
->
boundary
);
strcat
(
content_type
,
"
\"
"
);
mime
->
flags
|=
MIME_ADDED_MULTIPART_CT
;
ret
=
header_set_value
(
mime
->
hdrs
,
MU_HEADER_CONTENT_TYPE
,
content_type
,
1
);
}
else
{
if
(
(
mime
->
flags
&
(
MIME_ADDED_CT
|
MIME_ADDED_MULTIPART_CT
))
==
MIME_ADDED_CT
)
return
0
;
...
...
@@ -434,9 +437,25 @@ _mime_set_content_type(mime_t mime)
strcpy
(
content_type
,
"text/plain; charset=us-ascii"
);
else
header_get_value
(
hdr
,
MU_HEADER_CONTENT_TYPE
,
content_type
,
sizeof
(
content_type
),
&
size
);
ret
=
header_set_value
(
mime
->
hdrs
,
MU_HEADER_CONTENT_TYPE
,
content_type
,
1
);
if
(
ret
)
return
ret
;
/* if the only part contains a transfer-encoding
field, set it on the message header too */
if
(
hdr
&&
header_aget_value
(
hdr
,
MU_HEADER_CONTENT_TRANSFER_ENCODING
,
&
content_te
)
==
0
)
{
ret
=
header_set_value
(
mime
->
hdrs
,
MU_HEADER_CONTENT_TRANSFER_ENCODING
,
content_te
,
1
);
free
(
content_te
);
}
}
mime
->
flags
|=
MIME_ADDED_CT
;
return
header_set_value
(
mime
->
hdrs
,
MU_HEADER_CONTENT_TYPE
,
content_type
,
1
)
;
return
ret
;
}
#define ADD_CHAR(buf, c, offset, buflen, nbytes) {*(buf)++ = c; (offset)++; (nbytes)++;if (--(buflen) == 0) return 0;}
...
...
Please
register
or
sign in
to post a comment