Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
connecting to socket on port 3999
connected
Exception in component tFileInputMail_1
java.lang.NullPointerException
at mailing_s_h.t003_0_1.T003.tFileList_1Process(T003.java:711)
at mailing_s_h.t003_0_1.T003.runJobInTOS(T003.java:1250)
at mailing_s_h.t003_0_1.T003.main(T003.java:1160)
disconnected.
Content-Type: multipart/mixed; boundary="-"
Return-path: <>
Received: toto
by titi
(MDaemon PRO v9.6.5)
with ESMTP id md50000494568.msg
for ""; Mon, 13 Oct 2008 18:58:05 +0200
Authentication-Results: ""
spf=neutral smtp.mail=;
sender-id=neutral header.=;
x-ip-ptr=hardfail ""(no ptr match);
x-ip-helo=pass smtp.helo=""
x-ip-mail=pass smtp.mail= ""
X-Spam-Processed: "", Mon, 13 Oct 2008 18:58:05 +0200
(not processed: message size (52213) exceeds max size (51200))
X-MDOP-RefID: str=0001.0A0B0204.48F37D2A.00EB,ss=1,pt=60562,fgs=256 (_st=1 _vt=0 _iwf=0)
X-MDPtrLookup-Result: hardfail "" (no ptr match) ("")
X-MDHeloLookup-Result: pass smtp.helo=WA2EHSNDR005.bigfishoshf.com ("") ("".s-h.fr)
X-MDMailLookup-Result: pass smtp.mail= ("") (""")
X-MDDKIM-Result: neutral ("")
X-Rcpt-To: ""
X-MDRcpt-To: ""
X-MDRemoteIP:""
X-Return-Path:
X-Envelope-From:
X-MDaemon-Deliver-To: ""
Received: from WA4EHSOBE002.bigfishoshf.com ("") by
WA2EHSNDR005.bigfishoshf.com ("") with Microsoft SMTP Server (TLS) id
8.1.240.5; Mon, 13 Oct 2008 16:53:13 +0000
Received: from mail178-wa4-R.bigfishoshf.com ("") by
WA4EHSOBE002.bigfishoshf.com ("") with Microsoft SMTP Server id
8.1.240.5; Mon, 13 Oct 2008 16:53:13 +0000
Received: by mail178-wa4-R.bigfishoshf.com (Postfix) id 23A096C849A; Mon, 13 Oct
2008 16:53:13 +0000 (UTC)
Date: Mon, 13 Oct 2008 16:53:13 +0000
From: MAILER-DAEMON
Subject: Undelivered Mail Returned to Sender
To:""
MIME-Version: 1.0
Content-Type: multipart/report; report-type=delivery-status;
boundary="A1B036C840B.1223916793/mail178-wa4-R.bigfishoshf.com"
Message-ID: ""
Reply-To: MAILER-DAEMON
X-MDAV-Processed: "", Mon, 13 Oct 2008 18:58:07 +0200
X-Antivirus: avast! (VPS 081013-0, 13/10/2008), Inbound message
X-Antivirus-Status: Clean
--A1B036C840B.1223916793/mail178-wa4-R.bigfishoshf.com
Content-Description: Notification
Content-Type: text/plain
This is the Postfix program at host mail178-wa4-R.bigfishoshf.com.
I'm sorry to have to inform you that your message could not
be delivered to one or more recipients. It's attached below.
For further assistance, please send mail to <postmaster>
If you do so, please include this problem report. You can
delete your own text from the attached returned message.
The Postfix program
<mail@mmmmmm.com>: host "" said: 550 #5.1.0 Address
rejected. (in reply to RCPT TO command)
--A1B036C840B.1223916793/mail178-wa4-R.bigfishoshf.com
Content-Description: Delivery report
Content-Type: message/delivery-status
Reporting-MTA: dns; mail178-wa4-R.bigfishoshf.com
X-Postfix-Queue-ID: A1B036C840B
X-Postfix-Sender: rfc822; ""
Arrival-Date: Mon, 13 Oct 2008 16:53:12 +0000 (UTC)
Final-Recipient: rfc822; mail@mmmmmm.com
Action: failed
Status: 5.0.0
Diagnostic-Code: X-Postfix; host "" said: 550 #5.1.0
Address rejected. (in reply to RCPT TO command)
--A1B036C840B.1223916793/mail178-wa4-R.bigfishoshf.com--
public class extractmail {
public extractmail(){
}
/**
* acesseur
*/
// GET
public static int getNbreSauvegarde()
{
return nbre_sauvegarde;
}
public static String getNomSauvegarde()
{
return nom2sauvegarde;
}
// SET
public static void setNbreSauvegarde()
{
nbre_sauvegarde++;
}
public static void setNomSauvegarde(String n2s)
{
nom2sauvegarde = n2s;
}
public static void extract(String host, String admin, String mot2passe) throws Exception
{
try
{
// etablir la session
Session session = Session.getDefaultInstance(System.getProperties(), null);
// protocole
Store store = session.getStore("pop3");
// connection distante
store.connect(host, admin, mot2passe);
// get folder :: INBOX pour POP3
Folder folder = store.getFolder("INBOX");
// en lecture seul !
folder.open(Folder.READ_ONLY);
// récuperer les messages
Message messages[] = folder.getMessages();
}
catch(Exception e)
{
System.out.println("exception alert : " + e.getMessage());
}
}
public static void handleMultiPart(Multipart multipart) throws Exception
{
if(multipart.getCount() != 0)
{
for(int i = 0, n = multipart.getCount(); i < n; i++)
{
// on trate chaque partie
handleParts(multipart.getBodyPart(i));
}
}
}
public static void handleParts(Part part) throws Exception
{
String disposition = part.getDisposition();
String contentType = part.getContentType();
String filename = part.getFileName();
if(disposition != null)
{
if(disposition.equalsIgnoreCase(Part.ATTACHMENT) || disposition.equalsIgnoreCase("attachement"))
{
setNomSauvegarde(filename);
saveFile(part.getInputStream());
}
}
}
public static void saveFile(InputStream inputstream) throws Exception
{
// sauvegarde du fichier selon la valeur return_path
File file = new File("/where/to/save/",getNomSauvegarde());
readAndWrite(file, inputstream);
}/*saveFile*/
public static void readAndWrite(File file, InputStream inputStream) throws Exception
{
FileOutputStream fos = new FileOutputStream(file);
BufferedOutputStream bos = new BufferedOutputStream(fos);
BufferedInputStream bis = new BufferedInputStream(inputStream);
int aByte;
while((aByte = bis.read()) != -1)
{
bos.write(aByte);
}
bos.flush();
bos.close();
bis.close();
}/*readAndWrite*/
}