* reafctor: force ipv4 localhost
Replacing "localhost" with "127.0.0.1" in the codebase; sometimes the name localhost force-resolves to ipv6
* revert: leave localhost usage in oauth tests
Change not required.
---------
Co-authored-by: Ankush Menat <ankush@frappe.io>
When working with IMAP accounts, frappe should allow the user
to choose multiple folders to look for new mails. This helps
users to separate their frappe-related email from other
conversations. Use cases range from sieve filters in the
mail server that stuff incoming mail in various mail folders
to people manually sorting their e-mail. In both cases, we
can have different import policies for different folders, and
we can avoid importing unrelated email.
Created a new child table `IMAP Folder` with following fields:
- Folder Name (user-modifiable)
- Append To (user-modifiable)
- UIDVALIDITY (hidden)
- UIDNEXT (hidden)
Doctype `Email Account` and `receive.py` code adjusted so that
emails with the changes are processed correctly and Frappe
only logs in to the imap server once per sync.
Created a patch that copies the data from the old fields into
the new child table with `INBOX` as default `folder_name`. This
keeps existing setups working without manual changes.
The original fields
- uidvalidity
- uidnext
- append_to
are still available for the pop3 setups. In IMAP, these fields
are hidden user and not used.
Added a test case in `Email Account` that validates data to make
sure a IMAP folder is provided if the use_imap is true.
Also added some code formatting changes in email_account.js to get rid
of sider checks failures that block this change