I’m creating a script in PHP, which’s job is to backup an IMAP server to a MySQL database.
My question now is:
If an email has an attachment, is that attachment embedded in the email itself or is it a separate file on the server?
My reason for asking, is:
Can i save the header info in a MySQL db, and thereby extract the attachments in a given email, or do i have to download the attachments to the backup server?
Kind regards,
Frederik Krogh
Any attechment is part of the mail body. It usually is not stored in a different file than the email. Email clients split the body of the email using the mentioned MIME types.
You can read it up in https://www.rfc-editor.org/rfc/rfc2045 (and the following RFCs)