3

I am searching for a way to automatically attach a file ~/.mutt/example.vcf to any mail I compose with mutt.

I tried something like send-hook 'attach-file ~/.mutt/fauve.vcf' but it doesn't work.

Have you, please, any idea how to do that ?

3 Answers 3

2

The following works for me in neomutt 20180716

macro compose y ":exec attach-file<enter>myfile.txt<enter>:exec send-message<enter>"

To explain:

  • macro compose y -- override the y key in the compose menu to run a macro instead of just sending
  • :exec attach-file -- opens the mutt prompt for a filename to attach
  • myfile.txt -- enters the name of the file to attach and presses enter
  • :exec send-message -- runs the send email command
0

I dont know mutt, but I can tell you in mail or mailx I usually do uuencode myAttachment.tar.gz attachmentName | mail -s "Here is that dolphin porn you requested" [email protected]

1
  • uuencode wasn’t installed in my system and was able to send mails with mutt. Commented Jan 13, 2014 at 17:34
0

[edit]

Easiest solution consist in to just create a simple alias for mutt:

alias mutt="/usr/bin/mutt -a $HOME/.std.vcf"

so if you enter mutt mutt -a $HOME/.std.vcf will be executed. That's it!

Normally in order to compose a email with attachments mime-construct is used:

mime-construct --to "nerd@example" --subject 'hi there' \
--string "test" --file-attach /etc/motd

There are some solutions to automaticly add your *.vcf:

vcf-to-mutt
muttquery.py

However, it is unusual to use vcf on unices where a signature is more common.

4
  • I haven’t mime-construct installed so I can send mails with mutt. Then, if what I want to do need the installation of mime-construct, I will install it. Commented Jan 11, 2014 at 23:51
  • Thank you for vcf-to-mutt and muttquery. I will try them. Yes, I can use a link to my vcf but some email program sync automatically the addressbook when they found a vcf as an attachment. That’s why I prefer this way :) Commented Jan 13, 2014 at 17:36
  • Vcf-to-mutt is an interesting script. Thank you o/ but it doesn’t resolve my problem :) Perhaps the solution are very complicated. Then as you tell me I will probably forget this idea and only quote the link to my vcard in a signature. Thank you. Commented Jan 16, 2014 at 18:25
  • updated alias solution Commented Jan 16, 2014 at 19:19

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.