Autopsy  4.18.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
EmailMessage.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 2011-2013 Basis Technology Corp.
5  * Contact: carrier <at> sleuthkit <dot> org
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19 package org.sleuthkit.autopsy.thunderbirdparser;
20 
21 import java.util.ArrayList;
22 import java.util.Date;
23 import java.util.List;
24 import org.sleuthkit.datamodel.TskData;
25 
32 class EmailMessage {
33 
34  private String recipients = "";
35  private String bcc = "";
36  private String cc = "";
37  private String sender = "";
38  private String subject = "";
39  private String headers = "";
40  private String textBody = "";
41  private String htmlBody = "";
42  private String rtfBody = "";
43  private String localPath = "";
44  private boolean hasAttachment = false;
45  private long sentDate = 0L;
46  private final List<Attachment> attachments = new ArrayList<>();
47  private long id = -1L;
48  private String messageID = "";
49  private String inReplyToID = "";
50  private List<String> references = new ArrayList<>();
51  private String simplifiedSubject = "";
52  private boolean replySubject = false;
53  private String messageThreadID = "";
54 
55  boolean hasAttachment() {
56  return hasAttachment;
57  }
58 
59  String getRecipients() {
60  return recipients;
61  }
62 
63  void setRecipients(String recipients) {
64  if (recipients != null) {
65  this.recipients = recipients;
66  }
67  }
68 
69  String getSender() {
70  return sender;
71  }
72 
73  void setSender(String sender) {
74  if (sender != null) {
75  this.sender = sender;
76  }
77  }
78 
79  String getSubject() {
80  return subject;
81  }
82 
83  void setSubject(String subject) {
84  if (subject != null) {
85  this.subject = subject;
86  if (subject.matches("^[R|r][E|e].*?:.*")) {
87  this.simplifiedSubject = subject.replaceAll("[R|r][E|e].*?:", "").trim();
88  replySubject = true;
89  } else {
90  this.simplifiedSubject = subject;
91  }
92  } else {
93  this.simplifiedSubject = "";
94  }
95  }
96 
102  String getSimplifiedSubject() {
103  return simplifiedSubject;
104  }
105 
111  boolean isReplySubject() {
112  return replySubject;
113  }
114 
115  String getHeaders() {
116  return headers;
117  }
118 
119  void setHeaders(String headers) {
120  if (headers != null) {
121  this.headers = headers;
122  }
123  }
124 
125  String getTextBody() {
126  return textBody;
127  }
128 
129  void setTextBody(String textBody) {
130  if (textBody != null) {
131  this.textBody = textBody;
132  }
133  }
134 
135  String getHtmlBody() {
136  return htmlBody;
137  }
138 
139  void setHtmlBody(String htmlBody) {
140  if (htmlBody != null) {
141  this.htmlBody = htmlBody;
142  }
143  }
144 
145  String getRtfBody() {
146  return rtfBody;
147  }
148 
149  void setRtfBody(String rtfBody) {
150  if (rtfBody != null) {
151  this.rtfBody = rtfBody;
152  }
153  }
154 
155  long getSentDate() {
156  return sentDate;
157  }
158 
159  void setSentDate(Date sentDate) {
160  if (sentDate != null) {
161  this.sentDate = sentDate.getTime() / 1000;
162  }
163  }
164 
165  void setSentDate(long sentDate) {
166  this.sentDate = sentDate;
167  }
168 
169  String getBcc() {
170  return bcc;
171  }
172 
173  void setBcc(String bcc) {
174  if (bcc != null) {
175  this.bcc = bcc;
176  }
177  }
178 
179  String getCc() {
180  return cc;
181  }
182 
183  void setCc(String cc) {
184  if (cc != null) {
185  this.cc = cc;
186  }
187  }
188 
189  void addAttachment(Attachment a) {
190  attachments.add(a);
191  hasAttachment = true;
192  }
193 
194  List<Attachment> getAttachments() {
195  return attachments;
196  }
197 
198  long getId() {
199  return id;
200  }
201 
202  void setId(long id) {
203  this.id = id;
204  }
205 
206  String getLocalPath() {
207  return localPath;
208  }
209 
210  void setLocalPath(String localPath) {
211  if (localPath != null) {
212  this.localPath = localPath;
213  }
214  }
215 
222  String getMessageID() {
223  return messageID;
224  }
225 
231  void setMessageID(String messageID) {
232  if (messageID != null) {
233  this.messageID = messageID;
234  } else {
235  this.messageID = "";
236  }
237  }
238 
245  String getInReplyToID() {
246  return inReplyToID;
247  }
248 
254  void setInReplyToID(String inReplyToID) {
255  this.inReplyToID = inReplyToID;
256  }
257 
264  List<String> getReferences() {
265  return references;
266  }
267 
273  void setReferences(List<String> references) {
274  this.references = references;
275  }
276 
282  void setMessageThreadID(String threadID) {
283  this.messageThreadID = threadID;
284  }
285 
291  String getMessageThreadID() {
292  return this.messageThreadID;
293  }
294 
302  static class Attachment {
303 
304  private String name = "";
305 
306  private String localPath = "";
307 
308  private long size = 0L;
309 
310  private long crTime = 0L;
311 
312  private long cTime = 0L;
313 
314  private long aTime = 0L;
315 
316  private long mTime = 0L;
317 
318  private TskData.EncodingType encodingType = TskData.EncodingType.NONE;
319 
320  String getName() {
321  return name;
322  }
323 
324  void setName(String name) {
325  if (name != null) {
326  this.name = name;
327  }
328  }
329 
330  String getLocalPath() {
331  return localPath;
332  }
333 
334  void setLocalPath(String localPath) {
335  if (localPath != null) {
336  this.localPath = localPath;
337  }
338  }
339 
340  long getSize() {
341  return size;
342  }
343 
344  void setSize(long size) {
345  this.size = size;
346  }
347 
348  long getCrTime() {
349  return crTime;
350  }
351 
352  void setCrTime(long crTime) {
353  this.crTime = crTime;
354  }
355 
356  void setCrTime(Date crTime) {
357  if (crTime != null) {
358  this.crTime = crTime.getTime() / 1000;
359  }
360  }
361 
362  long getcTime() {
363  return cTime;
364  }
365 
366  void setcTime(long cTime) {
367  this.cTime = cTime;
368  }
369 
370  void setcTime(Date cTime) {
371  if (cTime != null) {
372  this.cTime = cTime.getTime() / 1000;
373  }
374  }
375 
376  long getaTime() {
377  return aTime;
378  }
379 
380  void setaTime(long aTime) {
381  this.aTime = aTime;
382  }
383 
384  void setaTime(Date aTime) {
385  if (aTime != null) {
386  this.aTime = aTime.getTime() / 1000;
387  }
388  }
389 
390  long getmTime() {
391  return mTime;
392  }
393 
394  void setmTime(long mTime) {
395  this.mTime = mTime;
396  }
397 
398  void setmTime(Date mTime) {
399  if (mTime != null) {
400  this.mTime = mTime.getTime() / 1000;
401  }
402  }
403 
404  void setEncodingType(TskData.EncodingType encodingType) {
405  this.encodingType = encodingType;
406  }
407 
408  TskData.EncodingType getEncodingType() {
409  return encodingType;
410  }
411 
412  }
413 
414  static class AttachedEmailMessage extends Attachment {
415  private final EmailMessage emailMessage;
416 
417  AttachedEmailMessage(EmailMessage emailMessage) {
418  this.emailMessage = emailMessage;
419  }
420 
421  EmailMessage getEmailMessage() {
422  return emailMessage;
423  }
424  }
425 }

Copyright © 2012-2021 Basis Technology. Generated on: Thu Jul 8 2021
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.