-
-
Notifications
You must be signed in to change notification settings - Fork 43
Description
Describe the bug
When configuring an IMAP import via the Piler Web UI with Type of server set to "imap" (no SSL/TLS), the imapfetch.py script fails to initialize the connection. Output / error message:
Traceback (most recent call last):
File "/usr/libexec/piler/imapfetch.py", line 235, in <module>
main()
~~~~^^
File "/usr/libexec/piler/imapfetch.py", line 206, in main
conn.login(user, password)
^^^^
UnboundLocalError: cannot access local variable 'conn' where it is not associated with a value
To Reproduce
Steps to reproduce the behavior:
- Create an import entry with the Web UI
- Set Type (of server) to imap (no SSL/TLS)
- Fill other fields and apply.
- Call
/usr/libexec/piler/import.sh
Expected behavior
A connection to the IMAP server should be established.
Piler version:
v1.4.8
Additional context
OS: Debian 13 (Trixie)
Python: 3.13.5
Notes
Possible fix:
I identified that when selecting "imap" for Type (of server) in the Web UI, the database field security is populated with the value 'imap'. However, imapfetch.py at line 195 only checks for 'no'. I manually modified line 195 in /usr/libexec/piler/imapfetch.py:
Original:
if security == 'no':Changed to:
if security in ['no', 'imap']:This seems to work for my case, but I haven't dealt with it in any other depth.