Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
From: Tim Landscheidt <tim@tim-landscheidt.de>
To: info-gnus-english@gnu.org
Subject: Faking filenames for attachments
Date: Sun, 09 Feb 2014 11:43:01 +0000	[thread overview]
Message-ID: <87fvnsecl6.fsf@passepartout.tim-landscheidt.de> (raw)

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

             reply	other threads:[~2014-02-09 11:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-09 11:43 Tim Landscheidt [this message]
2014-02-12 10:00 ` Thien-Thi Nguyen
2014-02-12 10:44   ` Tim Landscheidt
     [not found] <mailman.14370.1391946212.10748.info-gnus-english@gnu.org>
2014-03-05 13:29 ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87fvnsecl6.fsf@passepartout.tim-landscheidt.de \
    --to=tim@tim-landscheidt.de \
    --cc=info-gnus-english@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).