<<< Date Index >>>     <<< Thread Index >>>

Re: sending attachments from commandline



* Troy Piggins <troy@xxxxxxxxx> [07-09-2005 00:28]:

> I have done some googling, and understand that the following should
> send a mail with attachments from the commandline without
> interaction required from the shell.  Trouble is, I can't get it to
> work.  I want to use a similar line in a script - the < /dev/null
> gives me an empty message body which is fine, I just want the
> attachment.
> 
> mutt -s "testing attachments" -a sample.txt troy@xxxxxxxxxxxxxxxxxxxxx \
>   < /dev/null
> 
> As soon as I take away the -a an argument, it works.

That is strange, because I too believe that this should work.  I use
the following in a shell script daily:

/usr/local/bin/mutt -n -e "my_hdr From: noreply <devnull@xxxxxxxx>" \
  -s "SUBJECT" -a dirkjan.jpg -a djanko.jpg -a stamgasten.jpg \
    -e "fcc-hook .* /dev/null" $EMAIL_RECIPS < /dev/null

Does adding "-n" make a difference?

> If I use an invalid recipient, I get an error message - so I figure
> the mail is at least going somewhere.

Now you've lost me.  What is an "invalid recipient"?  An e-mail
address that is not used?  A wrongly formatted e-mail address?
Furthermore, what is the error message?  Is it an error e-mail
message?  What makes you think the mail is going somewhere?

> When I execute the commandline with an attachment about 1Mb, there
> is a slight pause after the command is executed - I assume this is
> mutt attaching the file and sending it.

Was this with or without supplying a (in your terms) "valid"
recipient?

> But it never seems to get delivered anywhere.  What am I missing?

You could check your MTA's logs (if you have access to them)..

Please elaborate some more..

HTH,

-- 
René Clerc                      - (rene@xxxxxxxx) - PGP: 0x9ACE0AC7

CAT, n.  A soft, indestructible automaton provided by nature to be
kicked when things go wrong in the domestic circle.
-Ambrose Bierce, "The Devil's Dictionary"

Attachment: pgpPaCGMZlxeI.pgp
Description: PGP signature