Re: *attaching* a file to /usr/bin/mail message
On 2005-04-02 14:08, Colin J. Raven [EMAIL PROTECTED] 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[EMAIL PROTECTED] To: test user[EMAIL PROTECTED] 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 M5AIR!IR!A('-A;7!L92!F:6QE('[EMAIL PROTECTED];!B92!U=65N8V]D960@ M=[EMAIL PROTECTED]@95L:79EF5D(%S(%N(4M;6%I; IA='1A8VAM96YT+B!)=!I MRP@;V)V:6]UVQY([EMAIL PROTECTED]5X=!F:[EMAIL PROTECTED]AIR!S:]U;[EMAIL PROTECTED]@=AE .(9O=7)T:!L:[EMAIL PROTECTED]@ end --This_can_not_match_any_other_line_in_the_message-- You use it like this: /usr/bin/mail [EMAIL PROTECTED] mail_with_attachment.txt Obviously, you will have to uuencode your own attachment and replace the one from the example. On my system mail has no -a (attach) flag, and some Googling told me mailx might solve the problem, but /usr/bin/mailx just invokes mail Other mail user agents do have a -a flag though. At least mail/mutt does and I've used it successfully in the past. If you are not stuck with mail(1) only, you can always use mutt for this. mutt -a /path/to/file [EMAIL PROTECTED] ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED] -- Ean Kingston E-Mail: ean_AT_hedron_DOT_org PGP KeyID: 1024D/CBC5D6BB URL: http://www.hedron.org/ ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: *attaching* a file to /usr/bin/mail message
In article [EMAIL PROTECTED], Colin J Raven (cjr) writes: cjr Does anyone happen to know how you would *attach* *not readin the cjr contents of, but actually *attach*) a file using /usr/bin/mail? The metamail package includes metasend, a script which will build a MIME message you can then send to bin/mail or sendmail or whatever. -- Mail me as [EMAIL PROTECTED]_O_ | ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: *attaching* a file to /usr/bin/mail message
On 2005-04-02 14:08, Colin J. Raven [EMAIL PROTECTED] 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. On my system mail has no -a (attach) flag, and some Googling told me mailx might solve the problem, but /usr/bin/mailx just invokes mail Other mail user agents do have a -a flag though. At least mail/mutt does and I've used it successfully in the past. If you are not stuck with mail(1) only, you can always use mutt for this. mutt -a /path/to/file [EMAIL PROTECTED] ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: *attaching* a file to /usr/bin/mail message
On Apr 2 at 15:47, Giorgos Keramidas launched this into the bitstream: On 2005-04-02 14:08, Colin J. Raven [EMAIL PROTECTED] 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. On my system mail has no -a (attach) flag, and some Googling told me mailx might solve the problem, but /usr/bin/mailx just invokes mail Other mail user agents do have a -a flag though. At least mail/mutt does and I've used it successfully in the past. If you are not stuck with mail(1) only, you can always use mutt for this. mutt -a /path/to/file [EMAIL PROTECTED] I'm not stuck with mail, I use it with some shell scriptsbut yeah, I guess I could use muttthere's an idea I hadn't previously considered. Thanks!!! Regards, -Colin ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: *attaching* a file to /usr/bin/mail message
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 2005-04-02, Colin J. Raven scribbled these curious markings: I'm not stuck with mail, I use it with some shell scriptsbut yeah, I guess I could use muttthere's an idea I hadn't previously considered. If you're doing scripting, why not use an actual scripting language, and some tools actually designed to do what you're trying to do? For example, Perl has MIME::Lite, which does exactly what you want -- and not much else. I've used it to automate sending email based on the output of make test. Best Regards, Christopher Nehren -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.0 (FreeBSD) iD8DBQFCTtoGk/lo7zvzJioRArQJAJ9JC2uM3P7+vHtChU3qhV/c0GBbIACgnObf JXdlF8zucP10wfTfZGl5kDE= =sflC -END PGP SIGNATURE- -- I abhor a system designed for the user, if that word is a coded pejorative meaning stupid and unsophisticated. -- Ken Thompson If you ask the wrong questions, you get answers like 42 and God. Unix is user friendly. However, it isn't idiot friendly. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]