fetch2gmail 1.1.3__tar.gz → 1.1.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {fetch2gmail-1.1.3/src/fetch2gmail.egg-info → fetch2gmail-1.1.4}/PKG-INFO +1 -1
- {fetch2gmail-1.1.3 → fetch2gmail-1.1.4}/pyproject.toml +1 -1
- {fetch2gmail-1.1.3 → fetch2gmail-1.1.4/src/fetch2gmail.egg-info}/PKG-INFO +1 -1
- {fetch2gmail-1.1.3 → fetch2gmail-1.1.4}/src/fetcher/imap_client.py +2 -1
- {fetch2gmail-1.1.3 → fetch2gmail-1.1.4}/src/fetcher/run.py +5 -2
- {fetch2gmail-1.1.3 → fetch2gmail-1.1.4}/LICENSE +0 -0
- {fetch2gmail-1.1.3 → fetch2gmail-1.1.4}/README.md +0 -0
- {fetch2gmail-1.1.3 → fetch2gmail-1.1.4}/setup.cfg +0 -0
- {fetch2gmail-1.1.3 → fetch2gmail-1.1.4}/src/fetch2gmail.egg-info/SOURCES.txt +0 -0
- {fetch2gmail-1.1.3 → fetch2gmail-1.1.4}/src/fetch2gmail.egg-info/dependency_links.txt +0 -0
- {fetch2gmail-1.1.3 → fetch2gmail-1.1.4}/src/fetch2gmail.egg-info/entry_points.txt +0 -0
- {fetch2gmail-1.1.3 → fetch2gmail-1.1.4}/src/fetch2gmail.egg-info/requires.txt +0 -0
- {fetch2gmail-1.1.3 → fetch2gmail-1.1.4}/src/fetch2gmail.egg-info/top_level.txt +0 -0
- {fetch2gmail-1.1.3 → fetch2gmail-1.1.4}/src/fetcher/__init__.py +0 -0
- {fetch2gmail-1.1.3 → fetch2gmail-1.1.4}/src/fetcher/auth_server.py +0 -0
- {fetch2gmail-1.1.3 → fetch2gmail-1.1.4}/src/fetcher/auth_ui.py +0 -0
- {fetch2gmail-1.1.3 → fetch2gmail-1.1.4}/src/fetcher/cli.py +0 -0
- {fetch2gmail-1.1.3 → fetch2gmail-1.1.4}/src/fetcher/config.py +0 -0
- {fetch2gmail-1.1.3 → fetch2gmail-1.1.4}/src/fetcher/env_file.py +0 -0
- {fetch2gmail-1.1.3 → fetch2gmail-1.1.4}/src/fetcher/gmail_client.py +0 -0
- {fetch2gmail-1.1.3 → fetch2gmail-1.1.4}/src/fetcher/log_buffer.py +0 -0
- {fetch2gmail-1.1.3 → fetch2gmail-1.1.4}/src/fetcher/state.py +0 -0
- {fetch2gmail-1.1.3 → fetch2gmail-1.1.4}/src/fetcher/ui_auth.py +0 -0
- {fetch2gmail-1.1.3 → fetch2gmail-1.1.4}/src/fetcher/web_ui.py +0 -0
|
@@ -125,7 +125,8 @@ def fetch_messages(
|
|
|
125
125
|
else:
|
|
126
126
|
conn = imaplib.IMAP4(host, port=port)
|
|
127
127
|
conn.login(username, password)
|
|
128
|
-
|
|
128
|
+
# Use read-only so the server does not set \Seen when we FETCH (preserves unread in Gmail).
|
|
129
|
+
conn.select(mailbox, readonly=True)
|
|
129
130
|
# Get UIDVALIDITY for this mailbox
|
|
130
131
|
status = conn.status(mailbox, "(UIDVALIDITY)")
|
|
131
132
|
# e.g. STATUS INBOX (UIDVALIDITY 12345)
|
|
@@ -42,7 +42,8 @@ def _ensure_label(service: Any, label_name: str) -> str:
|
|
|
42
42
|
|
|
43
43
|
def run_once(config_path: str | None = None, dry_run: bool = False) -> dict[str, Any]:
|
|
44
44
|
"""
|
|
45
|
-
Run one fetch cycle: fetch
|
|
45
|
+
Run one fetch cycle: fetch NEW mail only (UID > last_processed), import to Gmail, update state, delete from ISP.
|
|
46
|
+
New messages are always imported as unread (used by Run fetch now and by the polling interval).
|
|
46
47
|
|
|
47
48
|
If dry_run is True: fetch from ISP and simulate import (log only), do not delete.
|
|
48
49
|
Returns dict with counts and last_fetch_time for UI.
|
|
@@ -154,6 +155,7 @@ def run_once(config_path: str | None = None, dry_run: bool = False) -> dict[str,
|
|
|
154
155
|
|
|
155
156
|
try:
|
|
156
157
|
label_ids = [label_id] if label_id else []
|
|
158
|
+
# Fetch/polling only gets NEW mail (UID > last); always import as unread.
|
|
157
159
|
gmail_id = import_message(
|
|
158
160
|
service,
|
|
159
161
|
USER_ID,
|
|
@@ -161,7 +163,7 @@ def run_once(config_path: str | None = None, dry_run: bool = False) -> dict[str,
|
|
|
161
163
|
label_ids=label_ids,
|
|
162
164
|
inbox_label_id=inbox_label_id,
|
|
163
165
|
unread_label_id=unread_label_id,
|
|
164
|
-
mark_unread=
|
|
166
|
+
mark_unread=True,
|
|
165
167
|
)
|
|
166
168
|
state.record_import(msg.message_hash, gmail_id, mailbox, uid_validity, msg.uid)
|
|
167
169
|
state.set_last_processed_uid(mailbox, uid_validity, msg.uid)
|
|
@@ -341,6 +343,7 @@ def run_copy_all(
|
|
|
341
343
|
|
|
342
344
|
try:
|
|
343
345
|
label_ids = [label_id] if label_id else []
|
|
346
|
+
# Copy-all: preserve read/unread from ISP (\Seen).
|
|
344
347
|
gmail_id = import_message(
|
|
345
348
|
service,
|
|
346
349
|
USER_ID,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|