From owner-freebsd-questions@FreeBSD.ORG Mon Apr 4 16:21:07 2005 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 13C5F16A4CE for ; Mon, 4 Apr 2005 16:21:07 +0000 (GMT) Received: from prosporo.hedron.org (hedron.org [66.11.182.60]) by mx1.FreeBSD.org (Postfix) with ESMTP id 68AC543D5F for ; Mon, 4 Apr 2005 16:21:06 +0000 (GMT) (envelope-from ean@hedron.org) Received: from www.hedron.org (localhost.hedron.org [127.0.0.1]) by prosporo.hedron.org (Postfix) with ESMTP id AFCF9C104 for ; Mon, 4 Apr 2005 12:21:55 -0400 (EDT) Received: from 216.220.59.169 (SquirrelMail authenticated user ean); by www.hedron.org with HTTP; Mon, 4 Apr 2005 12:21:55 -0400 (EDT) Message-ID: <3791.216.220.59.169.1112631715.squirrel@216.220.59.169> In-Reply-To: <20050402124754.GB6829@gothmog.gr> References: <20050402140601.D9329@kenmore.kozy-kabin.nl> <20050402124754.GB6829@gothmog.gr> Date: Mon, 4 Apr 2005 12:21:55 -0400 (EDT) From: "Ean Kingston" To: freebsd-questions@freebsd.org User-Agent: SquirrelMail/1.4.3a X-Mailer: SquirrelMail/1.4.3a MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal Subject: Re: *attaching* a file to /usr/bin/mail message 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: Mon, 04 Apr 2005 16:21:07 -0000 > On 2005-04-02 14:08, "Colin J. Raven" wrote: >> Does anyone happen to know how you would *attach* *not readin the >> contents of, but actually *attach*) a file using /usr/bin/mail? > > Not very easily, is one answer. You can probably get away with uuencode > output filtered to the standard input of mail(1), but that's not really > a "MIME attachment". Okay, if you really want to use mail, here is what a mail message (suitable for sending through /usr/bin/mail looks like when it has a UUEncoded attachement. Technically you are supposed to MIME-Encode the attachment but pretty much every mail client that supports attachments will read a UUEncoded attachment. From: "System Administrator" To: "test user" Subject: Testing mail attachments. Content-Type: multipart/mixed; boundary="This_can_not_match_any_other_line_in_the_message" MIME-Verion: 1.0 --This_can_not_match_any_other_line_in_the_message Content-Transfer-Encoding: quoted-printable Content-type: text/plain Hi, Attached is a simple text file to test multi-part sending. The file was originally called sample.txt and was created on a SUN system. Notice the string specified in the boundary="..." bit in the headers. That string should not occur anywhere in the body except as part of the mime part delimitters. --This_can_not_match_any_other_line_in_the_message Content-Transfer-Encoding: x-uuencode Content-Type: text/plain; name="sample.txt" Content-Disposition: attachment; filename="sample.txt" begin 644 sample.txt M5&AI with mail(1) only, you can always use mutt for this. > > mutt -a /path/to/file recipient.address@example.net > > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to > "freebsd-questions-unsubscribe@freebsd.org" > -- Ean Kingston E-Mail: ean_AT_hedron_DOT_org PGP KeyID: 1024D/CBC5D6BB URL: http://www.hedron.org/