Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
joram
joram
Commits
5642e71a
Commit
5642e71a
authored
Jun 16, 2010
by
Guillaume Surrel
Browse files
Fix bug with multipart messages.
parent
c5b63be7
Changes
1
Hide whitespace changes
Inline
Side-by-side
joram/src/com/scalagent/joram/mom/dest/mail/MailAcquisition.java
View file @
5642e71a
...
...
@@ -90,7 +90,7 @@ public class MailAcquisition implements AcquisitionHandler {
}
}
transmitter
.
transmit
(
list
,
Long
.
toString
(
msgs
[
msgs
.
length
-
1
].
getReceivedDate
().
getTime
())
);
transmitter
.
transmit
(
list
,
null
);
closeFolder
(
toExpunge
,
expunge
);
}
}
...
...
@@ -186,25 +186,28 @@ public class MailAcquisition implements AcquisitionHandler {
}
if
(
content
instanceof
Multipart
)
{
int
i
=
1
;
while
(
i
<
((
Multipart
)
content
).
getCount
())
{
messagePart
=
((
Multipart
)
content
).
getBodyPart
(
i
);
messagePart
=
((
Multipart
)
content
).
getBodyPart
(
1
);
if
(
logger
.
isLoggable
(
BasicLevel
.
DEBUG
))
{
logger
.
log
(
BasicLevel
.
DEBUG
,
"--- "
+
this
+
" Multipart : part="
+
messagePart
);
}
if
(
logger
.
isLoggable
(
BasicLevel
.
DEBUG
))
{
logger
.
log
(
BasicLevel
.
DEBUG
,
"--- "
+
this
+
" Multipart : part="
+
messagePart
);
}
contentType
=
messagePart
.
getContentType
();
contentType
=
messagePart
.
getContentType
();
if
(
contentType
.
startsWith
(
"text/plain"
)
||
contentType
.
startsWith
(
"text/html"
))
{
InputStream
is
=
messagePart
.
getInputStream
();
BufferedReader
reader
=
new
BufferedReader
(
new
InputStreamReader
(
is
));
if
(
contentType
.
startsWith
(
"text/plain"
)
||
contentType
.
startsWith
(
"text/html"
))
{
InputStream
is
=
messagePart
.
getInputStream
();
BufferedReader
reader
=
new
BufferedReader
(
new
InputStreamReader
(
is
));
String
currentLine
=
reader
.
readLine
();
while
(
currentLine
!=
null
)
{
sb
.
append
(
currentLine
);
sb
.
append
(
'\n'
);
currentLine
=
reader
.
readLine
();
String
currentLine
=
reader
.
readLine
();
while
(
currentLine
!=
null
)
{
sb
.
append
(
currentLine
);
sb
.
append
(
'\n'
);
currentLine
=
reader
.
readLine
();
}
}
i
++;
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment