open-mail-cli 1.0.0 → 1.0.2
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.
- package/README.md +37 -37
- package/dist/index.js +47 -49
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
|
|
3
|
-
# 📧 Mail CLI
|
|
3
|
+
# 📧 Open Mail CLI
|
|
4
4
|
|
|
5
5
|
**A Modern, Feature-Rich Command-Line Email Client**
|
|
6
6
|
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
|
|
15
15
|
---
|
|
16
16
|
|
|
17
|
-
## <a name="english"></a>🌟 Why Mail CLI?
|
|
17
|
+
## <a name="english"></a>🌟 Why Open Mail CLI?
|
|
18
18
|
|
|
19
|
-
In an era dominated by web-based email clients, **Mail CLI** brings the power of email management back to the terminal. Built for developers, system administrators, and power users who value:
|
|
19
|
+
In an era dominated by web-based email clients, **Open Mail CLI** brings the power of email management back to the terminal. Built for developers, system administrators, and power users who value:
|
|
20
20
|
|
|
21
21
|
- **🚀 Speed**: Lightning-fast email operations without browser overhead
|
|
22
22
|
- **🔒 Privacy**: Your emails stay on your machine, encrypted and secure
|
|
@@ -62,8 +62,8 @@ In an era dominated by web-based email clients, **Mail CLI** brings the power of
|
|
|
62
62
|
|
|
63
63
|
```bash
|
|
64
64
|
# Clone the repository
|
|
65
|
-
git clone https://github.com/eric8810/mail-cli.git
|
|
66
|
-
cd mail-cli
|
|
65
|
+
git clone https://github.com/eric8810/open-mail-cli.git
|
|
66
|
+
cd open-mail-cli
|
|
67
67
|
|
|
68
68
|
# Install dependencies
|
|
69
69
|
npm install
|
|
@@ -76,35 +76,35 @@ npm link
|
|
|
76
76
|
|
|
77
77
|
```bash
|
|
78
78
|
# Interactive configuration wizard
|
|
79
|
-
mail-
|
|
79
|
+
mail-cli config
|
|
80
80
|
|
|
81
81
|
# Or configure manually
|
|
82
|
-
mail-
|
|
83
|
-
mail-
|
|
84
|
-
mail-
|
|
85
|
-
mail-
|
|
82
|
+
mail-cli config --set imap.host=imap.gmail.com
|
|
83
|
+
mail-cli config --set imap.port=993
|
|
84
|
+
mail-cli config --set smtp.host=smtp.gmail.com
|
|
85
|
+
mail-cli config --set smtp.port=465
|
|
86
86
|
```
|
|
87
87
|
|
|
88
88
|
### Basic Usage
|
|
89
89
|
|
|
90
90
|
```bash
|
|
91
91
|
# Sync your inbox
|
|
92
|
-
mail-
|
|
92
|
+
mail-cli sync
|
|
93
93
|
|
|
94
94
|
# List emails
|
|
95
|
-
mail-
|
|
95
|
+
mail-cli list
|
|
96
96
|
|
|
97
97
|
# Read an email
|
|
98
|
-
mail-
|
|
98
|
+
mail-cli read 1
|
|
99
99
|
|
|
100
100
|
# Send an email
|
|
101
|
-
mail-
|
|
101
|
+
mail-cli send --to user@example.com --subject "Hello" --body "World"
|
|
102
102
|
|
|
103
103
|
# Search emails
|
|
104
|
-
mail-
|
|
104
|
+
mail-cli search "meeting"
|
|
105
105
|
|
|
106
106
|
# Start background sync daemon
|
|
107
|
-
mail-
|
|
107
|
+
mail-cli sync daemon start
|
|
108
108
|
```
|
|
109
109
|
|
|
110
110
|
## 📚 Documentation
|
|
@@ -137,33 +137,33 @@ mail-client sync daemon start
|
|
|
137
137
|
### Email Templates with Variables
|
|
138
138
|
```bash
|
|
139
139
|
# Create a template
|
|
140
|
-
mail-
|
|
140
|
+
mail-cli template create --name "Meeting" \
|
|
141
141
|
--subject "Meeting on {{date}}" \
|
|
142
142
|
--text "Hi {{name}}, let's meet at {{time}}"
|
|
143
143
|
|
|
144
144
|
# Use the template
|
|
145
|
-
mail-
|
|
145
|
+
mail-cli template use 1 --var name=John --var time="2pm"
|
|
146
146
|
```
|
|
147
147
|
|
|
148
148
|
### Smart Notifications
|
|
149
149
|
```bash
|
|
150
150
|
# Enable notifications
|
|
151
|
-
mail-
|
|
151
|
+
mail-cli notify enable
|
|
152
152
|
|
|
153
153
|
# Configure filters
|
|
154
|
-
mail-
|
|
154
|
+
mail-cli notify config --sender boss@company.com --important-only
|
|
155
155
|
|
|
156
156
|
# Test notifications
|
|
157
|
-
mail-
|
|
157
|
+
mail-cli notify test
|
|
158
158
|
```
|
|
159
159
|
|
|
160
160
|
### Import/Export
|
|
161
161
|
```bash
|
|
162
162
|
# Export folder to MBOX
|
|
163
|
-
mail-
|
|
163
|
+
mail-cli export folder INBOX backup.mbox
|
|
164
164
|
|
|
165
165
|
# Import emails from EML
|
|
166
|
-
mail-
|
|
166
|
+
mail-cli import eml message.eml --folder INBOX
|
|
167
167
|
```
|
|
168
168
|
|
|
169
169
|
## 🤝 Contributing
|
|
@@ -196,9 +196,9 @@ If you find this project useful, please consider giving it a ⭐!
|
|
|
196
196
|
|
|
197
197
|
---
|
|
198
198
|
|
|
199
|
-
## <a name="chinese"></a>🌟 为什么选择 Mail CLI?
|
|
199
|
+
## <a name="chinese"></a>🌟 为什么选择 Open Mail CLI?
|
|
200
200
|
|
|
201
|
-
在网页邮件客户端主导的时代,**Mail CLI** 将邮件管理的强大功能带回终端。专为开发者、系统管理员和高级用户打造:
|
|
201
|
+
在网页邮件客户端主导的时代,**Open Mail CLI** 将邮件管理的强大功能带回终端。专为开发者、系统管理员和高级用户打造:
|
|
202
202
|
|
|
203
203
|
- **🚀 速度**: 无浏览器开销的闪电般快速邮件操作
|
|
204
204
|
- **🔒 隐私**: 邮件保存在本地,加密且安全
|
|
@@ -236,8 +236,8 @@ If you find this project useful, please consider giving it a ⭐!
|
|
|
236
236
|
|
|
237
237
|
```bash
|
|
238
238
|
# 克隆仓库
|
|
239
|
-
git clone https://github.com/eric8810/mail-cli.git
|
|
240
|
-
cd mail-cli
|
|
239
|
+
git clone https://github.com/eric8810/open-mail-cli.git
|
|
240
|
+
cd open-mail-cli
|
|
241
241
|
|
|
242
242
|
# 安装依赖
|
|
243
243
|
npm install
|
|
@@ -250,33 +250,33 @@ npm link
|
|
|
250
250
|
|
|
251
251
|
```bash
|
|
252
252
|
# 交互式配置向导
|
|
253
|
-
mail-
|
|
253
|
+
mail-cli config
|
|
254
254
|
|
|
255
255
|
# 或手动配置
|
|
256
|
-
mail-
|
|
257
|
-
mail-
|
|
256
|
+
mail-cli config --set imap.host=imap.gmail.com
|
|
257
|
+
mail-cli config --set imap.port=993
|
|
258
258
|
```
|
|
259
259
|
|
|
260
260
|
### 基本使用
|
|
261
261
|
|
|
262
262
|
```bash
|
|
263
263
|
# 同步收件箱
|
|
264
|
-
mail-
|
|
264
|
+
mail-cli sync
|
|
265
265
|
|
|
266
266
|
# 列出邮件
|
|
267
|
-
mail-
|
|
267
|
+
mail-cli list
|
|
268
268
|
|
|
269
269
|
# 阅读邮件
|
|
270
|
-
mail-
|
|
270
|
+
mail-cli read 1
|
|
271
271
|
|
|
272
272
|
# 发送邮件
|
|
273
|
-
mail-
|
|
273
|
+
mail-cli send --to user@example.com --subject "你好" --body "世界"
|
|
274
274
|
|
|
275
275
|
# 搜索邮件
|
|
276
|
-
mail-
|
|
276
|
+
mail-cli search "会议"
|
|
277
277
|
|
|
278
278
|
# 启动后台同步守护进程
|
|
279
|
-
mail-
|
|
279
|
+
mail-cli sync daemon start
|
|
280
280
|
```
|
|
281
281
|
|
|
282
282
|
## 📊 项目统计
|
|
@@ -308,6 +308,6 @@ mail-client sync daemon start
|
|
|
308
308
|
|
|
309
309
|
**Made with ❤️ by developers, for developers**
|
|
310
310
|
|
|
311
|
-
[⬆ Back to Top](#-mail-cli)
|
|
311
|
+
[⬆ Back to Top](#-open-mail-cli)
|
|
312
312
|
|
|
313
313
|
</div>
|
package/dist/index.js
CHANGED
|
@@ -252,19 +252,19 @@ function getConfigDir() {
|
|
|
252
252
|
if (process.platform === "win32") {
|
|
253
253
|
return import_node_path.default.join(
|
|
254
254
|
process.env.APPDATA ?? import_node_path.default.join(import_node_os.default.homedir(), "AppData", "Roaming"),
|
|
255
|
-
"mail-client"
|
|
255
|
+
"open-mail-client"
|
|
256
256
|
);
|
|
257
257
|
}
|
|
258
|
-
return import_node_path.default.join(import_node_os.default.homedir(), ".config", "mail-client");
|
|
258
|
+
return import_node_path.default.join(import_node_os.default.homedir(), ".config", "open-mail-client");
|
|
259
259
|
}
|
|
260
260
|
function getDataDir() {
|
|
261
261
|
if (process.platform === "win32") {
|
|
262
262
|
return import_node_path.default.join(
|
|
263
263
|
process.env.LOCALAPPDATA ?? import_node_path.default.join(import_node_os.default.homedir(), "AppData", "Local"),
|
|
264
|
-
"mail-client"
|
|
264
|
+
"open-mail-client"
|
|
265
265
|
);
|
|
266
266
|
}
|
|
267
|
-
return import_node_path.default.join(import_node_os.default.homedir(), ".local", "share", "mail-client");
|
|
267
|
+
return import_node_path.default.join(import_node_os.default.homedir(), ".local", "share", "open-mail-client");
|
|
268
268
|
}
|
|
269
269
|
function formatDate(date) {
|
|
270
270
|
if (!date) {
|
|
@@ -304,12 +304,13 @@ var init_logger = __esm({
|
|
|
304
304
|
logFile;
|
|
305
305
|
levels;
|
|
306
306
|
currentLevel;
|
|
307
|
+
enableConsole;
|
|
307
308
|
/**
|
|
308
309
|
* Create a logger instance.
|
|
309
310
|
*/
|
|
310
311
|
constructor(logDir = null) {
|
|
311
312
|
this.logDir = logDir ?? import_node_path2.default.join(process.cwd(), "data", "logs");
|
|
312
|
-
this.logFile = import_node_path2.default.join(this.logDir, "mail-client.log");
|
|
313
|
+
this.logFile = import_node_path2.default.join(this.logDir, "open-mail-client.log");
|
|
313
314
|
this.levels = {
|
|
314
315
|
ERROR: 0,
|
|
315
316
|
WARN: 1,
|
|
@@ -317,6 +318,7 @@ var init_logger = __esm({
|
|
|
317
318
|
DEBUG: 3
|
|
318
319
|
};
|
|
319
320
|
this.currentLevel = this.levels.INFO;
|
|
321
|
+
this.enableConsole = false;
|
|
320
322
|
this.ensureLogDir();
|
|
321
323
|
}
|
|
322
324
|
/**
|
|
@@ -353,7 +355,9 @@ var init_logger = __esm({
|
|
|
353
355
|
log(level, message, meta = {}) {
|
|
354
356
|
if (this.levels[level] <= this.currentLevel) {
|
|
355
357
|
const formattedMessage = this.formatMessage(level, message, meta);
|
|
356
|
-
|
|
358
|
+
if (this.enableConsole) {
|
|
359
|
+
console.log(formattedMessage);
|
|
360
|
+
}
|
|
357
361
|
this.writeToFile(formattedMessage);
|
|
358
362
|
}
|
|
359
363
|
}
|
|
@@ -8341,7 +8345,7 @@ Total: ${drafts.length} drafts`));
|
|
|
8341
8345
|
const draftId = options.id || options._[1];
|
|
8342
8346
|
if (!draftId) {
|
|
8343
8347
|
console.error(import_chalk7.default.red("Draft ID is required"));
|
|
8344
|
-
console.log(import_chalk7.default.gray("Usage: mail-
|
|
8348
|
+
console.log(import_chalk7.default.gray("Usage: mail-cli draft edit <draft-id>"));
|
|
8345
8349
|
process.exit(1);
|
|
8346
8350
|
}
|
|
8347
8351
|
const spinner = (0, import_ora2.default)("Loading draft...").start();
|
|
@@ -8408,7 +8412,7 @@ Total: ${drafts.length} drafts`));
|
|
|
8408
8412
|
const draftId = options.id || options._[1];
|
|
8409
8413
|
if (!draftId) {
|
|
8410
8414
|
console.error(import_chalk7.default.red("Draft ID is required"));
|
|
8411
|
-
console.log(import_chalk7.default.gray("Usage: mail-
|
|
8415
|
+
console.log(import_chalk7.default.gray("Usage: mail-cli draft delete <draft-id>"));
|
|
8412
8416
|
process.exit(1);
|
|
8413
8417
|
}
|
|
8414
8418
|
const draft = email_default.findById(draftId);
|
|
@@ -8445,7 +8449,7 @@ Total: ${drafts.length} drafts`));
|
|
|
8445
8449
|
const draftId = options.id || options._[1];
|
|
8446
8450
|
if (!draftId) {
|
|
8447
8451
|
console.error(import_chalk7.default.red("Draft ID is required"));
|
|
8448
|
-
console.log(import_chalk7.default.gray("Usage: mail-
|
|
8452
|
+
console.log(import_chalk7.default.gray("Usage: mail-cli draft send <draft-id>"));
|
|
8449
8453
|
process.exit(1);
|
|
8450
8454
|
}
|
|
8451
8455
|
const draft = email_default.findById(draftId);
|
|
@@ -8481,7 +8485,7 @@ Total: ${drafts.length} drafts`));
|
|
|
8481
8485
|
const cfg = config_default.load();
|
|
8482
8486
|
if (!cfg.smtp.host || !cfg.smtp.user || !cfg.smtp.password) {
|
|
8483
8487
|
spinner.fail("SMTP configuration incomplete");
|
|
8484
|
-
console.error(import_chalk7.default.red("Please run: mail-
|
|
8488
|
+
console.error(import_chalk7.default.red("Please run: mail-cli config"));
|
|
8485
8489
|
process.exit(1);
|
|
8486
8490
|
}
|
|
8487
8491
|
const composer = new composer_default();
|
|
@@ -8506,7 +8510,7 @@ Total: ${drafts.length} drafts`));
|
|
|
8506
8510
|
const cfg = config_default.load();
|
|
8507
8511
|
if (!cfg.imap.host || !cfg.imap.user || !cfg.imap.password) {
|
|
8508
8512
|
spinner.fail("IMAP configuration incomplete");
|
|
8509
|
-
console.error(import_chalk7.default.red("Please run: mail-
|
|
8513
|
+
console.error(import_chalk7.default.red("Please run: mail-cli config"));
|
|
8510
8514
|
process.exit(1);
|
|
8511
8515
|
}
|
|
8512
8516
|
const sync = new sync_default(cfg.imap);
|
|
@@ -8948,9 +8952,7 @@ var require_forward = __commonJS({
|
|
|
8948
8952
|
const cfg = config_default.load();
|
|
8949
8953
|
if (!cfg.smtp.host || !cfg.smtp.user || !cfg.smtp.password) {
|
|
8950
8954
|
console.error(
|
|
8951
|
-
import_chalk7.default.red(
|
|
8952
|
-
"SMTP configuration incomplete. Please run: mail-client config"
|
|
8953
|
-
)
|
|
8955
|
+
import_chalk7.default.red("SMTP configuration incomplete. Please run: mail-cli config")
|
|
8954
8956
|
);
|
|
8955
8957
|
process.exit(1);
|
|
8956
8958
|
}
|
|
@@ -11145,7 +11147,7 @@ var require_read = __commonJS({
|
|
|
11145
11147
|
try {
|
|
11146
11148
|
if (!emailId) {
|
|
11147
11149
|
console.error(import_chalk7.default.red("Error: Email ID is required"));
|
|
11148
|
-
console.log("Usage: mail-
|
|
11150
|
+
console.log("Usage: mail-cli read <id>");
|
|
11149
11151
|
process.exit(1);
|
|
11150
11152
|
}
|
|
11151
11153
|
const email = email_default.findById(emailId);
|
|
@@ -11219,9 +11221,7 @@ var require_reply = __commonJS({
|
|
|
11219
11221
|
const cfg = config_default.load();
|
|
11220
11222
|
if (!cfg.smtp.host || !cfg.smtp.user || !cfg.smtp.password) {
|
|
11221
11223
|
console.error(
|
|
11222
|
-
import_chalk7.default.red(
|
|
11223
|
-
"SMTP configuration incomplete. Please run: mail-client config"
|
|
11224
|
-
)
|
|
11224
|
+
import_chalk7.default.red("SMTP configuration incomplete. Please run: mail-cli config")
|
|
11225
11225
|
);
|
|
11226
11226
|
process.exit(1);
|
|
11227
11227
|
}
|
|
@@ -11515,7 +11515,7 @@ var require_search = __commonJS({
|
|
|
11515
11515
|
const query = buildSearchQuery(keyword, options);
|
|
11516
11516
|
if (Object.keys(query).length === 0 || Object.keys(query).length === 1 && query.limit) {
|
|
11517
11517
|
console.error(import_chalk7.default.red("Error: Please provide search criteria"));
|
|
11518
|
-
console.log("Usage: mail-
|
|
11518
|
+
console.log("Usage: mail-cli search <keyword> [options]");
|
|
11519
11519
|
console.log();
|
|
11520
11520
|
console.log("Options:");
|
|
11521
11521
|
console.log(" --from <email> Search by sender");
|
|
@@ -12104,9 +12104,7 @@ var require_send = __commonJS({
|
|
|
12104
12104
|
const cfg = config_default.load();
|
|
12105
12105
|
if (!cfg.smtp.host || !cfg.smtp.user || !cfg.smtp.password) {
|
|
12106
12106
|
console.error(
|
|
12107
|
-
import_chalk7.default.red(
|
|
12108
|
-
"SMTP configuration incomplete. Please run: mail-client config"
|
|
12109
|
-
)
|
|
12107
|
+
import_chalk7.default.red("SMTP configuration incomplete. Please run: mail-cli config")
|
|
12110
12108
|
);
|
|
12111
12109
|
process.exit(1);
|
|
12112
12110
|
}
|
|
@@ -12595,14 +12593,14 @@ Scan complete: ${spamCount} spam emails detected`);
|
|
|
12595
12593
|
switch (action) {
|
|
12596
12594
|
case "mark":
|
|
12597
12595
|
if (!args[0]) {
|
|
12598
|
-
console.error("Usage: mail-
|
|
12596
|
+
console.error("Usage: mail-cli spam mark <email-id>");
|
|
12599
12597
|
return;
|
|
12600
12598
|
}
|
|
12601
12599
|
await markAsSpam(parseInt(args[0]));
|
|
12602
12600
|
break;
|
|
12603
12601
|
case "unmark":
|
|
12604
12602
|
if (!args[0]) {
|
|
12605
|
-
console.error("Usage: mail-
|
|
12603
|
+
console.error("Usage: mail-cli spam unmark <email-id>");
|
|
12606
12604
|
return;
|
|
12607
12605
|
}
|
|
12608
12606
|
await unmarkAsSpam(parseInt(args[0]));
|
|
@@ -12615,14 +12613,14 @@ Scan complete: ${spamCount} spam emails detected`);
|
|
|
12615
12613
|
if (blacklistAction === "add") {
|
|
12616
12614
|
if (!args[1]) {
|
|
12617
12615
|
console.error(
|
|
12618
|
-
"Usage: mail-
|
|
12616
|
+
"Usage: mail-cli spam blacklist add <email> [reason]"
|
|
12619
12617
|
);
|
|
12620
12618
|
return;
|
|
12621
12619
|
}
|
|
12622
12620
|
await addToBlacklist(args[1], args.slice(2).join(" "));
|
|
12623
12621
|
} else if (blacklistAction === "remove") {
|
|
12624
12622
|
if (!args[1]) {
|
|
12625
|
-
console.error("Usage: mail-
|
|
12623
|
+
console.error("Usage: mail-cli spam blacklist remove <email>");
|
|
12626
12624
|
return;
|
|
12627
12625
|
}
|
|
12628
12626
|
await removeFromBlacklist(args[1]);
|
|
@@ -12630,7 +12628,7 @@ Scan complete: ${spamCount} spam emails detected`);
|
|
|
12630
12628
|
await listBlacklist();
|
|
12631
12629
|
} else {
|
|
12632
12630
|
console.error(
|
|
12633
|
-
"Usage: mail-
|
|
12631
|
+
"Usage: mail-cli spam blacklist <add|remove|list> [email]"
|
|
12634
12632
|
);
|
|
12635
12633
|
}
|
|
12636
12634
|
break;
|
|
@@ -12638,13 +12636,13 @@ Scan complete: ${spamCount} spam emails detected`);
|
|
|
12638
12636
|
const whitelistAction = args[0];
|
|
12639
12637
|
if (whitelistAction === "add") {
|
|
12640
12638
|
if (!args[1]) {
|
|
12641
|
-
console.error("Usage: mail-
|
|
12639
|
+
console.error("Usage: mail-cli spam whitelist add <email>");
|
|
12642
12640
|
return;
|
|
12643
12641
|
}
|
|
12644
12642
|
await addToWhitelist(args[1]);
|
|
12645
12643
|
} else if (whitelistAction === "remove") {
|
|
12646
12644
|
if (!args[1]) {
|
|
12647
|
-
console.error("Usage: mail-
|
|
12645
|
+
console.error("Usage: mail-cli spam whitelist remove <email>");
|
|
12648
12646
|
return;
|
|
12649
12647
|
}
|
|
12650
12648
|
await removeFromWhitelist(args[1]);
|
|
@@ -12652,7 +12650,7 @@ Scan complete: ${spamCount} spam emails detected`);
|
|
|
12652
12650
|
await listWhitelist();
|
|
12653
12651
|
} else {
|
|
12654
12652
|
console.error(
|
|
12655
|
-
"Usage: mail-
|
|
12653
|
+
"Usage: mail-cli spam whitelist <add|remove|list> [email]"
|
|
12656
12654
|
);
|
|
12657
12655
|
}
|
|
12658
12656
|
break;
|
|
@@ -12665,37 +12663,37 @@ Scan complete: ${spamCount} spam emails detected`);
|
|
|
12665
12663
|
default:
|
|
12666
12664
|
console.log("Spam Management Commands:");
|
|
12667
12665
|
console.log(
|
|
12668
|
-
" mail-
|
|
12666
|
+
" mail-cli spam mark <email-id> - Mark email as spam"
|
|
12669
12667
|
);
|
|
12670
12668
|
console.log(
|
|
12671
|
-
" mail-
|
|
12669
|
+
" mail-cli spam unmark <email-id> - Unmark email as spam"
|
|
12672
12670
|
);
|
|
12673
12671
|
console.log(
|
|
12674
|
-
" mail-
|
|
12672
|
+
" mail-cli spam list - List spam emails"
|
|
12675
12673
|
);
|
|
12676
12674
|
console.log(
|
|
12677
|
-
" mail-
|
|
12675
|
+
" mail-cli spam blacklist add <email> - Add to blacklist"
|
|
12678
12676
|
);
|
|
12679
12677
|
console.log(
|
|
12680
|
-
" mail-
|
|
12678
|
+
" mail-cli spam blacklist remove <email> - Remove from blacklist"
|
|
12681
12679
|
);
|
|
12682
12680
|
console.log(
|
|
12683
|
-
" mail-
|
|
12681
|
+
" mail-cli spam blacklist list - List blacklist"
|
|
12684
12682
|
);
|
|
12685
12683
|
console.log(
|
|
12686
|
-
" mail-
|
|
12684
|
+
" mail-cli spam whitelist add <email> - Add to whitelist"
|
|
12687
12685
|
);
|
|
12688
12686
|
console.log(
|
|
12689
|
-
" mail-
|
|
12687
|
+
" mail-cli spam whitelist remove <email> - Remove from whitelist"
|
|
12690
12688
|
);
|
|
12691
12689
|
console.log(
|
|
12692
|
-
" mail-
|
|
12690
|
+
" mail-cli spam whitelist list - List whitelist"
|
|
12693
12691
|
);
|
|
12694
12692
|
console.log(
|
|
12695
|
-
" mail-
|
|
12693
|
+
" mail-cli spam filter - Run spam filter on inbox"
|
|
12696
12694
|
);
|
|
12697
12695
|
console.log(
|
|
12698
|
-
" mail-
|
|
12696
|
+
" mail-cli spam stats - Show spam statistics"
|
|
12699
12697
|
);
|
|
12700
12698
|
}
|
|
12701
12699
|
} catch (error2) {
|
|
@@ -13289,7 +13287,7 @@ var require_sync = __commonJS({
|
|
|
13289
13287
|
try {
|
|
13290
13288
|
const cfg = config_default.load();
|
|
13291
13289
|
if (!cfg.imap.host || !cfg.imap.user || !cfg.imap.password) {
|
|
13292
|
-
spinner.fail("Configuration incomplete. Please run: mail-
|
|
13290
|
+
spinner.fail("Configuration incomplete. Please run: mail-cli config");
|
|
13293
13291
|
process.exit(1);
|
|
13294
13292
|
}
|
|
13295
13293
|
let folders = cfg.sync.folders || ["INBOX"];
|
|
@@ -14342,11 +14340,11 @@ var import_commander2 = require("commander");
|
|
|
14342
14340
|
// package.json
|
|
14343
14341
|
var package_default = {
|
|
14344
14342
|
name: "open-mail-cli",
|
|
14345
|
-
version: "1.0.
|
|
14343
|
+
version: "1.0.2",
|
|
14346
14344
|
description: "A command-line email client with IMAP/SMTP support",
|
|
14347
14345
|
main: "dist/index.js",
|
|
14348
14346
|
bin: {
|
|
14349
|
-
"
|
|
14347
|
+
"mail-cli": "./dist/index.js"
|
|
14350
14348
|
},
|
|
14351
14349
|
scripts: {
|
|
14352
14350
|
build: "tsup",
|
|
@@ -14361,10 +14359,10 @@ var package_default = {
|
|
|
14361
14359
|
format: 'prettier --write ".src/**/*.ts" ".tests/**/*.ts"',
|
|
14362
14360
|
"format:check": 'prettier --check ".src/**/*.ts" ".tests/**/*.ts"',
|
|
14363
14361
|
prepare: "husky",
|
|
14364
|
-
"build:binary": "pnpm build && pkg dist/index.js --targets node18-macos-x64,node18-macos-arm64,node18-linux-x64,node18-linux-arm64,node18-win-x64 --output dist/binary/mail-
|
|
14365
|
-
"build:binary:macos": "pnpm build && pkg dist/index.js --targets node18-macos-arm64 --output dist/binary/mail-
|
|
14366
|
-
"build:binary:linux": "pnpm build && pkg dist/index.js --targets node18-linux-x64 --output dist/binary/mail-
|
|
14367
|
-
"build:binary:windows": "pnpm build && pkg dist/index.js --targets node18-win-x64 --output dist/binary/mail-
|
|
14362
|
+
"build:binary": "pnpm build && pkg dist/index.js --targets node18-macos-x64,node18-macos-arm64,node18-linux-x64,node18-linux-arm64,node18-win-x64 --output dist/binary/open-mail-cli",
|
|
14363
|
+
"build:binary:macos": "pnpm build && pkg dist/index.js --targets node18-macos-arm64 --output dist/binary/open-mail-cli-macos",
|
|
14364
|
+
"build:binary:linux": "pnpm build && pkg dist/index.js --targets node18-linux-x64 --output dist/binary/open-mail-cli-linux",
|
|
14365
|
+
"build:binary:windows": "pnpm build && pkg dist/index.js --targets node18-win-x64 --output dist/binary/open-mail-cli.exe",
|
|
14368
14366
|
prepublishOnly: "pnpm build && pnpm lint"
|
|
14369
14367
|
},
|
|
14370
14368
|
"lint-staged": {
|
|
@@ -14974,7 +14972,7 @@ function promptConfirm2(message) {
|
|
|
14974
14972
|
// src/cli/index.ts
|
|
14975
14973
|
function createCLI() {
|
|
14976
14974
|
const program = new import_commander2.Command();
|
|
14977
|
-
program.name("mail-
|
|
14975
|
+
program.name("mail-cli").description("A command-line email client with IMAP/SMTP support").version(package_default.version);
|
|
14978
14976
|
program.command("config").description("Configure IMAP and SMTP settings").option("--show", "Show current configuration").option("--set <key=value>", "Set a configuration value").action(import_config2.default);
|
|
14979
14977
|
program.command("sync [action]").description("Synchronize emails from IMAP server").option("--folder <name>", "Sync specific folder (default: INBOX)").option("--folders <names>", "Sync multiple folders (comma-separated)").option("--since <date>", "Sync emails since date (YYYY-MM-DD)").option("--account <id>", "Sync specific account").option("--auto", "Start automatic sync mode").option(
|
|
14980
14978
|
"--interval <minutes>",
|