Re: commons-email sending email twice?
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 sgoes...@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_**cucchiarahttp://www.twitter.com/m_cucchiara G+ :https://plus.google.com/**107903711540963855921https://plus.google.com/107903711540963855921 Linkedin :http://www.linkedin.com/in/**mauriziocucchiarahttp://www.linkedin.com/in/mauriziocucchiara VisualizeMe: http://vizualize.me/maurizio.** cucchiara?r=maurizio.cucchiarahttp://vizualize.me/maurizio.cucchiara?r=maurizio.cucchiara Maurizio Cucchiara On 30 March 2013 01:48, David Hoffer dhoff...@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 -
Re: commons-email sending email twice?
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 sgoes...@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_**cucchiarahttp://www.twitter.com/m_cucchiara G+ :https://plus.google.com/**107903711540963855921https://plus.google.com/107903711540963855921 Linkedin :http://www.linkedin.com/in/**mauriziocucchiarahttp://www.linkedin.com/in/mauriziocucchiara VisualizeMe: http://vizualize.me/maurizio.** cucchiara?r=maurizio.cucchiarahttp://vizualize.me/maurizio.cucchiara?r=maurizio.cucchiara Maurizio Cucchiara On 30 March 2013 01:48, David Hoffer dhoff...@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
Re: commons-email sending email twice?
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 sgoes...@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 sgoes...@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_cucchiarahttp://www.twitter.com/m_**cucchiara http://www.twitter.**com/m_cucchiarahttp://www.twitter.com/m_cucchiara G+ :https://plus.google.com/107903711540963855921https://plus.google.com/**107903711540963855921 https://**plus.google.com/**107903711540963855921https://plus.google.com/107903711540963855921 Linkedin :http://www.linkedin.com/in/mauriziocucchiarahttp://www.linkedin.com/in/**mauriziocucchiara http://www.**linkedin.com/in/**mauriziocucchiarahttp://www.linkedin.com/in/mauriziocucchiara VisualizeMe: http://vizualize.me/maurizio.http://vizualize.me/maurizio.** cucchiara?r=maurizio.**cucchiarahttp://vizualize.me/** maurizio.cucchiara?r=maurizio.**cucchiarahttp://vizualize.me/maurizio.cucchiara?r=maurizio.cucchiara Maurizio Cucchiara On 30 March 2013 01:48, David Hoffer dhoff...@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