This service allows users to convert documents between different formats via email. Users send an email with the subject line indicating the desired conversion formats (e.g., "[DOCX] to [PDF]") and the document as an attachment. The service processes the request and sends back the converted file.
- Parses email subject lines to determine the requested file conversion formats.
- Converts DOCX files to PDF (with scope for adding more formats).
- Handles invalid subject lines and unsupported conversion requests with informative failure emails.
- Command-line interface for local testing.
- Ensure Python 3.x is installed.
- Clone this repository.
- Install dependencies:
pip install -r requirements.txt.
Create a .env file in the project root with the following contents:
EMAIL_USER: Your email username.EMAIL_PASSWORD: Your email password.IMAP_SERVER: IMAP server address (e.g., imap.gmail.com).SMTP_SERVER: SMTP server address (e.g., smtp.gmail.com).
- Create a
tempdirectory in the project root. - Copy the
.env copyfile to the.envfile & edit with your own details. - Run the server with file conversion service using
python src/main.py. - Send an email to the configured email address with the subject line formatted as "[Format-1] to [Format-2]" and include the file to be converted as an attachment.
- The
.envfile is not committed to version control to keep credentials secure - only the template file is. - Proper validation and error handling are in place to prevent misuse.
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch:
git checkout -b feature/AmazingFeature
- Commit your Changes:
git commit -m 'Add some AmazingFeature' - Push to the Branch:
git push origin feature/AmazingFeature
- Open a Pull Request
- Extend the service to support additional file format conversions.
- Improve error handling and user feedback mechanisms.
Distributed under the MIT License. See LICENSE for more information.