Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 2 Nov 2003 09:54:02 +0000
From:      Matthew Seaman <m.seaman@infracaninophile.co.uk>
To:        Xpression <admin@atenas.cult.cu>
Cc:        FreeBSD-questions <questions@freebsd.org>
Subject:   Re: mail question...
Message-ID:  <20031102095402.GB73745@happy-idiot-talk.infracaninophile.co.uk>
In-Reply-To: <000d01c3a0ea$03f89500$0801a8c0@bloodlust>
References:  <000d01c3a0ea$03f89500$0801a8c0@bloodlust>

next in thread | previous in thread | raw e-mail | index | archive | help

--RASg3xLB4tUQ4RcS
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sat, Nov 01, 2003 at 09:35:43PM -0500, Xpression wrote:
>             Hi guys, I have read the man pages about mail, but I can't fo=
und
> something to attacht files to sent mails, and I want to mail me some files
> from the server to not have to login to read them...somebody can tell me =
???
> There is any other solution to get the files, please any help deeply
> grateful...

There's a couple or three things you can do.  If all you want to do is
be able to read the file at the other end (rather than saving it to
disk), and it's an acsii text format, then you can just pipe the file
into the mail(1) command as the body of an e-mail:

    % mail -s "Some subject" recipient@example.com < the-file-in-question

If the file you want to send is binary, or you want to be able to
extract it from the e-mail at the other end, then you can use
uuencode(1):

    % uuencode filename filename | mail -s "Some subject" recipient@example=
=2Ecom

Note that you have to put *two* file names on the uuencode command
line: the first is the file to read into uuencode and the second is
the name that uudecode(1) should use to save the file as at the other
end.  Most unix mail clients will understand how to extract uuencoded
messages, or you can just save the message to a file, which you then
run uudecode on.  uudecode will ignore all of the message headers and
other stuff automatically.

That's about the limit of what you can do with the default system:
more sophisticated things are possible if you install various bits and
pieces out of the ports tree.  If you want the file to be sent as a
full-blown MIME attachment, there are quite a lot of bits of software
for handling MIME encapsulation in there.

Probably the easiest thing to do is install one of the mutt ports --
mail/mutt or mail/mutt-devel; either will work.  Then:

    % mutt -a file-name

will pop you into an editor where you can fill in the message
recipients, subject line, any cover noted required etc. and then send
the message with the file as an attachment.

If you want to send a message unattended (described as "batch" mode in
the mutt documentation
http://www.mutt.org/doc/manual/manual-6.html#ss6.1 ) then all you need
to do is redirect mutt's standard input from a file -- the contents of
the input will form the body of the message:

    % echo "Here is the file you want" | mutt -a file-name -s "Some subject=
" recipient@example.com

There are all sorts of things you can make mutt do -- see
http://www.mutt.org/doc/manual/manual.html -- it really is the least
sucky mail client around.

	Cheers,

	Matthew

--=20
Dr Matthew J Seaman MA, D.Phil.                       26 The Paddocks
                                                      Savill Way
PGP: http://www.infracaninophile.co.uk/pgpkey         Marlow
Tel: +44 1628 476614                                  Bucks., SL7 1TH UK

--RASg3xLB4tUQ4RcS
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (FreeBSD)

iD8DBQE/pNQ6dtESqEQa7a0RAk3tAJ9hecx3TaexZOKM+uRHV9hI3zjLaQCgl0go
ppdC+E3PY4Z9/eu4JlhKBZM=
=YFTL
-----END PGP SIGNATURE-----

--RASg3xLB4tUQ4RcS--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20031102095402.GB73745>