J'ai un souci pour envoyer un mail via un script perl
- Code: Tout sélectionner
#!/usr/bin/perl -w
use diagnostics;
use strict;
use Net::SMTP;
# Pour envoyer des pieces jointes
use Net::SMTP::Multipart;
my $smtp = Net::SMTP::Multipart->new('localhost');
my $sto = 'anne-nuts@xxx.yyyyyyy.com';
my $ssuj = 'RE: essai 11 (Your file is rejected : error spooling aborting)';
my $sfrom = 'faxadmin@xxx.yyyyyyy.com';
my $sBcc = 'admin@xxx.yyyyyyy.com';
my $sCc = '';
my $date = ` date -R `;
chomp $date;
my $mesA = ' Analyze message for coverpage and analyse information to send filel';
our @tab_fich = ();
my $repfax = "home/tmp/repfax26965";
my $page_garde = "$repfax/page_garde.txt";
my $page_garde1 = "page_garde.txt";
my @filetest1 = ();
@filetest1 = ($page_garde1,$page_garde);
push(@tab_fich,[@filetest1]);
# on complète le mail sortant :
# Envoi entête du mail
$smtp->Header(To => $sto,
Subj => $ssuj,
From => $sfrom,
Date => $date
);
# Envoi du corps du mail
$smtp->Text("$mesA");
# Envoi des pièces jointes
$smtp->FileAttach(@tab_fich);
# expedition du mail
$smtp->End();
log qsmtp
Celui de 16h17 envoyé avec le script perl, celui de 19h02 envoyé avec webmail
2009-05-02 16:17:27.924644500 27566 Accepted connection 0/40 from 127.0.0.1 / localhost
2009-05-02 16:17:27.926148500 27566 Connection from localhost [127.0.0.1]
2009-05-02 16:17:28.053040500 27566 220 nuts.xxx.yyyyyyy.com ESMTP
2009-05-02 16:17:28.057450500 27566 dispatching EHLO localhost.localdomain
2009-05-02 16:17:28.098558500 27566 250-xxx.yyyyyyy.com Hi localhost [127.0.0.1]
2009-05-02 16:17:28.099558500 27566 250-PIPELINING
2009-05-02 16:17:28.100516500 27566 250-8BITMIME
2009-05-02 16:17:28.101481500 27566 250 SIZE 15000000
2009-05-02 16:17:28.282509500 27566 dispatching MAIL FROM:<faxadmin@xxx.yyyyyyy.com>
2009-05-02 16:17:28.284356500 27566 full from_parameter: FROM:<faxadmin@xxx.yyyyyyy.com>
2009-05-02 16:17:28.286088500 27566 from email address : [<faxadmin@xxx.yyyyyyy.com>]
2009-05-02 16:17:28.292913500 27566 getting mail from <faxadmin@xxx.yyyyyyy.com>
2009-05-02 16:17:28.294021500 27566 250 <faxadmin@xxx.yyyyyyy.com>, sender OK - how exciting to get mail from you!
2009-05-02 16:17:28.296843500 27566 dispatching RCPT TO:<anne-nuts@xxx.yyyyyyy.com>
2009-05-02 16:17:28.299980500 27566 to email address : [<anne-nuts@xxx.yyyyyyy.com>]
2009-05-02 16:17:28.412184500 27566 250 <anne-nuts@xxx.yyyyyyy.com>, recipient ok
2009-05-02 16:17:28.414671500 27566 dispatching DATA
2009-05-02 16:17:28.416472500 27566 354 go ahead
2009-05-02 16:17:28.467429500 27566 spooling message to disk
2009-05-02 16:17:28.493128500 27566 logging::logterse plugin: ` 127.0.0.1 localhost localhost.localdomain <faxadmin@xxx.yyyyyyy.com> <anne-nuts@>xxx.yyyyyyy.com check_basicheaders 901 Mail with no From header not accepted here msg denied before queued
2009-05-02 16:17:28.495609500 27566 552 Mail with no From header not accepted here
2009-05-02 16:17:28.498824500 27566 dispatching QUIT
2009-05-02 16:17:28.501064500 27566 221 xxx.yyyyyyy.com closing connection. Have a wonderful day.
2009-05-02 16:17:28.511573500 27566 click, disconnecting
2009-05-02 16:17:28.815609500 8856 cleaning up after 27566
2009-05-02 19:02:52.169410500 27796 Accepted connection 0/40 from 127.0.0.1 / localhost
2009-05-02 19:02:52.170939500 27796 Connection from localhost [127.0.0.1]
2009-05-02 19:02:52.353418500 27796 220 nuts.xxx.yyyyyyy.com ESMTP
2009-05-02 19:02:52.366194500 27796 dispatching EHLO localhost
2009-05-02 19:02:52.440266500 27796 250-xxx.yyyyyyy.com Hi localhost [127.0.0.1]
2009-05-02 19:02:52.441287500 27796 250-PIPELINING
2009-05-02 19:02:52.442322500 27796 250-8BITMIME
2009-05-02 19:02:52.443328500 27796 250 SIZE 15000000
2009-05-02 19:02:52.451991500 27796 dispatching MAIL FROM:<faxadmin@xxx.yyyyyyy.com>
2009-05-02 19:02:52.453849500 27796 full from_parameter: FROM:<faxadmin@xxx.yyyyyyy.com>
2009-05-02 19:02:52.455604500 27796 from email address : [<faxadmin@xxx.yyyyyyy.com>]
2009-05-02 19:02:52.462551500 27796 getting mail from <faxadmin@xxx.yyyyyyy.com>
2009-05-02 19:02:52.463657500 27796 250 <faxadmin@xxx.yyyyyyy.com>, sender OK - how exciting to get mail from you!
2009-05-02 19:02:52.471400500 27796 dispatching RCPT TO:<anne-nuts@xxx.yyyyyyy.com>
2009-05-02 19:02:52.473215500 27796 to email address : [<anne-nuts@xxx.yyyyyyy.com>]
2009-05-02 19:02:52.489921500 27796 250 <anne-nuts@xxx.yyyyyyy.com>, recipient ok
2009-05-02 19:02:52.493146500 27796 dispatching DATA
2009-05-02 19:02:52.494889500 27796 354 go ahead
2009-05-02 19:02:52.539421500 27796 spooling message to disk
2009-05-02 19:02:52.934472500 27796 virus::clamav plugin: Changing permissions on file to permit scanner access
2009-05-02 19:02:53.073395500 27796 virus::clamav plugin: clamscan results: /var/spool/qpsmtpd/1241283772:27796:0: OK
2009-05-02 19:02:53.080002500 27796 logging::logterse plugin: ` 127.0.0.1 localhost localhost <faxadmin@xxx.yyyyyyy.com> <anne-nuts@xxx.yyyyyyy.com> queued <20090502190251.579358ls5xbd8j8c@10.97.1.80>
2009-05-02 19:02:53.088821500 27801 queue::qmail_2dqueue plugin: (for 27796 ) Queuing qp 27801 to /var/qmail/bin/qmail-queue
2009-05-02 19:02:53.136363500 27796 250 Queued! 1241283773 qp 27801 <20090502190251.579358ls5xbd8j8c@10.97.1.80>
2009-05-02 19:02:53.139730500 27796 dispatching QUIT
2009-05-02 19:02:53.142251500 27796 221 xxx.yyyyyyy.com closing connection. Have a wonderful day.
2009-05-02 19:02:53.150046500 27796 click, disconnecting
2009-05-02 19:02:53.936452500 8856 cleaning up after 27796
Si vous avez une idée pourquoi mon script perl ne fonctionne pas (il fonctionnait avec sme 6)
merci
anne