Mailinglist Archive: opensuse (4656 mails)

< Previous Next >
Re: [opensuse] cron job email attachment.bin
  • From: Sandy Drobic <suse-linux-e@xxxxxxxxxxxxxxxxxxxxxxx>
  • Date: Mon, 29 Jan 2007 11:21:09 +0100
  • Message-id: <45BDCA95.7080603@xxxxxxxxxxxxxxxxxxxxxxx>
Dave Howorth wrote:
My daily backup script on a server mails the output to me (it's a cron
job run by root). Recently, instead of sending me a plain text email
message, it's started sending me an empty email with an attachment
called 'attachment.bin'. This is just a plain text file with the same
old content.

Does anybody know how to make it send me plain text messages again?

The only notable difference I can see in the messages is this header:

< Content-Type: text/plain; charset=us-ascii
---
Content-Type: application/octet-stream; charset=us-ascii

If there are characters in the mail not covered by ascii7 mail is automatically send as "application/octet-stream". This might happen if you have file names with strange characters.

Instead of directly mailing the output you could save it into a file and use mime::lite to send it.

#!/usr/bin/perl
use MIME::Lite;

### Create a new message:
$msg = MIME::Lite->new(
From => 'sender@xxxxxxxxxxx',

To => 'recipient@xxxxxxxxxxx',
# Cc => 'morerecipients@xxxxxxxxxxx',
Subject => 'backup result',
Date => `date`,
Type => 'text/plain',
Encoding => 'base64',
Path => '/path/to/file/',
);

$msg->send;



I certainly haven't deliberately changed any settings, but is there a
setting somewhere that controls this header? Does it depend on the
settings on intermediate boxes that the mail passes through?

The server is running Suse 9.2.

You should probably update your server, 9.2 is no longer supported.


--
Sandy

List replies only please!
Please address PMs to: news-reply2 (@) japantest (.) homelinux (.) com
--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx

< Previous Next >
Follow Ups
References