1 2 3 Previous Next 31 Replies Latest reply on Apr 11, 2004 8:45 AM by acoliver Go to original post
      • 15. Re: TODO: Bounce Messages
        acoliver

        do it.

        • 16. Re: TODO: Bounce Messages
          kabirkhan

          Almost there, my computer died a slow horrible death at the end of last week, so I have been busy configuring a new one. (Building the entire 3.2.4RC1 now takes 3 minutes rather than 28 :-D )

          • 17. Re: TODO: Bounce Messages
            kabirkhan

            I've commited it now.

            Some things I'm not sure if I'm too happy about:

            * I'm using a hardcoded ObjectName for the MailListener MBean in Remote- and LocalDeliveryMessageBean. (Some messages might need to be bounced back to a local user, others to a remote one). I did not bother to add a depends to the MDBs (so that they are dependent on the MailListener), since I assume they would not exist in the first place without the MailListener being present. How do circular dependencies work?

            * In some cases we get a load of extra From headers all containing the same thing.

            There were one or two other things, but as mentioned I hadn't looked at this for a while. I'll try to remember!

            Cheers,

            Kab

            • 18. Re: TODO: Bounce Messages
              kabirkhan

              Oh yeah,

              It is a very simple version. It just contains the subject and a list of the recipients who failed.

              Kab

              • 19. Re: TODO: Bounce Messages
                acoliver

                lets definitely kill the hardcoded ObjectName

                • 20. Re: TODO: Bounce Messages
                  kabirkhan

                  Done.

                  One of the other things I wasn't sure about is that I need the postmaster address. I have set this in the MBean descriptor for the SMTPProtocol. When loaded it is set in the System properties, and then used by BouncedMail (created by the MDB's). Is that very crap or OK? Otherwise I guess we would need specify the postmaster in both the MDBs which strikes me as slightly cumbersome. If we use another MailListener/handler mechanism we would need to carry across all this stuff there too? An alternative could be to create BouncedMail as an MBean (and maybe make that responsible for calling the MailListener)?

                  The other thing is that in RemoteDeliveryMDB/SMTPSender were assuming that JavaMail sent all mails existing in the To/CC/BCC headers to a given domain even if only one was specified in the transport.send() call. I'm not so sure if this was true or not and have commented out that stuff for now.

                  Cheers,

                  Kab

                  • 21. Re: TODO: Bounce Messages
                    acoliver

                    Kabir, you're the man dude. M1 here we come. I'm testing and writing doco for it. Make sure you're happy with your unit tests. If you have time look at POP on TLS. Otherwise we can do that for M2. Also take a look at the plan as revised on the wiki and make whatever changes you see are appropriate. Where are you geographically BTW?

                    • 22. Re: TODO: Bounce Messages
                      acoliver

                      OOps. I tried to bounce something basically I sent to an invalid local user. I expected to get a bounce message delivered locally. Instead, I got nothing

                      12:05:43,867 INFO [LoggingInputStream] Message-ID: <40745D09.3000600@badmojo.superlinksoftware.com>\r\n
                      12:05:43,868 INFO [LoggingInputStream] Date: Wed, 07 Apr 2004 15:56:57 -0400\r\n
                      12:05:43,868 INFO [LoggingInputStream] From: Andy <test@badmojo.superlinksoftware.com>\r\n
                      12:05:43,868 INFO [LoggingInputStream] Reply-To: "test@badmojo.superlinksoftware.com" <test@badmojo.superlinksoftware.com>\r\n
                      12:05:43,869 INFO [LoggingInputStream] User-Agent: Mozilla Thunderbird 0.5 (Macintosh/20040208)\r\n
                      12:05:43,869 INFO [LoggingInputStream] X-Accept-Language: en-us, en\r\n
                      12:05:43,869 INFO [LoggingInputStream] MIME-Version: 1.0\r\n
                      12:05:43,869 INFO [LoggingInputStream] To: brest@superlinksoftware.com\r\n
                      12:05:43,869 INFO [LoggingInputStream] Subject: test for bounce\r\n
                      12:05:43,870 INFO [LoggingInputStream] Content-Type: text/plain; charset=us-ascii; format=flowed\r\n
                      12:05:43,870 INFO [LoggingInputStream] Content-Transfer-Encoding: 7bit\r\n
                      12:05:43,870 INFO [LoggingInputStream] \r\n
                      12:05:43,871 INFO [Mail] all headers after loading: MailHeadersImpl (13): [hdr(Return-Path = 'Return-Path: <test@badmojo.superlinksoftware.com>'), hdr(Received = 'Received: from badmojo.superlinksoftware.com (192.168.1.102 192.168.1.102) by badmojo.superlinksoftware.com (192.168.1.103)
                      with SMTP id 1081353943870412.3432450820011; Wed, 7 Apr 2004 12:05:43 -0400 (EDT)'), hdr(Message-ID = 'Message-ID: <40745D09.3000600@badmojo.superlinksoftware.com>'), hdr(Date = 'Date: Wed, 07 Apr 2004 15:56:57 -0400'), hdr(From = 'From: Andy <test@badmojo.superlinksoftware.com>'), hdr(Reply-To = 'Reply-To: "test@badmojo.superlinksoftware.com" <test@badmojo.superlinksoftware.com>'), hdr(User-Agent = 'User-Agent: Mozilla Thunderbird 0.5 (Macintosh/20040208)'), hdr(X-Accept-Language = 'X-Accept-Language: en-us, en'), hdr(MIME-Version = 'MIME-Version: 1.0'), hdr(To = 'To: brest@superlinksoftware.com'), hdr(Subject = 'Subject: test for bounce'), hdr(Content-Type = 'Content-Type: text/plain; charset=us-ascii; format=flowed'), hdr(Content-Transfer-Encoding = 'Content-Transfer-Encoding: 7bit')]
                      12:05:43,871 INFO [LoggingInputStream] please bounce\r\n
                      12:05:43,871 INFO [LoggingInputStream] .\r\n
                      12:05:43,871 INFO [CmdDATA] sending mail to MailListener: org.jboss.mail.maillistener.JMXMailListenerProxy@fc9e7e

                      • 23. Re: TODO: Bounce Messages
                        acoliver

                        It looks like we're still not checking if the mailbox exists or should exist. meaning we need to check to see if the user is a valid user before attempting to ACTUALLY deliver it.

                        INSERT INTO ENTITYMESSAGE VALUES('-3435249911893481455','brest','Return-Path: <test@badmojo.superlinksoftware.com>\u000d\u000aReceived: from badmojo.superlinksoftware.com (192.168.1.102 192.168.1.102) by badmojo.superlinksoftware.com (192.168.1.103)\u000d\u000a\u0009with SMTP id 1081353943870412.3432450820011; Wed, 7 Apr 2004 12:05:43 -0400 (EDT)\u000d\u000aMessage-ID: <40745D09.3000600@badmojo.superlinksoftware.com>\u000d\u000aDate: Wed, 07 Apr 2004 15:56:57 -0400\u000d\u000aFrom: Andy <test@badmojo.superlinksoftware.com>\u000d\u000aReply-To: "test@badmojo.superlinksoftware.com" <test@badmojo.superlinksoftware.com>\u000d\u000aUser-Agent: Mozilla Thunderbird 0.5 (Macintosh/20040208)\u000d\u000aX-Accept-Language: en-us, en\u000d\u000aMIME-Version: 1.0\u000d\u000aTo: brest@superlinksoftware.com\u000d\u000aSubject: test for bounce\u000d\u000aContent-Type: text/plain; charset=us-ascii; format=flowed\u000d\u000aContent-Transfer-Encoding: 7bit','please bounce')

                        • 24. Re: TODO: Bounce Messages
                          acoliver

                          Looking at it, I dont think this (ln 77):

                          if (ea.getLocal()) {
                          if (!deliver( mailboxManager, addresses[index], smtpMessage )){

                          in JMSMailListener ever fails. I think what we should do is:

                          make JMSMailListener depend on the UserRepository. If the user is local and he doesn't exist then fail him too. Kabir, does that make sense? If not let me know and I can take care of it. We should create a unit test for this either now or for M2 when the new client script runner stuff is ready (depending on whether we can poke it in a non-running instance which I admit may not be possible).

                          -Andy

                          • 25. Re: TODO: Bounce Messages
                            pilhuhn

                             

                            If the user is local and he doesn't exist then fail him too

                            Makes completely sense. That is how sendmail et. al handle it as well.
                            One could (if being crazy :-) alias all non-existing users to postmaster, but in times of spam, this is somewhat overkill.

                            • 26. Re: TODO: Bounce Messages
                              kabirkhan

                              Regarding the local user stuff, I agree. I started off the Local Mailboxes and Authentication thread since I did not know how to fail local users, and just put in the stuff mentioned (ln 77) as a placeholder. Checking the UserRepository should be a good place to start though.

                              I'll also double check to see if this is correct or not:

                              The other thing is that in RemoteDeliveryMDB/SMTPSender were assuming that JavaMail sent all mails existing in the To/CC/BCC headers to a given domain even if only one was specified in the transport.send() call. I'm not so sure if this was true or not and have commented out that stuff for now.

                              I had it set up to resolve all domains to a James instance running on localhost, but guess this should be tried for a proper external mail system.

                              Hope to take a look at the other stuff as well :-)

                              Cheers,

                              Kab
                              PS Right now I am in Norway...

                              • 27. Re: TODO: Bounce Messages
                                pilhuhn

                                Btw. at least some local delivery agents also check for user quota before delivering.
                                After reaching a soft limit, send the user a warning email. After reaching a hard limit, reject mails with a 'temporarily unavailable' smtp code.

                                • 28. Re: TODO: Bounce Messages
                                  kabirkhan

                                  I've added the UserRepository checks to the LocalDeliveryMDB, so messages to local users who don't exist are bounced.

                                  I think the quota stuff is a good idea! But I think it is best left for a later release? Reason being the mailbox implementation doesn't really support the suggested functionality yet.

                                  Regarding this

                                  The other thing is that in RemoteDeliveryMDB/SMTPSender were assuming that JavaMail sent all mails existing in the To/CC/BCC headers to a given domain even if only one was specified in the transport.send() call. I'm not so sure if this was true or not and have commented out that stuff for now.

                                  I set up two addresses at bigfoot and sent a mail going to both addresses (so domain is same), and JavaMail only seemed to send to the one specified in the to parameter, so I'm not sure what that was all about. I believe it to be fine now though, but it would definitely be a good idea for someone to check!

                                  BTW the postmaster stuff is for the sender of the bounce messages when they are set back.

                                  Cheers,

                                  Kab

                                  • 29. Re: TODO: Bounce Messages
                                    acoliver

                                    Quotas will be mailbox implementation dependent. It is not possible with some databases to determine the amount of storage per user. We might be able to store the message size in the mailbox. Actually that's a pretty good idea for DB mailboxes. I agree though that isn't an M1 thing for sure. Sounds good. I'm continuing my testing so I'll definitely check it out.