Получить SMTP-данные из Java MimeMessageJAVA

Программисты JAVA общаются здесь
Ответить Пред. темаСлед. тема
Anonymous
 Получить SMTP-данные из Java MimeMessage

Сообщение Anonymous »


I have a docker mail server which allows me to send and read email as any user via the dovecot admin account.

I do not log in as any user - I do not have access to any user's password. When I send an email programmatically, I would like to save it in the user's SENT folder. I can not do this with IMAP as I can't log in as the user. I can, however, do it with the doveadm mailbox save command. This command will allow me to save a message in a user's folder. The format of the message (the "file" parameter) appears to be the content of the DATA command of SMTP:

"save", { "file": "From: Joulu Pukki \nSubject: plaa\n\nmail body\n", "mailbox": "INBOX/myfoldertoo", "user": "samik" }, I'm using Java/Spring to send the messages via org.springframework.mail.javamail.JavaMailSenderImpl. Its send method takes a MimeMessage.

I need to be able to convert the MimeMessage into the format required by the doveadm command. Note that this format is plain text, and that the messages that are sent often will have attachments included. Any ideas?


Источник: https://stackoverflow.com/questions/780 ... imemessage
Реклама
Ответить Пред. темаСлед. тема

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

  • Похожие темы
    Ответы
    Просмотры
    Последнее сообщение

Вернуться в «JAVA»