We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

[Python] Can't create PST Predefined folder - SYNC_ISSUES, JUNK_EMAIL, UNSPECIFIED

Hi,
I’m using Aspose.Email-for-Python-via-NET 20.2.1. I’ve got problem creating some of predefined folders. Example:

personal_storage = PersonalStorage.create(
    out_dir + f"example.pst", FileFormatVersion.UNICODE
)
pst_sync_issues = personal_storage.create_predefined_folder(
    "Sync Issues",StandardIpmFolder.SYNC_ISSUES
)
print(type(pst_sync_issues))
pst_junk_email = personal_storage.create_predefined_folder(
    "Junk Email", StandardIpmFolder.JUNK_EMAIL
)
print(type(pst_junk_email))
pst_unspecified = personal_storage.create_predefined_folder(
    "Custom", StandardIpmFolder.UNSPECIFIED
)
print(type(pst_unspecified))

Created JUNK_EMAIL and SYNC_ISSUES are None. On attempt of creating UNSPECIFIED folder an error occurs. Output:

 <class 'NoneType'>
 <class 'NoneType'>
 Traceback (most recent call last):
   File "C:/<****>/test.py", line 23, in <module>
     create_personal_storage("out/")
   File "C:/<****>/test.py", line 18, in create_personal_storage
 pst_unspecified = personal_storage.create_predefined_folder("Custom", StandardIpmFolder.UNSPECIFIED)
 RuntimeError: Proxy error: Specified argument was out of the range of valid values.
 Parameter name: defaultFolder

Is there internal bug or I’m doing something wrong?

@gabrielacai,

I have observed the issue shared by you and request you to please share the working sample project reproducing the issue on your end. Its strange that you are getting issue on adding folder with name, “UNSCPECIFIED”. Can you please try using some other folder name and try adding that and see if there is any issue with this specific name or not.