Scripting problem

Polytropon freebsd at
Sun Oct 8 08:00:31 UTC 2017

On Sun, 08 Oct 2017 01:14:04 -0500, Paul Schmehl wrote:
> I guess I should have pointed out that I'm sending mail on localhost, so 
> there's no auth involved. I'm using mutt because mailx doesn't appear to 
> have the ability to attach files.

You can attach files with classic mail / mailx, but you'd have
to create the headers yourself and maybe use b64encode, so your
solution really looks more comfortable.

> I solved the problem by using a one word subject. It's weird that Mutt is 
> somehow parsing the words in the subject and using them as recipients.

As I said, mutt doesn't do that. Always keep in mind that space
(or whitespace in general) is the option delimiter in sh and bash.
So when you issue

	mutt -s Foo Bar Baz [...]

the -s parameter will be "Foo" only (without the quotes). Then
mutt will receive the parameters "Bar" and "Baz" which it treats
as addresses (because there is no option switch infront of them,
so they have to be addresses, see "man mutt" for synopsis).

To deal with this problem, make the shell submit the whole string
as _one_ parameter:

	mutt -s "Foo Bar Baz" [...]

Now -s will receive "Foo Bar Baz" (without the quotes). Use double
quotes because you want shell expansion / variable evaluation.

It's not mutt's fault. :-)

Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...

More information about the freebsd-questions mailing list