Skip to main content

Is there a folder where all email attachments are stored?

Comments

5 comments

  • ffeingol
    I'm sorry, but that's not how email is stored in cPanel/WHM. When an email is sent with attachments, they are encoded (typically base64) and then simply included as part of the messages. There are various headers in the email message to say where the different parts begin and end. Mail is stored in /home/CPANEL_USER/mail/DOMAIN.TLD/EMAIL_ADDRESS where CPANEL_USER is the cPanel user id, DOMAIN.TLD is the doamin name and email address is the part of the email address before the @. You could certainly search through that folder for the attachment name, but the actual attachment would need to be decoded. It may also depend if your host is using mdir or mbox storage format.
    0
  • cPRex Jurassic Moderator
    The details from @ffeingol are correct - there isn't going to be a separate area just for the attachments as they are part of the original message.
    0
  • Jerome8799
    What if I knew the file name of what I am looking for. Is there a way to search for the attachment knowing its file name? Then maybe I could pin point the date and which email contains it and go there the normal way.
    0
  • ffeingol
    if you have shell access you can cd into the mailbox folder and run: egrep -l ATTACHMENT-NAME *
    Where ATTACHMENT-NAME is the name of the attachment file. That will search all the files in that folder for that string (the file name) and list the file names (the emails) that match.
    0
  • Jerome8799
    if you have shell access you can cd into the mailbox folder and run: egrep -l ATTACHMENT-NAME *
    Where ATTACHMENT-NAME is the name of the attachment file. That will search all the files in that folder for that string (the file name) and list the file names (the emails) that match.

    Will check if I have shell access. Thanks!
    0

Please sign in to leave a comment.