[Logwatch] mime Application/OCTET-STREAM

Hartmut Wziontek hwz at hwz.bv.TU-Berlin.DE
Wed Nov 16 01:20:02 MST 2005


many thanks for all your help,
all alternatives work well, html-embed, piping through sendmail
and mime-encoding using the scripts provided by mike.
one can study which efforts an automatism can cause...

hartmut


On Tue, 15 Nov 2005, logwatch at mikecappella.com wrote:

>> Subject: Re: [Logwatch] mime Application/OCTET-STREAM
>>
>> On Tue, 2005-11-15 at 21:57 +0100, Hartmut Wziontek wrote:
>>
>>>
>>> nail seem choose this mime-type automatically:
>>>         Otherwise, or if the
>>>         filename has no extension, the content  types
>> text/plain  or  applica-
>>>         tion/octet-stream  are  used,  the first for text
>> or international text
>>>         files, the second for any  file  that  contains
>> formatting  characters
>>>         other than newlines and horizontal tabulators.
>>>
>>> Is there any way around this? should I install the old mail
>> (suse uses
>>> nail as default)?
>>>
>>
>
> If you mime encode it yourself will that bypass the problem?  I use
> mimesend-inline (a version of mimesend I modified for my needs) to avoid
> anti-spam filters:
>
> -------- crontab script --------------
>
> # Encode logwatch's output to prevent postfix from detecting body_checks
> messages in the log,
> # causing logwatch's mail to be rejected
> #
> subject="LogWatch mailhost `/bin/date +'%D'`"
> /usr/share/logwatch/scripts/logwatch.pl --print |
> /usr/local/bin/mimesend-inline -S "$subject" root
>
>
> ------- mimesend-inline -------------
>
> #!/usr/bin/perl -w
>
> # Simple script to send the contents of stdin as an
> # application/octet-stream MIME block. Parameters are "-s Subject",
> # "-n Suggested Name For File" (defaults to "no-name"), and as many
> # recipients as you like.
> #
> # Uses sendmail to do the actual send, so you gotta have that
> # configured.
> use strict;
> use MIME::Entity;
> use Getopt::Long;
> use File::Temp;
>
> my $subject = "";
> my $name = "no-name";
> my @recipients;
>
> if ( !GetOptions( "s=s" => \$subject, "n=s" => \$name )) {
>  die "Bad Args";
> }
>
> die "no recipients specified" unless @ARGV;
>
> while( @ARGV ) {
>  push @recipients, shift @ARGV;
> }
>
> # Get the data, which we will for now presume to be a binary block
> my $data = "";
> {
>  local $/ = undef;
>  $data = <>;
> }
>
> my $msg = MIME::Entity->build( To => $recipients[0],
>                               Subject => $subject,
>              Disposition => "inline",
>              Type   => "text/plain",
>              Encoding    => "base64",
>              Data => $data);
> #                               Data => [ "This is your message.\n" ] );
>
> #$msg->attach( Data => $data,
> #             Disposition => "inline",
> #             Type   => "text/plain",
> #             Encoding    => "base64"
> #              );
>
> #$msg->send( 'sendmail' ) || die "Mail send failed ($!)";
> ### Send it:
> open MAIL, "| /usr/sbin/sendmail -t -oi" or die "open: $!";
> #open MAIL, "| /bin/cat" or die "open: $!";
> $msg->print(\*MAIL);
> close MAIL;
>
> _______________________________________________
> Logwatch mailing list
> Logwatch at logwatch.org
> http://www2.list.logwatch.org:8080/lists/listinfo/logwatch
>


More information about the Logwatch mailing list