commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Hoffer <dhoff...@gmail.com>
Subject Re: commons-email sending email twice?
Date Tue, 02 Apr 2013 03:52:24 GMT
But I'm quite sure email.send() is only being called once...as I log each
of those calls.  It's that the one send() call ends up sending two emails.
 The duplicate emails seems related to the two email recipients   I'm going
to try building a separate email for each recipient and see how that goes.

The one other strange thing that is happening...and now I wonder if they
are related.  In my main logic I move emails from Inbox to another folder.
 I call message.setFlag(DELETED, true) after the copy to remove from the
Inbox (the remove actually happens later when inbox.close(true) is called.
 However for some reason now message.setFlag(DELETED, true) often will
throw a MessageRemovedException.  However I have no idea why it would throw
this as it's a new message that was just read and it's the first time the
DELETED flag was set and inbox.close(true) has not been called yet.

Both of these issues started at about the same time.  Both are
unexpected/unexplained.

-Dave


On Mon, Apr 1, 2013 at 12:42 PM, Siegfried Goeschl <sgoeschl@gmx.at> wrote:

> Indeed I do ... :-) ... Email.send() returns the msg id
>
> Cheers,
>
> Siegfried Goeschl
>
>
>
> On 01.04.13 19:12, David Hoffer wrote:
>
>> Do you know the API to get that ID?  I'd like to add that to the logs.
>>
>> -Dave
>>
>>
>> On Mon, Apr 1, 2013 at 11:03 AM, Siegfried Goeschl <sgoeschl@gmx.at>
>> wrote:
>>
>>  Hi folks,
>>>
>>> log seems okay - a few hints
>>>
>>> A hint every message constructed by the mail api has a unique mail id (if
>>> not overwritten by the application)  - if your duplicates have different
>>> mail ids then the application sent indeed two emails
>>>
>>> Cheers,
>>>
>>> Siegfried Goeschl
>>>
>>>
>>> On 30.03.13 07:43, Maurizio Cucchiara wrote:
>>>
>>>  Looking at the log, seems everything right to me.
>>>>
>>>> Anyway, when I face this kind of trouble (SMTP protocol is a strange
>>>> beast
>>>> :)), my best friend is tcpdump/wireshark.
>>>> Tcpdump will address you to the side where you have to investigate.
>>>>
>>>>
>>>> Twitter     :http://www.twitter.com/m_****cucchiara<http://www.twitter.com/m_**cucchiara>
>>>> <http://www.twitter.**com/m_cucchiara<http://www.twitter.com/m_cucchiara>
>>>> >
>>>> G+          :https://plus.google.com/****107903711540963855921<https://plus.google.com/**107903711540963855921>
>>>> <https://**plus.google.com/**107903711540963855921<https://plus.google.com/107903711540963855921>
>>>> >
>>>> Linkedin    :http://www.linkedin.com/in/****mauriziocucchiara<http://www.linkedin.com/in/**mauriziocucchiara>
>>>> <http://www.**linkedin.com/in/**mauriziocucchiara<http://www.linkedin.com/in/mauriziocucchiara>
>>>> >
>>>> VisualizeMe: http://vizualize.me/maurizio.****<http://vizualize.me/maurizio.**>
>>>> cucchiara?r=maurizio.**cucchiara<http://vizualize.me/**
>>>> maurizio.cucchiara?r=maurizio.**cucchiara<http://vizualize.me/maurizio.cucchiara?r=maurizio.cucchiara>
>>>> >
>>>>
>>>>
>>>> Maurizio Cucchiara
>>>>
>>>>
>>>> On 30 March 2013 01:48, David Hoffer <dhoffer6@gmail.com> wrote:
>>>>
>>>>   I was able to redirect the system outputs to the log file...just
>>>> easier
>>>>
>>>>> that way for me.  Here is what's in the log file (with some email
>>>>> addresses
>>>>> mods to protect the innocent):
>>>>>
>>>>> 2013-03-30 00:30:49,524 [main] INFO  SYSOUT - DEBUG: JavaMail version
>>>>> 1.4.4
>>>>> 2013-03-30 00:30:49,533 [main] INFO  SYSOUT - DEBUG: successfully
>>>>> loaded
>>>>> resource: /META-INF/javamail.default.****providers
>>>>>
>>>>> 2013-03-30 00:30:49,533 [main] INFO  SYSOUT - DEBUG: Tables of loaded
>>>>> providers
>>>>> 2013-03-30 00:30:49,533 [main] INFO  SYSOUT - DEBUG: Providers Listed
>>>>> By
>>>>> Class Name:
>>>>>
>>>>> {com.sun.mail.smtp.****SMTPSSLTransport=javax.mail.**
>>>>> Provider[TRANSPORT,smtps,com.****sun.mail.smtp.****
>>>>> SMTPSSLTransport,Sun
>>>>> Microsystems, Inc],
>>>>>
>>>>> com.sun.mail.smtp.****SMTPTransport=javax.mail.**
>>>>> Provider[TRANSPORT,smtp,com.****sun.mail.smtp.SMTPTransport,****Sun
>>>>> Microsystems, Inc],
>>>>>
>>>>> com.sun.mail.imap.****IMAPSSLStore=javax.mail.**
>>>>> Provider[STORE,imaps,com.sun.****mail.imap.IMAPSSLStore,Sun
>>>>> Microsystems, Inc],
>>>>>
>>>>> com.sun.mail.pop3.****POP3SSLStore=javax.mail.**
>>>>> Provider[STORE,pop3s,com.sun.****mail.pop3.POP3SSLStore,Sun
>>>>> Microsystems, Inc],
>>>>>
>>>>> com.sun.mail.imap.IMAPStore=****javax.mail.Provider[STORE,**
>>>>> imap,com.sun.mail.imap.****IMAPStore,Sun
>>>>> Microsystems, Inc],
>>>>>
>>>>> com.sun.mail.pop3.POP3Store=****javax.mail.Provider[STORE,**
>>>>> pop3,com.sun.mail.pop3.****POP3Store,Sun
>>>>>
>>>>> Microsystems, Inc]}
>>>>> 2013-03-30 00:30:49,533 [main] INFO  SYSOUT - DEBUG: Providers Listed
>>>>> By
>>>>> Protocol:
>>>>> {imaps=javax.mail.Provider[****STORE,imaps,com.sun.mail.imap.****
>>>>> IMAPSSLStore,Sun
>>>>> Microsystems, Inc],
>>>>> imap=javax.mail.Provider[****STORE,imap,com.sun.mail.imap.***
>>>>> *IMAPStore,Sun
>>>>> Microsystems, Inc],
>>>>>
>>>>> smtps=javax.mail.Provider[****TRANSPORT,smtps,com.sun.mail.****
>>>>> smtp.SMTPSSLTransport,Sun
>>>>> Microsystems, Inc],
>>>>> pop3=javax.mail.Provider[****STORE,pop3,com.sun.mail.pop3.***
>>>>> *POP3Store,Sun
>>>>> Microsystems, Inc],
>>>>> pop3s=javax.mail.Provider[****STORE,pop3s,com.sun.mail.pop3.****
>>>>> POP3SSLStore,Sun
>>>>> Microsystems, Inc],
>>>>> smtp=javax.mail.Provider[****TRANSPORT,smtp,com.sun.mail.**
>>>>>
>>>>> smtp.SMTPTransport,Sun
>>>>> Microsystems, Inc]}
>>>>> 2013-03-30 00:30:49,533 [main] INFO  SYSOUT - DEBUG: successfully
>>>>> loaded
>>>>> resource: /META-INF/javamail.default.****address.map
>>>>>
>>>>> 2013-03-30 00:30:49,543 [main] INFO  SYSOUT - DEBUG: getProvider()
>>>>> returning
>>>>> javax.mail.Provider[TRANSPORT,****smtp,com.sun.mail.smtp.**
>>>>>
>>>>> SMTPTransport,Sun
>>>>> Microsystems, Inc]
>>>>> 2013-03-30 00:30:49,543 [main] INFO  SYSOUT - DEBUG SMTP: useEhlo true,
>>>>> useAuth true
>>>>> 2013-03-30 00:30:49,543 [main] INFO  SYSOUT - DEBUG SMTP: useEhlo true,
>>>>> useAuth true
>>>>> 2013-03-30 00:30:49,543 [main] INFO  SYSOUT - DEBUG SMTP: trying to
>>>>> connect
>>>>> to host "smtp.gmail.com", port 587, isSSL false
>>>>> 2013-03-30 00:30:49,567 [main] INFO  SYSOUT - 220 mx.google.com ESMTP
>>>>> dt10sm10366067qab.0 - gsmtp
>>>>>
>>>>> 2013-03-30 00:30:49,567 [main] INFO  SYSOUT - DEBUG SMTP: connected to
>>>>> host
>>>>> "smtp.gmail.com", port: 587
>>>>>
>>>>> 2013-03-30 00:30:49,567 [main] INFO  SYSOUT - EHLO
>>>>> ip-10-144-154-209.ec2.internal
>>>>>
>>>>> 2013-03-30 00:30:49,585 [main] INFO  SYSOUT - 250-mx.google.com at
>>>>> your
>>>>> service, [23.23.77.108]
>>>>> 250-SIZE 35882577
>>>>> 250-8BITMIME
>>>>> 250-STARTTLS
>>>>> 250 ENHANCEDSTATUSCODES
>>>>>
>>>>> 2013-03-30 00:30:49,585 [main] INFO  SYSOUT - DEBUG SMTP: Found
>>>>> extension
>>>>> "SIZE", arg "35882577"
>>>>> 2013-03-30 00:30:49,585 [main] INFO  SYSOUT - DEBUG SMTP: Found
>>>>> extension
>>>>> "8BITMIME", arg ""
>>>>> 2013-03-30 00:30:49,585 [main] INFO  SYSOUT - DEBUG SMTP: Found
>>>>> extension
>>>>> "STARTTLS", arg ""
>>>>> 2013-03-30 00:30:49,585 [main] INFO  SYSOUT - DEBUG SMTP: Found
>>>>> extension
>>>>> "ENHANCEDSTATUSCODES", arg ""
>>>>> 2013-03-30 00:30:49,585 [main] INFO  SYSOUT - STARTTLS
>>>>>
>>>>> 2013-03-30 00:30:49,596 [main] INFO  SYSOUT - 220 2.0.0 Ready to start
>>>>> TLS
>>>>>
>>>>> 2013-03-30 00:30:49,680 [main] INFO  SYSOUT - EHLO
>>>>> ip-10-144-154-209.ec2.internal
>>>>>
>>>>> 2013-03-30 00:30:49,691 [main] INFO  SYSOUT - 250-mx.google.com at
>>>>> your
>>>>> service, [23.23.77.108]
>>>>> 250-SIZE 35882577
>>>>> 250-8BITMIME
>>>>> 250-AUTH LOGIN PLAIN XOAUTH XOAUTH2
>>>>> 250 ENHANCEDSTATUSCODES
>>>>>
>>>>> 2013-03-30 00:30:49,691 [main] INFO  SYSOUT - DEBUG SMTP: Found
>>>>> extension
>>>>> "SIZE", arg "35882577"
>>>>> 2013-03-30 00:30:49,691 [main] INFO  SYSOUT - DEBUG SMTP: Found
>>>>> extension
>>>>> "8BITMIME", arg ""
>>>>> 2013-03-30 00:30:49,691 [main] INFO  SYSOUT - DEBUG SMTP: Found
>>>>> extension
>>>>> "AUTH", arg "LOGIN PLAIN XOAUTH XOAUTH2"
>>>>> 2013-03-30 00:30:49,691 [main] INFO  SYSOUT - DEBUG SMTP: Found
>>>>> extension
>>>>> "ENHANCEDSTATUSCODES", arg ""
>>>>> 2013-03-30 00:30:49,691 [main] INFO  SYSOUT - DEBUG SMTP: Attempt to
>>>>> authenticate
>>>>> 2013-03-30 00:30:49,692 [main] INFO  SYSOUT - DEBUG SMTP: check
>>>>> mechanisms:
>>>>> LOGIN PLAIN DIGEST-MD5 NTLM
>>>>> 2013-03-30 00:30:49,692 [main] INFO  SYSOUT - AUTH LOGIN
>>>>>
>>>>> 2013-03-30 00:30:49,703 [main] INFO  SYSOUT - 334 VXNlcm5hbWU6
>>>>>
>>>>> 2013-03-30 00:30:49,703 [main] INFO  SYSOUT -
>>>>> bGVhZHNAa2V5c3RvbmVmdW5kaW5nLm****NvbQ==
>>>>>
>>>>>
>>>>> 2013-03-30 00:30:49,715 [main] INFO  SYSOUT - 334 UGFzc3dvcmQ6
>>>>>
>>>>> 2013-03-30 00:30:49,715 [main] INFO  SYSOUT - bGVhZHMyMDEy
>>>>>
>>>>> 2013-03-30 00:30:49,968 [main] INFO  SYSOUT - 235 2.7.0 Accepted
>>>>>
>>>>> 2013-03-30 00:30:49,968 [main] INFO  SYSOUT - DEBUG SMTP: use8bit false
>>>>> 2013-03-30 00:30:49,968 [main] INFO  SYSOUT - MAIL FROM:<
>>>>> leads@mydomain.com>
>>>>>
>>>>> 2013-03-30 00:30:49,980 [main] INFO  SYSOUT - 250 2.1.0 OK
>>>>> dt10sm10366067qab.0 - gsmtp
>>>>>
>>>>> 2013-03-30 00:30:49,980 [main] INFO  SYSOUT - RCPT TO:<
>>>>> jmartin@mydomain.com>
>>>>>
>>>>> 2013-03-30 00:30:49,992 [main] INFO  SYSOUT - 250 2.1.5 OK
>>>>> dt10sm10366067qab.0 - gsmtp
>>>>>
>>>>> 2013-03-30 00:30:49,992 [main] INFO  SYSOUT - RCPT TO:<dave@gmail.com>
>>>>>
>>>>> 2013-03-30 00:30:50,003 [main] INFO  SYSOUT - 250 2.1.5 OK
>>>>> dt10sm10366067qab.0 - gsmtp
>>>>>
>>>>> 2013-03-30 00:30:50,003 [main] INFO  SYSOUT - DEBUG SMTP: Verified
>>>>> Addresses
>>>>> 2013-03-30 00:30:50,003 [main] INFO  SYSOUT - DEBUG SMTP:   jmartin <
>>>>> jmartin@mydomain.com>
>>>>> 2013-03-30 00:30:50,004 [main] INFO  SYSOUT - DEBUG SMTP:   dave <
>>>>> dave@gmail.com>
>>>>> 2013-03-30 00:30:50,004 [main] INFO  SYSOUT - DATA
>>>>>
>>>>> 2013-03-30 00:30:50,268 [main] INFO  SYSOUT - 354  Go ahead
>>>>> dt10sm10366067qab.0 - gsmtp
>>>>>
>>>>> 2013-03-30 00:30:50,269 [main] INFO  SYSOUT - Date: Sat, 30 Mar 2013
>>>>> 00:30:49 +0000 (UTC)
>>>>> From: leads@mydomain.com
>>>>> To: jmartin <jmartin@mydomain.com>, dave <dave@gmail.com>
>>>>> Message-ID: <2143726487.2.1364603449543.****
>>>>> JavaMail.stonedev@ip-10-144-**
>>>>>
>>>>> 154-209
>>>>>
>>>>>
>>>>>>   Subject: Report [3/29/13]
>>>>>>
>>>>> MIME-Version: 1.0
>>>>> Content-Type: text/plain; charset=us-ascii
>>>>> Content-Transfer-Encoding: 7bit
>>>>>
>>>>>
>>>>> -----------------------------
>>>>> Email Body
>>>>> -----------------------------
>>>>> .
>>>>>
>>>>> 2013-03-30 00:30:50,831 [main] INFO  SYSOUT - 250 2.0.0 OK 1364603273
>>>>> dt10sm10366067qab.0 - gsmtp
>>>>>
>>>>> 2013-03-30 00:30:50,832 [main] INFO  SYSOUT - QUIT
>>>>>
>>>>> 2013-03-30 00:30:50,843 [main] INFO  SYSOUT - 221 2.0.0 closing
>>>>> connection
>>>>> dt10sm10366067qab.0 - gsmtp
>>>>>
>>>>>
>>>>> On Fri, Mar 29, 2013 at 1:43 PM, Maurizio Cucchiara
>>>>> <mcucchiara@apache.org>wrote:
>>>>>
>>>>>   if you want obtain the system.out from a scheduled job, you can
>>>>> redirect
>>>>>
>>>>>> the output on a file:
>>>>>>
>>>>>> for example:
>>>>>>
>>>>>> scheduled_job > /tmp/out.txt
>>>>>>
>>>>>> Twitter     :http://www.twitter.com/m_****cucchiara<http://www.twitter.com/m_**cucchiara>
>>>>>> <http://www.twitter.**com/m_cucchiara<http://www.twitter.com/m_cucchiara>
>>>>>> >
>>>>>> G+          :https://plus.google.com/****107903711540963855921<https://plus.google.com/**107903711540963855921>
>>>>>> <https://**plus.google.com/**107903711540963855921<https://plus.google.com/107903711540963855921>
>>>>>> >
>>>>>> Linkedin    :http://www.linkedin.com/in/****mauriziocucchiara<http://www.linkedin.com/in/**mauriziocucchiara>
>>>>>> <http://www.**linkedin.com/in/**mauriziocucchiara<http://www.linkedin.com/in/mauriziocucchiara>
>>>>>> >
>>>>>> VisualizeMe: http://vizualize.me/maurizio.****<http://vizualize.me/maurizio.**>
>>>>>> cucchiara?r=maurizio.**cucchiara<http://vizualize.me/**
>>>>>> maurizio.cucchiara?r=maurizio.**cucchiara<http://vizualize.me/maurizio.cucchiara?r=maurizio.cucchiara>
>>>>>> >
>>>>>>
>>>>>>
>>>>>> Maurizio Cucchiara
>>>>>>
>>>>>>
>>>>>> On 29 March 2013 20:30, David Hoffer <dhoffer6@gmail.com> wrote:
>>>>>>
>>>>>>   This runs as a cron job...so no console is used.  Not sure then
how
>>>>>> to
>>>>>>
>>>>>>>
>>>>>>>  get
>>>>>>
>>>>>>  the debug info...may have to reconfigure to run in console.  Perhaps
>>>>>>> I
>>>>>>>
>>>>>>>  can
>>>>>>
>>>>>>  configure log4j to redirect System.out and System.err...I'll check
>>>>>>>
>>>>>>>  that.
>>>>>>
>>>>>
>>>>>
>>>>>>  -Dave
>>>>>>>
>>>>>>>
>>>>>>> On Fri, Mar 29, 2013 at 12:34 PM, Thomas Neidhart <
>>>>>>> thomas.neidhart@gmail.com
>>>>>>>
>>>>>>>  wrote:
>>>>>>>>
>>>>>>>>
>>>>>>>   On 03/29/2013 01:32 PM, David Hoffer wrote:
>>>>>>>
>>>>>>>>
>>>>>>>>  Hum, I set setDebug(true) but I'm not seeing more info the
>>>>>>>>>
>>>>>>>>>  logs...and
>>>>>>>>
>>>>>>>
>>>>>  logging is set to DEBUG level.  How do I configure this so the
>>>>>>
>>>>>>>
>>>>>>>>>  debug
>>>>>>>>
>>>>>>>
>>>>>  goes
>>>>>>
>>>>>>>
>>>>>>>  to the log?
>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>> the debug output will go to System.out or System.err, so
you will
>>>>>>>> not
>>>>>>>> find it in the output of your logging provider.
>>>>>>>>
>>>>>>>> Thomas
>>>>>>>>
>>>>>>>> ------------------------------****----------------------------**
>>>>>>>> --**
>>>>>>>> ---------
>>>>>>>> To unsubscribe, e-mail: user-unsubscribe@commons.**apa**che.org<http://apache.org>
>>>>>>>> <user-unsubscribe@**commons.apache.org<user-unsubscribe@commons.apache.org>
>>>>>>>> >
>>>>>>>>
>>>>>>>> For additional commands, e-mail: user-help@commons.apache.org
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>  ------------------------------****----------------------------**
>>> --**---------
>>> To unsubscribe, e-mail: user-unsubscribe@commons.**apa**che.org<http://apache.org>
>>> <user-unsubscribe@**commons.apache.org<user-unsubscribe@commons.apache.org>
>>> >
>>>
>>> For additional commands, e-mail: user-help@commons.apache.org
>>>
>>>
>>>
>>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: user-unsubscribe@commons.**apache.org<user-unsubscribe@commons.apache.org>
> For additional commands, e-mail: user-help@commons.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message