myl 0.8.7__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.
@@ -40,6 +40,6 @@ jobs:
40
40
  echo "$EOF" >> $GITHUB_OUTPUT
41
41
 
42
42
  - name: Create Release
43
- uses: softprops/action-gh-release@v1
43
+ uses: softprops/action-gh-release@v2
44
44
  with:
45
45
  body: ${{ steps.changelog.outputs.changelog }}
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: myl
3
- Version: 0.8.7
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==1.5.0
687
- Requires-Dist: myl-discovery==0.5.7
688
- Requires-Dist: rich>=13.7.0
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
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: myl
3
- Version: 0.8.7
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==1.5.0
687
- Requires-Dist: myl-discovery==0.5.7
688
- Requires-Dist: rich>=13.7.0
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,3 @@
1
+ imap-tools<2.0.0,>=1.5.0
2
+ myl-discovery>=0.6.0
3
+ rich<14.0.0,>=13.0.0
@@ -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="Start TLS", action="store_true", default=False
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
- table.add_column("ID", style="red", no_wrap=not args.wrap, max_width=10)
149
- table.add_column(
150
- "Subject", style="green", no_wrap=not args.wrap, max_width=30
151
- )
152
- table.add_column("From", style="blue", no_wrap=not args.wrap, max_width=30)
153
- table.add_column("Date", style="cyan", no_wrap=not args.wrap)
154
-
155
- mb = imap_tools.MailBoxTls if args.starttls else imap_tools.MailBox
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(args.server, port=args.port).login(
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
  )
@@ -16,11 +16,17 @@ classifiers = [
16
16
  "Programming Language :: Python :: 3",
17
17
  ]
18
18
  dependencies = [
19
- "imap-tools == 1.5.0",
20
- "myl-discovery == 0.5.7",
21
- "rich >= 13.7.0",
19
+ "imap-tools >= 1.5.0, < 2.0.0",
20
+ "myl-discovery >= 0.6.0",
21
+ "rich >= 13.0.0, <14.0.0",
22
22
  ]
23
- version = "0.8.7"
23
+ version = "0.8.9"
24
+
25
+ [project.urls]
26
+ homepage = "https://github.com/pschmitt/myl"
27
+ documentation = "https://github.com/pschmitt/myl/blob/head/readme.md"
28
+ repository = "https://github.com/pschmitt/myl"
29
+ issues = "https://github.com/pschmitt/myl/issues"
24
30
 
25
31
  [tool.black]
26
32
  line-length = 79
@@ -1,3 +0,0 @@
1
- imap-tools==1.5.0
2
- myl-discovery==0.5.7
3
- rich>=13.7.0
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