Skip to content

save_file() method error because symbols inside subject #329

@WU19-1

Description

@WU19-1

Hello, I want to report about an error inside the save_file() method if there is symbols inside the subject because:

def save_file(self, file_path):

        eml_content = self.build_email()

        file_name = str(self.message["Subject"]) + ".eml"

        eml_file_path = os.path.join(file_path, file_name)

        with codecs.open(eml_file_path, mode="wb+", encoding="utf-8") as eml_file:
            eml_file.write(eml_content)

        return eml_file_path

Meanwhile my email has a symbol that are prohibited for filenames < > : " / \ | ? * and inside the save_file() method, these symbols are not removed automatically.

Images:
Code and files inside
image
File without symbol inside the subject
image
File with symbol inside the subject
failed

This is my first time submitting an issue, if there's any mistake that I made, I apologize
Thank you very much ! :DDD

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions