myl 0.8.7__py3-none-any.whl → 0.8.9__py3-none-any.whl
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.7.dist-info → myl-0.8.9.dist-info}/METADATA +8 -4
- myl-0.8.9.dist-info/RECORD +7 -0
- {myl-0.8.7.dist-info → myl-0.8.9.dist-info}/WHEEL +1 -1
- myl.py +41 -15
- myl-0.8.7.dist-info/RECORD +0 -7
- {myl-0.8.7.dist-info → myl-0.8.9.dist-info}/LICENSE +0 -0
- {myl-0.8.7.dist-info → myl-0.8.9.dist-info}/entry_points.txt +0 -0
- {myl-0.8.7.dist-info → myl-0.8.9.dist-info}/top_level.txt +0 -0
@@ -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
|
@@ -678,14 +678,18 @@ License: GNU GENERAL PUBLIC LICENSE
|
|
678
678
|
Public License instead of this License. But first, please read
|
679
679
|
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
680
680
|
|
681
|
+
Project-URL: homepage, https://github.com/pschmitt/myl
|
682
|
+
Project-URL: documentation, https://github.com/pschmitt/myl/blob/head/readme.md
|
683
|
+
Project-URL: repository, https://github.com/pschmitt/myl
|
684
|
+
Project-URL: issues, https://github.com/pschmitt/myl/issues
|
681
685
|
Keywords: imap,email
|
682
686
|
Classifier: Programming Language :: Python :: 3
|
683
687
|
Requires-Python: >=3.8
|
684
688
|
Description-Content-Type: text/markdown
|
685
689
|
License-File: LICENSE
|
686
|
-
Requires-Dist: imap-tools
|
687
|
-
Requires-Dist: myl-discovery
|
688
|
-
Requires-Dist: rich
|
690
|
+
Requires-Dist: imap-tools <2.0.0,>=1.5.0
|
691
|
+
Requires-Dist: myl-discovery >=0.6.0
|
692
|
+
Requires-Dist: rich <14.0.0,>=13.0.0
|
689
693
|
|
690
694
|
# 📧 myl
|
691
695
|
|
@@ -0,0 +1,7 @@
|
|
1
|
+
myl.py,sha256=igvvyQpWzIDu_-zrE9qfxp5kDBO5vpBYG5PE6dwUHek,7548
|
2
|
+
myl-0.8.9.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
3
|
+
myl-0.8.9.dist-info/METADATA,sha256=6kbZYilnkr5JfK_3EsGFDDZs2E_zwJtl50UvJaQT2bk,43280
|
4
|
+
myl-0.8.9.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
|
5
|
+
myl-0.8.9.dist-info/entry_points.txt,sha256=q6nr0Kzim7JzreXQE3BTU4asLh2sx5-D0w1yLBOcHxc,33
|
6
|
+
myl-0.8.9.dist-info/top_level.txt,sha256=Wn88OJVVWyYSsKVoqzlHXxfFxh5IbrJ_Yw-ldNLe7Po,4
|
7
|
+
myl-0.8.9.dist-info/RECORD,,
|
myl.py
CHANGED
@@ -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
|
)
|
myl-0.8.7.dist-info/RECORD
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
myl.py,sha256=tyXYwSNAkaq2rNasB1OtBldpDE209l6IzvaF_Qa1aZQ,6843
|
2
|
-
myl-0.8.7.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
3
|
-
myl-0.8.7.dist-info/METADATA,sha256=yz8_wODPddW5YKNmsJT7M6wT4af5kHwLeUzBVxsCICw,43013
|
4
|
-
myl-0.8.7.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
5
|
-
myl-0.8.7.dist-info/entry_points.txt,sha256=q6nr0Kzim7JzreXQE3BTU4asLh2sx5-D0w1yLBOcHxc,33
|
6
|
-
myl-0.8.7.dist-info/top_level.txt,sha256=Wn88OJVVWyYSsKVoqzlHXxfFxh5IbrJ_Yw-ldNLe7Po,4
|
7
|
-
myl-0.8.7.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|