From owner-freebsd-questions@FreeBSD.ORG Fri Jul 23 06:08:09 2004 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 9411C16A4CE for ; Fri, 23 Jul 2004 06:08:09 +0000 (GMT) Received: from wolf.bytecraft.au.com (wolf.bytecraft.au.com [203.39.118.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5F45F43D41 for ; Fri, 23 Jul 2004 06:08:08 +0000 (GMT) (envelope-from murraytaylor@bytecraftsystems.com) Received: from localhost (localhost [127.0.0.1])i6N68041005454; Fri, 23 Jul 2004 16:08:00 +1000 (EST) (envelope-from murraytaylor@bytecraftsystems.com) Received: from wolf.bytecraft.au.com ([127.0.0.1]) by localhost (wolf.bytecraft.au.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 05446-01; Fri, 23 Jul 2004 16:07:59 +1000 (EST) Received: from svmarshal.bytecraft.au.com ([10.0.0.4])i6N67vAF005452; Fri, 23 Jul 2004 16:07:57 +1000 (EST) (envelope-from murraytaylor@bytecraftsystems.com) Received: from wombat.bytecraft.au.com (Not Verified[10.0.0.3]) by svmarshal.bytecraft.au.com with MailMarshal (v5,0,3,78) id ; Fri, 23 Jul 2004 16:05:56 +1000 Received: from [10.0.17.42] (wstaylorm.dand06.au.bytecraft.au.com [10.0.17.42]) by wombat.bytecraft.au.com (Postfix) with ESMTP id 7BA313F0F; Fri, 23 Jul 2004 16:07:54 +1000 (EST) From: Murray Taylor To: jaymo@cromagnon.cullmail.com In-Reply-To: <200407230057.06978.jaymo@cromagnon.cullmail.com> References: <200407162036.i6GKaNt11099@www.plutao.lusodigital.net> <200407202324.30211.jaymo@cromagnon.cullmail.com> <20040721090847.F85700@chylonia.3miasto.net> <200407230057.06978.jaymo@cromagnon.cullmail.com> Organization: Bytecraft Systems Message-Id: <1090562873.349.22.camel@wstaylorm.dand06.au.bytecraft.au.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Fri, 23 Jul 2004 16:07:53 +1000 Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.1 cc: Wojciech Puchar cc: Murray Taylor cc: freebsdquestions cc: carla.neves@nereus.pt Subject: Re: How to send attached files on sendmail with mail tool? 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: Fri, 23 Jul 2004 06:08:09 -0000 man uuencode uuencode [-m] [-o output_file] [file] name he uuencode utility reads file (or by default the standard input) and writes an encoded version to the standard output, or output_file if one has been specified. The encoding uses only printing ASCII characters and includes the mode of the file and the operand name for use by uudecode. This works with winblows - I use it in production here cat file | uuencode tgt_filname | mail -s "subject" test@example.com ^ ^ | +--- attachment FILENAME for the target host to use +--- attachment CONTENT from the source host the input file is via stdin to uuencode - this becomes the CONTENT of the attachment the File name given to the ATTACHMENT is the tgt_filename The result is an email with only on thing inside it - the attachment. On Fri, 2004-07-23 at 15:57, Jay Moore wrote: > On Wednesday 21 July 2004 02:10 am, Wojciech Puchar wrote: > > > > cat file | uuencode tgt_filname | mail -s "subject" test@example.com > > > > uuencode > > > instead of cat. less one unneeded piping. > > > > > > subject can be derived from shell script variables if necessary. > > > > > > Do you have to do a uudecode on the receiving end to recover the file? > > > > > > I tried this - sending a pdf file from this FreeBSD system to a Windoze > > > user that gets mail via POP - it didn't work. The filename came through, > > > and it was listed as an attachment, but there was nothing useful in the > > > file. > > > > i think windoze just can't decode uuencoded attachments right. > > > > it only supports base64 right. > > > > metamail will be useful, possibly > > > > /usr/local/bin/encode-base64 was installed by package p5-MIME-Base64-2.21 > > I'm sure you are correct about Windows... I guess the point I was trying to > make is that I think Base64 encoding and appropriate MIME headers are > required to be placed in the message to make it a "compliant" message. So > while this script may work in certain limited situations, it's probably not a > good "general purpose" solution. > > Jay > > **************************************************************** > This Email has been scanned for Viruses by MailMarshal. > **************************************************************** -- Murray Taylor Special Projects Engineer --------------------------------- Bytecraft Systems & Entertainment P: +61 3 8710 2555 F: +61 3 8710 2599 D: +61 3 9238 4275 M: +61 417 319 256 E: murraytaylor@bytecraftsystems.com or visit us on the web http://www.bytecraftsystems.com http://www.bytecraftentertainment.com --------------------------------------------------------------- The information transmitted in this e-mail is for the exclusive use of the intended addressee and may contain confidential and/or privileged material. Any review, re-transmission, dissemination or other use of it, or the taking of any action in reliance upon this information by persons and/or entities other than the intended recipient is prohibited. If you received this in error, please inform the sender and/or addressee immediately and delete the material. E-mails may not be secure, may contain computer viruses and may be corrupted in transmission. Please carefully check this e-mail (and any attachment) accordingly. No warranties are given and no liability is accepted for any loss or damage caused by such matters. --------------------------------------------------------------- **************************************************************** This Email has been scanned for Viruses by MailMarshal. ****************************************************************