Re: [opensuse] cron job email attachment.bin



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



Relevant Pages

  • Re: [opensuse] cron job email attachment.bin
    ... Carlos E. R. wrote: ... job run by root). ... instead of sending me a plain text email ... it's started sending me an empty email with an attachment ...
    (SuSE)
  • Re: [opensuse] cron job email attachment.bin
    ... job run by root). ... instead of sending me a plain text email ... it's started sending me an empty email with an attachment ... In the mail program used. ...
    (SuSE)
  • Re: [opensuse] cron job email attachment.bin
    ... instead of sending me a plain text email ... it's started sending me an empty email with an attachment ... If there are characters in the mail not covered by ascii7 mail is ... contains formatting characters other than newlines and horizontal ...
    (SuSE)
  • Re: savefile design
    ... then why plain UTF8 text in the first ... savefile into an email, ... in the file header or appended at the end. ... If you allow for partial recovery, ...
    (rec.games.roguelike.development)
  • Re: Cristof will upwards bury her proposal
    ... then we wistfully assure Wail and Osama's plain ... root. ... Until Ben undertakes the delights cruelly, ...
    (sci.crypt)