RE: Attachments via /usr/bin/sendmail

2001-03-25 Thread Todd Goldenbaum

On Sun, 25 Mar 2001, Paul J. Schinder wrote:
> >Hmmm...I thought I had it, but not quite. For some
> >reason, my Perl script is outputting to the screen,
> >not my mailwrapper. Are there any limitations on what
> >you can send to the mailwrapper? My program is below:
> >
> >#!/usr/bin/perl
> >
> >$fileout = system("/bin/cat
> >/home/www/schnarff/images/chili.jpg |
> >/usr/bin/uuencode /home/www/schnarff/chili.jpg");
> >$bound = "---bound";
> >
> >open (MAIL, "|/usr/bin/sendmail -t");
> >print MAIL "To: alexlefevre\@yahoo.com\n";
> >print MAIL "Mime-Version: 1.0\n";
> >print MAIL "Content-Type: multipart/mixed;
> >boundary=\"$bound\"; charset=\"iso-8859-1\"\n";
> >print MAIL "$bound\n";
> >print MAIL "Content-Type: image/jpg;
> >name=\"chili.jpg\"\n";
> >print MAIL "Content-Disposition: attachment;
> >filename=\"chili.jpg\"";
> >print MAIL "Content-Transfer-Encoding: uuencode";
> >print MAIL "$fileout";
> >close MAIL;
>
> This may be a little late, but why don't you simply use one of the
> many Perl modules that deal with MIME and know how to do it right,
> for example, MIME::Lite?  Go to .

Would the above solution (and the equiv. using MIME::Lite apply to
qmail-inject as well?  I'm trying to send attachments from a perl
script, too.

thanks,
todd





RE: Attachments via /usr/bin/sendmail

2001-03-25 Thread Paul J. Schinder

>Hmmm...I thought I had it, but not quite. For some
>reason, my Perl script is outputting to the screen,
>not my mailwrapper. Are there any limitations on what
>you can send to the mailwrapper? My program is below:
>
>#!/usr/bin/perl
>
>$fileout = system("/bin/cat
>/home/www/schnarff/images/chili.jpg |
>/usr/bin/uuencode /home/www/schnarff/chili.jpg");
>$bound = "---bound";
>
>open (MAIL, "|/usr/bin/sendmail -t");
>print MAIL "To: alexlefevre\@yahoo.com\n";
>print MAIL "Mime-Version: 1.0\n";
>print MAIL "Content-Type: multipart/mixed;
>boundary=\"$bound\"; charset=\"iso-8859-1\"\n";
>print MAIL "$bound\n";
>print MAIL "Content-Type: image/jpg;
>name=\"chili.jpg\"\n";
>print MAIL "Content-Disposition: attachment;
>filename=\"chili.jpg\"";
>print MAIL "Content-Transfer-Encoding: uuencode";
>print MAIL "$fileout";
>close MAIL;

This may be a little late, but why don't you simply use one of the 
many Perl modules that deal with MIME and know how to do it right, 
for example, MIME::Lite?  Go to .


>
>Alex
>
>__
>Do You Yahoo!?
>Get email at your own domain with Yahoo! Mail.
>http://personal.mail.yahoo.com/

-- 
--
Paul J. Schinder
NASA Goddard Space Flight Center
Code 693
[EMAIL PROTECTED]



RE: Attachments via /usr/bin/sendmail

2001-03-22 Thread Alex Le Fevre

Hmmm...I thought I had it, but not quite. For some
reason, my Perl script is outputting to the screen,
not my mailwrapper. Are there any limitations on what
you can send to the mailwrapper? My program is below:

#!/usr/bin/perl

$fileout = system("/bin/cat
/home/www/schnarff/images/chili.jpg |
/usr/bin/uuencode /home/www/schnarff/chili.jpg");
$bound = "---bound";

open (MAIL, "|/usr/bin/sendmail -t");
print MAIL "To: alexlefevre\@yahoo.com\n";
print MAIL "Mime-Version: 1.0\n";
print MAIL "Content-Type: multipart/mixed;
boundary=\"$bound\"; charset=\"iso-8859-1\"\n";
print MAIL "$bound\n";
print MAIL "Content-Type: image/jpg;
name=\"chili.jpg\"\n";
print MAIL "Content-Disposition: attachment;
filename=\"chili.jpg\"";
print MAIL "Content-Transfer-Encoding: uuencode";
print MAIL "$fileout";
close MAIL;


Alex

__
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/



RE: Attachments via /usr/bin/sendmail

2001-03-22 Thread Alex Le Fevre

That made it come through as a bunch of gobbledygook
to my mail...but that's OK, because I know what I have
to write on my mailwrapper to get it to see that it's
an attachment. I think that suggestion will do the
trick. Thanks!

Alex Le Fevre

__
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/



RE: Attachments via /usr/bin/sendmail

2001-03-22 Thread Kep Brown

Give it a try.  I did and the gif came through correctly.

Command
(cat ants-logo.gif|uuencode ants-logo.gif;echo "Hi
Kep")|/var/qmail/bin/qmail-inject [EMAIL PROTECTED]
om

Kep

  _

  ants.com <http://www.ants.com>  scout <http://www.ants.com/scout>

Kep Brown
Systems, Network and Database Administrator
phone: (805) 560-3781
fax: (805) 560-3991
e: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>




-Original Message-
From: Alex Le Fevre [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 22, 2001 8:59 AM
To: [EMAIL PROTECTED]
Subject: Attachments via /usr/bin/sendmail


How would I go about attaching encoded files (i.e.
jpg, gif, etc.) via the mailwrapper? I'm trying to
write a Perl script that first uploads a file (which
I've done no problem), and then e-mails it out to a
specified address. I've seen some examples that
mentioned uuencoding, but I'm not sure if this would
be right for all types of attachments.

Thanks,
Alex Le Fevre

__
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/




Attachments via /usr/bin/sendmail

2001-03-22 Thread Alex Le Fevre

How would I go about attaching encoded files (i.e.
jpg, gif, etc.) via the mailwrapper? I'm trying to
write a Perl script that first uploads a file (which
I've done no problem), and then e-mails it out to a
specified address. I've seen some examples that
mentioned uuencoding, but I'm not sure if this would
be right for all types of attachments.

Thanks,
Alex Le Fevre

__
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/