Bonjour,

J'essaye d’envoyer un mail avec une pièce jointe au format tgz, je reçois le mail avec une pièce de jointe avec un format d'encodage impossible de l'ouvrir avec un logiciel de décompression.
Pourriez vous m'aider svp.


Code:

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#-------------------------------------------------------------------------
# MAIN
#-------------------------------------------------------------------------
# Récupération des extractions  à collecter
 
# Récupération des extractions sur la volumétrie Oracle à collecter
 
rm -f $REXTORADBPRD
 
find /home/esha8470-type f -name '*cibles*''cvs'|
while read line;
do cd "$(dirname $line)"
  if [ -f $REXTORADBPRD ]; then
    tar -rf $REXTORADBPRD "$(basename $line)"
  else
    tar -cf $REXTORADBPRD "$(basename $line)"
  fi
done
 
gzip -9 $REXTORADBPRD
 
 
echo " " | tee -a ${LOG_SYNTHESE}
echo  " " | tee -a ${LOG_SYNTHESE}
trc_synthese_batch "            #------------------------------------------------------------#"
trc_synthese_batch "            #       Debut du traitement ... ${SCRIPT}                                    #"
trc_synthese_batch "            #     Nom de l'environnement = $NOMENV, User = $USER         #"
trc_synthese_batch "            #------------------------------------------------------------#"
trc_synthese_batch "                                                                      "
echo " " | tee -a ${LOG_SYNTHESE}
 
 
                #Debut de la construction du mail avec piece jointe
                echo "from: ${NOM_SERVEUR}" >$Dir_Temp/mail_resultat_construction_table_referent
                echo "To: <a href="mailto:tit.toto@hotmail.fr">tit.toto@hotmail.fr</a>" >>$Dir_Temp/mail_resultat_construction_table_referent
                echo "Subject: Traitement Construction Table Referent" >>$Dir_Temp/mail_resultat_construction_table_referent
                echo "Mime-Version: 1.0" >>$Dir_Temp/mail_resultat_construction_table_referent
                echo "Content-Type: multipart/mixed; boundary="Separateur"" >>$Dir_Temp/mail_resultat_construction_table_referent
 
                echo "--Separateur" >>$Dir_Temp/mail_resultat_construction_table_referent
                echo "" >>$Dir_Temp/mail_resultat_construction_table_referent
                echo "Bonjour," >>$Dir_Temp/mail_resultat_construction_table_referent
                echo "" >>$Dir_Temp/mail_resultat_construction_table_referent
                echo "" >>$Dir_Temp/mail_resultat_construction_table_referent
                echo "   Voici en piece jointe le fichier du traitement:" >>$Dir_Temp/mail_resultat_construction_table_referent
                echo "      - construction table referent." >>$Dir_Temp/mail_resultat_construction_table_referent
                echo "" >>$Dir_Temp/mail_resultat_construction_table_referent
                echo "" >>$Dir_Temp/mail_resultat_construction_table_referent
                echo "Cordialement" >>$Dir_Temp/mail_resultat_construction_table_referent
                echo "Le DCP placement" >>$Dir_Temp/mail_resultat_construction_table_referent
 
                echo "--Separateur" >>$Dir_Temp/mail_resultat_construction_table_referent
                echo "Content-Type: text/html; name="${REXTORADBPRD}"" >>$Dir_Temp/mail_resultat_construction_table_referent
                echo "Content-Transfert-Encoding: quoted-echoable" >>$Dir_Temp/mail_resultat_construction_table_referent
                echo "Content-Disposition: attachment; filename="${REXTORADBPRD}"" >>$Dir_Temp/mail_resultat_construction_table_referent
 
                cat ${Dir_Logf}/const_referent/${REXTORADBPRD} >>$Dir_Temp/mail_resultat_construction_table_referent
 
                #
                #Envoi du mail
                cat $Dir_Temp/mail_resultat_construction_table_referent | /usr/sbin/sendmail -t
 
                #rm $Dir_Temp/mail_resultat_construction_table_referent
 
# Fin du script
echo " "
echo " "
trc_synthese_batch " Fin execution du script : ${SCRIPT} "
echo " "
echo " "