RPA.Email.ImapSmtp save_attachments doesn't save .msg files attached to the email

I’m using RPA.Email.ImapSmtp to read email from the mailbox and extract all attached files with save_attachments method.
For some reasons .msg files are not saved - all other attached files are saved, but the file with the extension .msg is not - I can see an object exists in message property instead.

Is there a way to achieve that and work with .msg attachments as well?

code example:

from RPA.Email.ImapSmtp import ImapSmtp

imap: ImapSmtp = ImapSmtp(login, password=password, imap_server=imap_server, imap_port=imap_port)

emails = imap.list_messages("UNSEEN")

for email in emails:
    imap.save_attachment(email, target_folder='c:/temp')


To clarify, if your email has .msg as an attachment, is that not saved?

Yes. The email has a file .msg attached and this file is not saved.

Hello, I’m able to reproduce it. Could you open an issue in Issues · robocorp/rpaframework · GitHub?

Sure! No problem. Thank you for checking

1 Like