String recipient;
PersonContactVO pc;
List<PersonContactVO> pcs = new ArrayList<PersonContactVO>();
MimeMessage message = mail.getMessage();
MailetContext mailetContext = getMailetContext();
contact = new ContactVO();
contact.setBoundType(ContactVO.BoundType.IN);
contact.setContactType(ContactVO.ContactType.EMAIL);
contact.setContactTimestamp(new Date());
contact.setImportType(ContactVO.ImportType.NEW);
// Subject setzen
if (message.getSubject() != null)
contact.setSubject(message.getSubject());
else
contact.setSubject("Kein Betreff angegeben");
// Content Setzen
insertContent(message);
if (contentTypetext)
contact.setContentType(ContactVO.ContentType.PLAINTEXT);
else
contact.setContentType(ContactVO.ContentType.HTML);
// Absender
List<PersonVO> senders = new PersonDAO().getByMail(mail.getSender().toString());
if (!senders.isEmpty())
for (PersonVO person : senders)
{
pc = new PersonContactVO(person, contact);
pc.setRelationType(PersonContactVO.Type.SENDER);
pcs.add(pc);
if ((mailetContext.isLocalUser(mail.getSender().getUser())) && mailetContext.isLocalServer(mail.getSender().getHost()))
{
contact.setBoundType(ContactVO.BoundType.OUT);
}
}
else