On Fri, 16 Jan 2009, bill lam wrote:
> Some other email clients should already have this plugin. If the email
> body contains words like: attach(ed) or attachment(s), it will issue a
> warning if no attachment is added when sending. How to implement this
> in mutt?
You can set your sendmail variable to a script, that checks your mail.
I have seen several solutions for that. One is mentioned at the wiki¹,
the other one would be that one²
Another solution I just thought about, would be to let your editor
check for an attachement. I have seen you on the vim List, so assuming
you use vim for writing your mails, the following script might do what
| function! CheckAttach()
| let check='attach,angehängt,attachment,Anhang'
| let oldPos=getpos('.')
| let ans=1
| let val = join(split(escape(check,' \.+*'), ','),'\|')
| if search('\%('.val.'\)','W')
| let ans=input("Attach file?: (leave empty to abbort): ", "", "file")
| while (ans != '')
| normal magg}-
| call append(line('.'), 'Attach: '.ans)
| let ans=input("Attach another file?: (leave empty to abbort): ",
| exe ":write ". expand("<amatch>")
| call setpos('.', oldPos)
| augroup script
| au BufWriteCmd,FileWriteCmd mutt* :call CheckAttach()
| augroup END
Just put that script into your ~/.vim/ftplugin/mail.vim file and it
will get sourced whenever you write mails. It makes use of the pseudo
Attach: header which is evaluated by mutt. Any file that is specified
in that header will be attached by mutt.
This might give you some ideas on how to achieve what you want. Note
that I have no experience with either of these solutions.
hundred-and-one symptoms of being an internet addict:
92. It takes you two hours to check all 14 of your mailboxes.