* [PR PATCH] Improve attachments handling
@ 2023-02-27 14:39 rakoo
2023-02-27 14:47 ` leahneukirchen
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: rakoo @ 2023-02-27 14:39 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 619 bytes --]
There is a new pull request by rakoo against master on the mblaze repository
https://github.com/rakoo/mblaze master
https://github.com/leahneukirchen/mblaze/pull/234
Improve attachments handling
I had to manually explore to understand how to add attachments, the man page was a bit evasive. It also didn't help that a `~` at the beginning of the path isn't caught, so I added the same treatment as outbox parsing.
Thanks for this fantastic piece of software, the joys of building one's own MUA in ~150 lines of shell scripts...
A patch file from https://github.com/leahneukirchen/mblaze/pull/234.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-master-234.patch --]
[-- Type: text/x-diff, Size: 1454 bytes --]
From 518b29b3d1c424584c8c88a9319f9feac9123651 Mon Sep 17 00:00:00 2001
From: Matthieu Rakotojaona <m@rako.space>
Date: Mon, 27 Feb 2023 15:27:03 +0100
Subject: [PATCH 1/2] mcom: Allow tilde in attachment
---
mcom | 1 +
1 file changed, 1 insertion(+)
diff --git a/mcom b/mcom
index 397cb5f..7258266 100755
--- a/mcom
+++ b/mcom
@@ -84,6 +84,7 @@ do_mime() {
IFS=$NL
msed '/attach/d' "$draft"
for f in $(mhdr -M -h attach "$draft"); do
+ f=$(echo $f | sed "s:^~/:$HOME/:")
printf '#%s %s\n' \
"$(file -Lb --mime "$f" | sed 's/ //g')" \
"$f"
From d15f2af0bdf178b35329aa1c554d85de37a2c817 Mon Sep 17 00:00:00 2001
From: Matthieu Rakotojaona <m@rako.space>
Date: Mon, 27 Feb 2023 15:33:13 +0100
Subject: [PATCH 2/2] mcom: Document how attachments work
---
man/mcom.1 | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/man/mcom.1 b/man/mcom.1
index 957c322..08592c7 100644
--- a/man/mcom.1
+++ b/man/mcom.1
@@ -130,6 +130,13 @@ Delete the draft and quit.
Preview the draft, using
.Xr mshow 1 .
.El
+.Sh ATTACHMENTS
+From within the editor, attachments are added by setting an Attach: header with the path to the desired files. Multiple Attach: headers can be added.
+
+To add from the commandline, use
+.Sq mcom Fl attach No path/to/file
+and the header will be added automatically.
+It is possible to use tilde (~) in the file path.
.Sh ENVIRONMENT
.Bl -tag -width Ds
.It Ev EDITOR , Ev VISUAL
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Improve attachments handling
2023-02-27 14:39 [PR PATCH] Improve attachments handling rakoo
@ 2023-02-27 14:47 ` leahneukirchen
2023-04-12 14:45 ` [PR PATCH] [Updated] " rakoo
2023-05-23 22:47 ` Eolien55
2 siblings, 0 replies; 4+ messages in thread
From: leahneukirchen @ 2023-02-27 14:47 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 224 bytes --]
New comment by leahneukirchen on mblaze repository
https://github.com/leahneukirchen/mblaze/pull/234#issuecomment-1446464780
Comment:
Good idea. Will require a few tweaks to be more robust but thanks for bringing this up.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PR PATCH] [Updated] Improve attachments handling
2023-02-27 14:39 [PR PATCH] Improve attachments handling rakoo
2023-02-27 14:47 ` leahneukirchen
@ 2023-04-12 14:45 ` rakoo
2023-05-23 22:47 ` Eolien55
2 siblings, 0 replies; 4+ messages in thread
From: rakoo @ 2023-04-12 14:45 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 624 bytes --]
There is an updated pull request by rakoo against master on the mblaze repository
https://github.com/rakoo/mblaze master
https://github.com/leahneukirchen/mblaze/pull/234
Improve attachments handling
I had to manually explore to understand how to add attachments, the man page was a bit evasive. It also didn't help that a `~` at the beginning of the path isn't caught, so I added the same treatment as outbox parsing.
Thanks for this fantastic piece of software, the joys of building one's own MUA in ~150 lines of shell scripts...
A patch file from https://github.com/leahneukirchen/mblaze/pull/234.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-master-234.patch --]
[-- Type: text/x-diff, Size: 1454 bytes --]
From 307cb0a40b2b6a30af7b42bf850be735de9378c3 Mon Sep 17 00:00:00 2001
From: Matthieu Rakotojaona <m@rako.space>
Date: Mon, 27 Feb 2023 15:27:03 +0100
Subject: [PATCH 1/2] mcom: Allow tilde in attachment
---
mcom | 1 +
1 file changed, 1 insertion(+)
diff --git a/mcom b/mcom
index 397cb5f..7258266 100755
--- a/mcom
+++ b/mcom
@@ -84,6 +84,7 @@ do_mime() {
IFS=$NL
msed '/attach/d' "$draft"
for f in $(mhdr -M -h attach "$draft"); do
+ f=$(echo $f | sed "s:^~/:$HOME/:")
printf '#%s %s\n' \
"$(file -Lb --mime "$f" | sed 's/ //g')" \
"$f"
From 0d5395e934a0e86ba99481f5b18e3e0f28e703ce Mon Sep 17 00:00:00 2001
From: Matthieu Rakotojaona <m@rako.space>
Date: Mon, 27 Feb 2023 15:33:13 +0100
Subject: [PATCH 2/2] mcom: Document how attachments work
---
man/mcom.1 | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/man/mcom.1 b/man/mcom.1
index 957c322..08592c7 100644
--- a/man/mcom.1
+++ b/man/mcom.1
@@ -130,6 +130,13 @@ Delete the draft and quit.
Preview the draft, using
.Xr mshow 1 .
.El
+.Sh ATTACHMENTS
+From within the editor, attachments are added by setting an Attach: header with the path to the desired files. Multiple Attach: headers can be added.
+
+To add from the commandline, use
+.Sq mcom Fl attach No path/to/file
+and the header will be added automatically.
+It is possible to use tilde (~) in the file path.
.Sh ENVIRONMENT
.Bl -tag -width Ds
.It Ev EDITOR , Ev VISUAL
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Improve attachments handling
2023-02-27 14:39 [PR PATCH] Improve attachments handling rakoo
2023-02-27 14:47 ` leahneukirchen
2023-04-12 14:45 ` [PR PATCH] [Updated] " rakoo
@ 2023-05-23 22:47 ` Eolien55
2 siblings, 0 replies; 4+ messages in thread
From: Eolien55 @ 2023-05-23 22:47 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 171 bytes --]
New comment by Eolien55 on mblaze repository
https://github.com/leahneukirchen/mblaze/pull/234#issuecomment-1560224096
Comment:
What is the status on this pull request?
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-05-23 22:47 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-27 14:39 [PR PATCH] Improve attachments handling rakoo
2023-02-27 14:47 ` leahneukirchen
2023-04-12 14:45 ` [PR PATCH] [Updated] " rakoo
2023-05-23 22:47 ` Eolien55
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).