myl 0.8.8__tar.gz → 0.8.9__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.
- {myl-0.8.8 → myl-0.8.9}/.github/workflows/release.yaml +1 -1
- {myl-0.8.8 → myl-0.8.9}/PKG-INFO +2 -2
- {myl-0.8.8 → myl-0.8.9}/myl.egg-info/PKG-INFO +2 -2
- {myl-0.8.8 → myl-0.8.9}/myl.egg-info/requires.txt +1 -1
- {myl-0.8.8 → myl-0.8.9}/myl.py +41 -15
- {myl-0.8.8 → myl-0.8.9}/pyproject.toml +2 -2
- {myl-0.8.8 → myl-0.8.9}/.github/dependabot.yml +0 -0
- {myl-0.8.8 → myl-0.8.9}/.github/workflows/lint.yaml +0 -0
- {myl-0.8.8 → myl-0.8.9}/.github/workflows/pypi.yaml +0 -0
- {myl-0.8.8 → myl-0.8.9}/.gitignore +0 -0
- {myl-0.8.8 → myl-0.8.9}/LICENSE +0 -0
- {myl-0.8.8 → myl-0.8.9}/README.md +0 -0
- {myl-0.8.8 → myl-0.8.9}/myl.egg-info/SOURCES.txt +0 -0
- {myl-0.8.8 → myl-0.8.9}/myl.egg-info/dependency_links.txt +0 -0
- {myl-0.8.8 → myl-0.8.9}/myl.egg-info/entry_points.txt +0 -0
- {myl-0.8.8 → myl-0.8.9}/myl.egg-info/top_level.txt +0 -0
- {myl-0.8.8 → myl-0.8.9}/setup.cfg +0 -0
{myl-0.8.8 → myl-0.8.9}/PKG-INFO
RENAMED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: myl
|
3
|
-
Version: 0.8.
|
3
|
+
Version: 0.8.9
|
4
4
|
Summary: Dead simple IMAP CLI client
|
5
5
|
Author-email: Philipp Schmitt <philipp@schmitt.co>
|
6
6
|
License: GNU GENERAL PUBLIC LICENSE
|
@@ -688,7 +688,7 @@ Requires-Python: >=3.8
|
|
688
688
|
Description-Content-Type: text/markdown
|
689
689
|
License-File: LICENSE
|
690
690
|
Requires-Dist: imap-tools<2.0.0,>=1.5.0
|
691
|
-
Requires-Dist: myl-discovery>=0.
|
691
|
+
Requires-Dist: myl-discovery>=0.6.0
|
692
692
|
Requires-Dist: rich<14.0.0,>=13.0.0
|
693
693
|
|
694
694
|
# 📧 myl
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: myl
|
3
|
-
Version: 0.8.
|
3
|
+
Version: 0.8.9
|
4
4
|
Summary: Dead simple IMAP CLI client
|
5
5
|
Author-email: Philipp Schmitt <philipp@schmitt.co>
|
6
6
|
License: GNU GENERAL PUBLIC LICENSE
|
@@ -688,7 +688,7 @@ Requires-Python: >=3.8
|
|
688
688
|
Description-Content-Type: text/markdown
|
689
689
|
License-File: LICENSE
|
690
690
|
Requires-Dist: imap-tools<2.0.0,>=1.5.0
|
691
|
-
Requires-Dist: myl-discovery>=0.
|
691
|
+
Requires-Dist: myl-discovery>=0.6.0
|
692
692
|
Requires-Dist: rich<14.0.0,>=13.0.0
|
693
693
|
|
694
694
|
# 📧 myl
|
{myl-0.8.8 → myl-0.8.9}/myl.py
RENAMED
@@ -1,5 +1,6 @@
|
|
1
1
|
import argparse
|
2
2
|
import logging
|
3
|
+
import ssl
|
3
4
|
import sys
|
4
5
|
|
5
6
|
import imap_tools
|
@@ -44,8 +45,15 @@ def parse_args():
|
|
44
45
|
parser.add_argument(
|
45
46
|
"-P", "--port", help="IMAP server port", default=IMAP_PORT
|
46
47
|
)
|
48
|
+
parser.add_argument("--ssl", help="SSL", action="store_true", default=True)
|
47
49
|
parser.add_argument(
|
48
|
-
"--starttls", help="
|
50
|
+
"--starttls", help="STARTTLS", action="store_true", default=False
|
51
|
+
)
|
52
|
+
parser.add_argument(
|
53
|
+
"--insecure",
|
54
|
+
help="Disable cert validation",
|
55
|
+
action="store_true",
|
56
|
+
default=False,
|
49
57
|
)
|
50
58
|
parser.add_argument(
|
51
59
|
"-c",
|
@@ -73,7 +81,6 @@ def parse_args():
|
|
73
81
|
action="store_true",
|
74
82
|
)
|
75
83
|
parser.add_argument("-S", "--search", help="Search string", default="ALL")
|
76
|
-
parser.add_argument("-w", "--wrap", help="Wrap text", action="store_true")
|
77
84
|
parser.add_argument("-H", "--html", help="Show HTML", action="store_true")
|
78
85
|
parser.add_argument(
|
79
86
|
"-r",
|
@@ -124,6 +131,7 @@ def main():
|
|
124
131
|
args.server = settings.get("server")
|
125
132
|
args.port = settings.get("port", IMAP_PORT)
|
126
133
|
args.starttls = settings.get("starttls")
|
134
|
+
args.ssl = settings.get("ssl")
|
127
135
|
|
128
136
|
if args.sent:
|
129
137
|
args.folder = "Sent"
|
@@ -139,23 +147,37 @@ def main():
|
|
139
147
|
return 2
|
140
148
|
|
141
149
|
table = Table(
|
142
|
-
expand=True,
|
143
150
|
show_header=not args.no_title,
|
144
151
|
header_style="bold",
|
152
|
+
expand=True,
|
145
153
|
show_lines=False,
|
154
|
+
show_edge=False,
|
155
|
+
pad_edge=False,
|
146
156
|
box=None,
|
147
|
-
|
148
|
-
|
149
|
-
table.add_column(
|
150
|
-
|
151
|
-
)
|
152
|
-
table.add_column("
|
153
|
-
|
154
|
-
|
155
|
-
|
157
|
+
row_styles=["", "dim"],
|
158
|
+
)
|
159
|
+
table.add_column("ID", style="red", no_wrap=True)
|
160
|
+
table.add_column("Subject", style="green", no_wrap=True, ratio=3)
|
161
|
+
table.add_column("From", style="blue", no_wrap=True, ratio=2)
|
162
|
+
table.add_column("Date", style="cyan", no_wrap=True)
|
163
|
+
|
164
|
+
ssl_context = ssl.create_default_context()
|
165
|
+
if args.insecure:
|
166
|
+
ssl_context.check_hostname = False
|
167
|
+
ssl_context.verify_mode = ssl.CERT_NONE
|
168
|
+
|
169
|
+
mb_kwargs = {"host": args.server, "port": args.port}
|
170
|
+
if args.ssl:
|
171
|
+
mb = imap_tools.MailBox
|
172
|
+
mb_kwargs["ssl_context"] = ssl_context
|
173
|
+
elif args.starttls:
|
174
|
+
mb = imap_tools.MailBoxTls
|
175
|
+
mb_kwargs["ssl_context"] = ssl_context
|
176
|
+
else:
|
177
|
+
mb = imap_tools.MailBoxUnencrypted
|
156
178
|
|
157
179
|
try:
|
158
|
-
with mb(
|
180
|
+
with mb(**mb_kwargs).login(
|
159
181
|
args.username, args.password, args.folder
|
160
182
|
) as mailbox:
|
161
183
|
if args.MAILID:
|
@@ -194,10 +216,14 @@ def main():
|
|
194
216
|
headers_only=False, # required for attachments
|
195
217
|
):
|
196
218
|
subj_prefix = "📎 " if len(msg.attachments) > 0 else ""
|
219
|
+
subject = (
|
220
|
+
msg.subject.replace("\n", "")
|
221
|
+
if msg.subject
|
222
|
+
else "<no-subject>"
|
223
|
+
)
|
197
224
|
table.add_row(
|
198
225
|
msg.uid if msg.uid else "???",
|
199
|
-
subj_prefix
|
200
|
-
+ (msg.subject if msg.subject else "<no-subject>"),
|
226
|
+
f"{subj_prefix}{subject}",
|
201
227
|
msg.from_,
|
202
228
|
msg.date.strftime("%H:%M %d/%m/%Y") if msg.date else "???",
|
203
229
|
)
|
@@ -17,10 +17,10 @@ classifiers = [
|
|
17
17
|
]
|
18
18
|
dependencies = [
|
19
19
|
"imap-tools >= 1.5.0, < 2.0.0",
|
20
|
-
"myl-discovery >= 0.
|
20
|
+
"myl-discovery >= 0.6.0",
|
21
21
|
"rich >= 13.0.0, <14.0.0",
|
22
22
|
]
|
23
|
-
version = "0.8.
|
23
|
+
version = "0.8.9"
|
24
24
|
|
25
25
|
[project.urls]
|
26
26
|
homepage = "https://github.com/pschmitt/myl"
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{myl-0.8.8 → myl-0.8.9}/LICENSE
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|