Mailing-Problem
Ebener, Frank
frank.ebener at toennies.de
Thu May 3 19:14:48 CEST 2007
Hallo zusammen,
Ich habe ein Mail-Problem:
Mit untigem Script versuche ich neue bzw. geänderte Dateien zu finden und deren Namen per mail zu senden.
Aus irgend einem Grund schmeißt einer auf dem Weg zum Mail-Client einige Newlines weg, obwohl definitiv welche drin sind.
Das ganze ist noch lustiger:
Mache ich ein cat auf die zu mailende Datei, und starte mal interaktiv und paste den Datei in mail, dann habe ich das selbe Phaenomen.
Ich kenne das Problem auch noch aus anderem Zusammenhang:
Mit einem Oracle PL/SQL-Package versende ich ebenfall Mails (aber direkt per Port-Befehle und auch auf einer anderen Maschine)
Von daher habe ich postfix stark im Verdacht.
#!/bin/sh
#########################################################
# Check for new Files and Mail
#
# Autor: Frank Ebener (fe)
# Datum: 2007.04.27
#
# Changes
# fe: 27.04.2007 Created
#########################################################
#db-environment setzen
. /prg/ostools/diasys/db.env
RUN_IN=/prg/ostools/edi
CHECK_VERZ=/prg/ostools/edi
LAST_FILE=$CHECK_VERZ/last_ls.txt
LOGNAME=TEMP.errlog.txt
LOGFILE=/tmp/$LOGNAME
DATENBANK=R10G2
PID=$$
#-----------------------
# SendeMail
# Parameter: $1 = Datei, die gemailt werden soll
# $2 = Subject
#-----------------------
MailTo()
{
TO="Frank.ebener at toennies.de"
mail -s "$2" $TO < $1
}
##############################################
# M A I N
##############################################
cd $RUN_IN
cp $LAST_FILE.sik $LAST_FILE
mv $LAST_FILE $LAST_FILE.last
ls -lt --time-style=locale KAGLOBUS-ORDERS* > $LAST_FILE
PID=123
TMP=/tmp/tmp$PID
TMPM=$TMP.mail
#diff $LAST_FILE $LAST_FILE.last |grep \<|cut -d " " -f 8,9,10,11 | sed -e 's/$'"/`echo \\\r`/" >>/tmp/tmp$PID
#diff $LAST_FILE $LAST_FILE.last |grep \<|cut -d " " -f 8,9,10,11 | sed -e 's/$/<br>/' >>/tmp/tmp$PID
#diff $LAST_FILE $LAST_FILE.last |grep \<|cut -d " " -f 8,9,10,11 >$TMP
diff $LAST_FILE.last $LAST_FILE >$TMP
if [ -e $TMP ]
then
echo "Neu/geaendert:">$TMPM
echo >>$TMPM
cat $TMP>>$TMPM
echo "." >>$TMPM
MailTo $TMPM "Neue EDI-Dateien"
fi
#rm $TMP
#rm $TMPM
Exit
Und so kommt das dann mein Empfänger an:
Unnötig, zu sagen, dass die anderen Variation der diff-Zeile
-------- Beginn Beispiel
1,2c1,3
< -rw-r--r-- 1 root root 5 Apr 27 13:50 KAGLOBUS-ORDERS.000000676.ok < -rw-r--r-- 1 root root 0 Apr 26 12:00 KAGLOBUS-ORDERS.000000675.ok
---
> -rw-r--r-- 1 root root 9 Apr 27 15:11 KAGLOBUS-ORDERS.000000675.ok
> -rw-r--r-- 1 root root 5 Apr 27 14:00 KAGLOBUS-ORDERS.000000676.ok
> -rw-r--r-- 1 root root 0 Apr 26 13:00 KAGLOBUS-ORDERS.000000677
--------------- Ende Beispiel
<<tmp123.mail>>
---------- So die Ursprungsdatei
Neu/geaendert:
1,2c1,3
< -rw-r--r-- 1 root root 5 Apr 27 13:50 KAGLOBUS-ORDERS.000000676.ok
< -rw-r--r-- 1 root root 0 Apr 26 12:00 KAGLOBUS-ORDERS.000000675.ok
---
> -rw-r--r-- 1 root root 9 Apr 27 15:11 KAGLOBUS-ORDERS.000000675.ok
> -rw-r--r-- 1 root root 5 Apr 27 14:00 KAGLOBUS-ORDERS.000000676.ok
> -rw-r--r-- 1 root root 0 Apr 26 13:00 KAGLOBUS-ORDERS.000000677
.
---------------Ende
Linux lxrhe24 2.6.5-7.283-smp #1 SMP Wed Nov 29 16:55:53 UTC 2006 x86_64 x86_64 x86_64 GNU/Linux
Bin für jedweden Hinweis dankbar.
Mit freundlichen Grüßen
Frank Ebener
EDV-Abteilung
------------------------------------------------------------------------
B+C TÖNNIES FLEISCHWERK GmbH & Co. KG
In der Mark 2 - 33378 Rheda-Wiedenbrück
Tel.: +49 (0)5242 / 961 - 4007
Fax: +49 (0)5242 / 961 - 151
frank.ebener at toennies.de
www.toennies.de <http://www.toennies.de/>
B+C Toennies Fleischwerk GmbH & CoKG
In der Mark 2-33378 Rheda-Wiedenbrück -
Amtsgericht Gütersloh HRB 5243 - phG: B&C Toennies Fleischwerk
Beteiligungs GmbH, Rheda-Wiedenbrück - Amtsgericht Gütersloh HRB
5683 - Geschäftsführer: Josef Tillmann
Diese E-Mail, sowie eventuelle Anhänge, enthalten vertrauliche
und/oder rechtlich geschützte Informationen. Wenn Sie nicht der
richtige Adressat sind, oder diese E-Mail irrtümlich erhalten
haben, informieren Sie bitte sofort den Absender und vernichten
Sie diese E-Mail. Das unerlaubte Kopieren oder Speichern, sowie
die unbefugte Weitergabe dieser E-Mail sind nicht gestattet.
This e-mail and any attachments may contain confidential and /
or
privileged information. If you are not the intended recipient or
have received this e-mail in error, please notify the sender
immediately and destroy this e-mail. Any unauthorized copying,
storing, disclosure or distribution of the contents of this
e-mail is strictly forbidden.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tmp123.mail
Type: application/octet-stream
Size: 377 bytes
Desc: tmp123.mail
URL: <http://lug-owl.de/pipermail/linux/attachments/20070503/82bb56f7/attachment.obj>
More information about the Linux
mailing list