Skip to content

niccolodevries/Python-Outlook-PST-export

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

PST Email and Attachment Extractor

This script extracts emails and attachments from a PST file. The emails are saved in individual folders with their body, metadata, and attachments. Additionally, all attachments are saved in a separate global directory.

Requirements

  • Python 3.x
  • pypff
  • filetype

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/pst-email-attachment-extractor.git
    cd pst-email-attachment-extractor
  2. Install the required libraries:

    pip install pypff filetype

Usage

  1. Place your PST file in the project directory and rename it to file.pst or update the pst_file_path variable in the script to match your file name.

  2. Run the script:

    python extract_emails_and_attachments.py
  3. The extracted emails and attachments will be saved in the extracted_emails_and_attachments directory.

Script Details

The script performs the following tasks:

  1. Opens the PST file and retrieves the root folder.
  2. Processes each folder recursively to extract emails and their attachments.
  3. Saves each email in a directory named after the email's subject.
  4. Saves the email body in plain text, HTML, or RTF format.
  5. Saves the email metadata (subject, sender, recipients) in a text file.
  6. Saves attachments in both the email's directory and a global all_attachments directory.

License

This project is licensed under the MIT License.

Contributing

Contributions are welcome! Please submit a pull request or open an issue to discuss your ideas.

About

Python code to extract an Outlook PST libary

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages