Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
* Re: Faking filenames for attachments
       [not found] <mailman.14370.1391946212.10748.info-gnus-english@gnu.org>
@ 2014-03-05 13:29 ` Lars Ingebrigtsen
  0 siblings, 0 replies; 4+ messages in thread
From: Lars Ingebrigtsen @ 2014-03-05 13:29 UTC (permalink / raw)
  To: info-gnus-english

Tim Landscheidt <tim@tim-landscheidt.de> writes:

> usually, if I attach a file /a/b/c.e to a message, it gets
> MIME headers:
>
> | Content-Type: mime/type
> | Content-Disposition: attachment; filename=c.e
>
> However, I want to pretend the filename is d.e.

Yeah, there is no easy way to do that.

I've now added `recipient-filename' to the MML tag so that you can
specify whatever file name (for the recipient) that you want.  This is
in Ma Gnus only, so it won't be included in the next Emacs release
(since that's in a feature freeze now).

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Faking filenames for attachments
  2014-02-12 10:00 ` Thien-Thi Nguyen
@ 2014-02-12 10:44   ` Tim Landscheidt
  0 siblings, 0 replies; 4+ messages in thread
From: Tim Landscheidt @ 2014-02-12 10:44 UTC (permalink / raw)
  To: info-gnus-english

Thien-Thi Nguyen <ttn@gnu.org> wrote:

>    Are there other options that I have missed?

> You can symlink the desired name to the actual name before attaching.
> How and when to remove the symlink is another problem, however...

Yes, but that's effectively what I have reverted to :-).  As
I want to use the same filename for different files I needed
to create directories, though.

> I'm curious: What kind of files do you want to fake their names?

My current trigger were CVs; I usually emphasize some as-
pects more than others depending on the recipient, and I
don't want to name them in an obvious way.

Another use case I can think of is automagically include
versioning information in filenames.  I. e., if I attach
source code A twice as in commit X and Y, use filenames A-X
and A-Y so that the recipient doesn't have to discern be-
tween "this A" and "that A".

I think for a lasting solution I'll revamp MML to accept pa-
rameters fake-filename & Co.

Tim

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Faking filenames for attachments
  2014-02-09 11:43 Tim Landscheidt
@ 2014-02-12 10:00 ` Thien-Thi Nguyen
  2014-02-12 10:44   ` Tim Landscheidt
  0 siblings, 1 reply; 4+ messages in thread
From: Thien-Thi Nguyen @ 2014-02-12 10:00 UTC (permalink / raw)
  To: info-gnus-english


[-- Attachment #1.1: Type: text/plain, Size: 567 bytes --]

() Tim Landscheidt <tim@tim-landscheidt.de>
() Sun, 09 Feb 2014 11:43:01 +0000

   Are there other options that I have missed?

You can symlink the desired name to the actual name before attaching.
How and when to remove the symlink is another problem, however...

I'm curious: What kind of files do you want to fake their names?

-- 
Thien-Thi Nguyen
   GPG key: 4C807502
   (if you're human and you know it)
      read my lisp: (responsep (questions 'technical)
                               (not (via 'mailing-list)))
                     => nil

[-- Attachment #1.2: Type: application/pgp-signature, Size: 197 bytes --]

[-- Attachment #2: Type: text/plain, Size: 162 bytes --]

_______________________________________________
info-gnus-english mailing list
info-gnus-english@gnu.org
https://lists.gnu.org/mailman/listinfo/info-gnus-english

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Faking filenames for attachments
@ 2014-02-09 11:43 Tim Landscheidt
  2014-02-12 10:00 ` Thien-Thi Nguyen
  0 siblings, 1 reply; 4+ messages in thread
From: Tim Landscheidt @ 2014-02-09 11:43 UTC (permalink / raw)
  To: info-gnus-english

Hi,

usually, if I attach a file /a/b/c.e to a message, it gets
MIME headers:

| Content-Type: mime/type
| Content-Disposition: attachment; filename=c.e

However, I want to pretend the filename is d.e.

mml-attach-file doesn't seem to support that, so after a
look at (emacs-mime)MML Definition I resented to using
mml-insert-empty-tag directly:

| (mml-insert-empty-tag 'part
|                       'type "mime/type"
|                       'filename "/a/b/c.e")
|                       'name "d.e"
|                       'disposition "attachment")

With that, the headers looked like:

| Content-Type: mime/type; name=d.e
| Content-Disposition: attachment; filename=c.e

Still there!  More debugging led to removing 'filename from
mml-content-disposition-parameters which for the mimicry
case resulted in:

| Content-Type: mime/type; name=d.e
| Content-Disposition: attachment

which is okay, but the headers generated by mml-attach-file
lacked any filename:

| Content-Type: mime/type
| Content-Disposition: attachment

which isn't.

So now I have a working solution (advise mml-attach-file to
add a 'name parameter, remove 'filename from
mml-content-disposition-parameters), but this doesn't seem
to be very stable.  Are there other options that I have
missed?

TIA,
Tim

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-03-05 13:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <mailman.14370.1391946212.10748.info-gnus-english@gnu.org>
2014-03-05 13:29 ` Faking filenames for attachments Lars Ingebrigtsen
2014-02-09 11:43 Tim Landscheidt
2014-02-12 10:00 ` Thien-Thi Nguyen
2014-02-12 10:44   ` Tim Landscheidt

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).