From owner-freebsd-questions@FreeBSD.ORG Sun Nov 2 01:54:18 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E187816A4CE for ; Sun, 2 Nov 2003 01:54:17 -0800 (PST) Received: from smtp.infracaninophile.co.uk (happy-idiot-talk.infracaninophile.co.uk [81.2.69.218]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8012543F3F for ; Sun, 2 Nov 2003 01:54:16 -0800 (PST) (envelope-from m.seaman@infracaninophile.co.uk) Received: from happy-idiot-talk.infracaninophile.co.uk (localhost [127.0.0.1]) hA29s6dl074541 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 2 Nov 2003 09:54:06 GMT (envelope-from matthew@happy-idiot-talk.infracaninophile.co.uk) Received: (from matthew@localhost)id hA29s2e1074540; Sun, 2 Nov 2003 09:54:02 GMT (envelope-from matthew) Date: Sun, 2 Nov 2003 09:54:02 +0000 From: Matthew Seaman To: Xpression Message-ID: <20031102095402.GB73745@happy-idiot-talk.infracaninophile.co.uk> Mail-Followup-To: Matthew Seaman , Xpression , FreeBSD-questions References: <000d01c3a0ea$03f89500$0801a8c0@bloodlust> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="RASg3xLB4tUQ4RcS" Content-Disposition: inline In-Reply-To: <000d01c3a0ea$03f89500$0801a8c0@bloodlust> User-Agent: Mutt/1.5.4i X-Spam-Status: No, hits=-4.9 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=2.60 X-Spam-Checker-Version: SpamAssassin 2.60 (1.212-2003-09-23-exp) on happy-idiot-talk.infracaninophile.co.uk cc: FreeBSD-questions Subject: Re: mail question... X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2003 09:54:18 -0000 --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--