[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Faking filenames for attachments

From: Tim Landscheidt
Subject: Faking filenames for attachments
Date: Sun, 09 Feb 2014 11:43:01 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)


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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]