Spaces:
Sleeping
Sleeping
Upload Advisernote.py
Browse files- Advisernote.py +19 -14
Advisernote.py
CHANGED
|
@@ -254,19 +254,8 @@ def revoke_mailbox_access(mailbox_email):
|
|
| 254 |
return updated
|
| 255 |
|
| 256 |
def get_imap_host_candidates(primary_host, mailbox_email):
|
| 257 |
-
candidates = []
|
| 258 |
primary_host = str(primary_host or "").strip()
|
| 259 |
-
if primary_host
|
| 260 |
-
candidates.append(primary_host)
|
| 261 |
-
if primary_host.endswith(".mxroute.com"):
|
| 262 |
-
mxrouting_host = primary_host.replace(".mxroute.com", ".mxrouting.net")
|
| 263 |
-
if mxrouting_host not in candidates:
|
| 264 |
-
candidates.append(mxrouting_host)
|
| 265 |
-
if primary_host.endswith(".mxrouting.net"):
|
| 266 |
-
mxroute_host = primary_host.replace(".mxrouting.net", ".mxroute.com")
|
| 267 |
-
if mxroute_host not in candidates:
|
| 268 |
-
candidates.append(mxroute_host)
|
| 269 |
-
return candidates
|
| 270 |
|
| 271 |
init_user_db(allowed_users)
|
| 272 |
|
|
@@ -624,8 +613,24 @@ if check_password():
|
|
| 624 |
|
| 625 |
st.markdown("**Mailbox Scan List**")
|
| 626 |
current_mailboxes = load_active_mailboxes()
|
| 627 |
-
mailbox_rows = [
|
| 628 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 629 |
|
| 630 |
mailbox_entry = st.text_input(
|
| 631 |
"Mailbox entry",
|
|
|
|
| 254 |
return updated
|
| 255 |
|
| 256 |
def get_imap_host_candidates(primary_host, mailbox_email):
|
|
|
|
| 257 |
primary_host = str(primary_host or "").strip()
|
| 258 |
+
return [primary_host] if primary_host else []
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 259 |
|
| 260 |
init_user_db(allowed_users)
|
| 261 |
|
|
|
|
| 613 |
|
| 614 |
st.markdown("**Mailbox Scan List**")
|
| 615 |
current_mailboxes = load_active_mailboxes()
|
| 616 |
+
mailbox_rows = []
|
| 617 |
+
for email_addr, entry in current_mailboxes.items():
|
| 618 |
+
credential_part, separator, imap_host = entry.partition("||")
|
| 619 |
+
mailbox_rows.append({
|
| 620 |
+
"Mailbox": email_addr,
|
| 621 |
+
"Authentication": "Individual password" if ":" in credential_part else "Common secret",
|
| 622 |
+
"IMAP Host": imap_host.strip() if separator else "arrow.mxrouting.net",
|
| 623 |
+
})
|
| 624 |
+
st.dataframe(
|
| 625 |
+
pd.DataFrame(mailbox_rows),
|
| 626 |
+
hide_index=True,
|
| 627 |
+
width="stretch",
|
| 628 |
+
column_config={
|
| 629 |
+
"Mailbox": st.column_config.TextColumn(width="medium"),
|
| 630 |
+
"Authentication": st.column_config.TextColumn(width="medium"),
|
| 631 |
+
"IMAP Host": st.column_config.TextColumn(width="large"),
|
| 632 |
+
},
|
| 633 |
+
)
|
| 634 |
|
| 635 |
mailbox_entry = st.text_input(
|
| 636 |
"Mailbox entry",
|