Actually, I thought that Dumbster was more sophisticated than it is. I think that your approach is fine for verifying that the message is created properly.
On Thu, Nov 12, 2009 at 2:37 PM, Naftoli Gugenheim <[email protected]>wrote: > What's the advantage/purpose over they method I chose? > > > On Thu, Nov 12, 2009 at 4:36 PM, Naftoli Gugenheim > <[email protected]>wrote: > >> Have you ever used Dumbster? >> >> >> On Thu, Nov 12, 2009 at 2:59 PM, Derek Chen-Becker <[email protected] >> > wrote: >> >>> I would like to see an integrated dumbster test. You can pick an >>> arbitrary port to run the test on just by attempting to bind and iterating >>> until you succeed. Something (roughly) like this: >>> >>> def openSmtpServer (startPort : Int, endPort : Int) : >>> (Int,SimpleSmtpServer) = { >>> var port = startPort >>> var server : SimpleSmtpServer = null >>> >>> while (port <= endPort && (server eq null)) { >>> try { >>> server = SimpleSmtpServer.start(port) >>> } catch { >>> case _ => port += 1 >>> } >>> } >>> return (port,server) >>> } >>> >>> Then you can configure Lift's mailer to send to that port on localhost >>> and go from there. >>> >>> Derek >>> >>> >>> On Fri, Nov 6, 2009 at 11:54 AM, Naftoli Gugenheim <[email protected] >>> > wrote: >>> >>>> Can someone confirm or give other feedback? Are my tests good? >>>> http://reviewboard.liftweb.net/r/83/ >>>> >>>> >>>> >>>> On Wed, Nov 4, 2009 at 8:45 PM, Naftoli Gugenheim <[email protected] >>>> > wrote: >>>> >>>>> Okay. Unit test are now on Review Board too (and they pass). >>>>> I'm hoping someone will be able to confirm my work so that my client, a >>>>> medical assistance volunteer-based charity organization, will have email >>>>> working properly along with the rest of Lift's great features, so that the >>>>> volunteer dispatchers will be able to click the links and help sick >>>>> people. >>>>> >>>>> >>>>> On Wed, Nov 4, 2009 at 2:04 AM, Naftoli Gugenheim < >>>>> [email protected]> wrote: >>>>> >>>>>> I thought of a smarter way to test it. Please tell me if you have any >>>>>> objections. >>>>>> I noticed that some of the specs extend the class they test. The idea >>>>>> is to refactor the call to actually send the email into an outside >>>>>> method. >>>>>> Then, after making some private members of Mailer protected, the spec can >>>>>> override the behavior of the method that sends it, to instead check the >>>>>> message object. >>>>>> This has the advantages of not adding another dependency to Lift, or >>>>>> relying on a given port being available to run an SMTP server on whoever >>>>>> builds Lift's computer. >>>>>> >>>>>> ------------------------------------- >>>>>> David Pollak<[email protected]> wrote: >>>>>> >>>>>> On Tue, Nov 3, 2009 at 3:00 PM, Naftoli Gugenheim < >>>>>> [email protected]>wrote: >>>>>> >>>>>> > >>>>>> > I verified locally via dumbster that the content type is test/plain; >>>>>> > charset=us-ascii for a single PlainMailBodyType. For two, or an >>>>>> > XHTMLMailBodyType, it's multipart/alternative. >>>>>> > Do I still need to contribute a test to Lift? >>>>>> > >>>>>> >>>>>> Yes. This is the last time I will state this criteria or otherwise >>>>>> engage >>>>>> on this subject. >>>>>> >>>>>> >>>>>> > >>>>>> > ------------------------------------- >>>>>> > David Pollak<[email protected]> wrote: >>>>>> > >>>>>> > On Tue, Nov 3, 2009 at 1:47 PM, Naftoli Gugenheim < >>>>>> [email protected] >>>>>> > >wrote: >>>>>> > >>>>>> > > >>>>>> > > Wait a minute. You want me to test that my change works--that >>>>>> simple >>>>>> > > messages are not multipart--or that other messages still are >>>>>> multipart? >>>>>> > >>>>>> > >>>>>> > Both. >>>>>> > >>>>>> > Test that mail sent as plain text is not multipart and that all >>>>>> other mail >>>>>> > is multipart and that all the mail actually makes it through the >>>>>> system. >>>>>> > It's 2 or 3 tests. >>>>>> > >>>>>> > Why am I imposing this burden on you? Almost every site that uses >>>>>> Lift >>>>>> > uses >>>>>> > the Mailer. I have given my cell phone number to some of these >>>>>> sites with >>>>>> > the message "I stand behind Lift... if you're experiencing a >>>>>> problem, >>>>>> > please >>>>>> > call me any time day or night." So, I'm on the hook if something >>>>>> goes >>>>>> > wrong. My gut says, "there could be more problems with this >>>>>> apparently >>>>>> > simple change than meet the eye," so I'm asking you to write the >>>>>> tests. >>>>>> > >>>>>> > >>>>>> > >>>>>> > >>>>>> > > Or something else? >>>>>> > > >>>>>> > > ------------------------------------- >>>>>> > > David Pollak<[email protected]> wrote: >>>>>> > > >>>>>> > > On Tue, Nov 3, 2009 at 1:30 PM, Naftoli Gugenheim < >>>>>> [email protected] >>>>>> > > >wrote: >>>>>> > > >>>>>> > > > I asked you how to write one. I have no clue how to unit test >>>>>> email, or >>>>>> > > > what content type an email is. And the test has to not fail on >>>>>> > computers >>>>>> > > > that don't have an SMTP server, I presume? >>>>>> > > >>>>>> > > >>>>>> > > I don't know how to write tests against mailers, but you're the >>>>>> one that >>>>>> > > made a change, so you have to figure out how to test it. I know >>>>>> no more >>>>>> > > about testing mailers than you do, so it's one of us that has to >>>>>> do the >>>>>> > > work. >>>>>> > > >>>>>> > > >>>>>> > > > As I mentioned on review board, I did test it manually though >>>>>> and it >>>>>> > > works >>>>>> > > > fine. Do most commits include a unit test? >>>>>> > > > >>>>>> > > >>>>>> > > If this change breaks the mailer, the break impacts lots and lots >>>>>> of >>>>>> > > people. The mailer code has been stable and untouched for a long >>>>>> time >>>>>> > > (except for the change to LiftActors). So, my criteria for >>>>>> accepting >>>>>> > this >>>>>> > > change is to have a test associated with it. >>>>>> > > >>>>>> > > >>>>>> > > > >>>>>> > > > >>>>>> > > > On Tue, Nov 3, 2009 at 4:18 PM, David Pollak < >>>>>> > > > [email protected]> wrote: >>>>>> > > > >>>>>> > > >> >>>>>> > > >> >>>>>> > > >> On Tue, Nov 3, 2009 at 1:08 PM, Naftoli Gugenheim < >>>>>> > [email protected] >>>>>> > > >wrote: >>>>>> > > >> >>>>>> > > >>> Can someone look at Review Board? Is my addition okay? >>>>>> > > >> >>>>>> > > >> >>>>>> > > >> Did you write a test? >>>>>> > > >> >>>>>> > > >> Also, it's not going into M7, so it's not going to get merged >>>>>> into >>>>>> > > master >>>>>> > > >> until Thursday. >>>>>> > > >> >>>>>> > > >> >>>>>> > > >>> >>>>>> > > >>> >>>>>> > > >>> On Sat, Oct 31, 2009 at 10:00 PM, Naftoli Gugenheim < >>>>>> > > >>> [email protected]> wrote: >>>>>> > > >>> >>>>>> > > >>>> How does this look? (Note: output from git diff -b, so >>>>>> applying it >>>>>> > > won't >>>>>> > > >>>> indent properly) >>>>>> > > >>>> >>>>>> > > >>>> >>>>>> > > >>>> On Fri, Oct 30, 2009 at 4:20 PM, Derek Chen-Becker < >>>>>> > > >>>> [email protected]> wrote: >>>>>> > > >>>> >>>>>> > > >>>>> Probably not until next week, unfortunately. If you don't >>>>>> mind >>>>>> > > looking >>>>>> > > >>>>> at it, the main thing to change is in Mailer.scala, around >>>>>> line >>>>>> > 156. >>>>>> > > There >>>>>> > > >>>>> should be a check or match to see if info is a >>>>>> > > List(PlainMailBodyType), and >>>>>> > > >>>>> if so, skip the Multipart mapping that follows and do a >>>>>> > > message.setText on >>>>>> > > >>>>> the contents of the PlainMailBodyType instead. >>>>>> > > >>>>> >>>>>> > > >>>>> Derek >>>>>> > > >>>>> >>>>>> > > >>>>> >>>>>> > > >>>>> On Fri, Oct 30, 2009 at 1:29 PM, Naftoli Gugenheim < >>>>>> > > >>>>> [email protected]> wrote: >>>>>> > > >>>>> >>>>>> > > >>>>>> I guess you didn't get around to it yet. Any idea when? >>>>>> Thanks. >>>>>> > > >>>>>> http://github.com/dpp/liftweb/issues/#issue/110 >>>>>> > > >>>>>> >>>>>> > > >>>>>> >>>>>> > > >>>>>> On Thu, Oct 15, 2009 at 3:03 PM, Derek Chen-Becker < >>>>>> > > >>>>>> [email protected]> wrote: >>>>>> > > >>>>>> >>>>>> > > >>>>>>> Looking at the code I don't think that it would be hard to >>>>>> "do >>>>>> > the >>>>>> > > >>>>>>> right thing" depending on whether someone calls sendMail >>>>>> with a >>>>>> > > sequence of >>>>>> > > >>>>>>> MailBodyTypes or just a single PlainMailBodyType. If >>>>>> someone >>>>>> > wants >>>>>> > > to open >>>>>> > > >>>>>>> an issue on it I could make the change. >>>>>> > > >>>>>>> >>>>>> > > >>>>>>> Derek >>>>>> > > >>>>>>> >>>>>> > > >>>>>>> >>>>>> > > >>>>>>> On Thu, Oct 15, 2009 at 8:45 AM, David Pollak < >>>>>> > > >>>>>>> [email protected]> wrote: >>>>>> > > >>>>>>> >>>>>> > > >>>>>>>> In the deep dark recesses of my memory, I think we >>>>>> originally >>>>>> > did >>>>>> > > >>>>>>>> text-only messages and there was some complaint about >>>>>> that... >>>>>> > > sigh. >>>>>> > > >>>>>>>> >>>>>> > > >>>>>>>> >>>>>> > > >>>>>>>> On Wed, Oct 14, 2009 at 10:36 PM, Derek Chen-Becker < >>>>>> > > >>>>>>>> [email protected]> wrote: >>>>>> > > >>>>>>>> >>>>>> > > >>>>>>>>> The way that Lift uses the API we don't support sending >>>>>> > > >>>>>>>>> non-multipart messages. I suppose that this could be >>>>>> refactored >>>>>> > > to support >>>>>> > > >>>>>>>>> single part MIME messages, but I really have trouble >>>>>> believing >>>>>> > > that a >>>>>> > > >>>>>>>>> BlackBerry can't handle it. >>>>>> > > >>>>>>>>> >>>>>> > > >>>>>>>>> Derek >>>>>> > > >>>>>>>>> >>>>>> > > >>>>>>>>> >>>>>> > > >>>>>>>>> On Mon, Oct 12, 2009 at 9:38 PM, Naftoli Gugenheim < >>>>>> > > >>>>>>>>> [email protected]> wrote: >>>>>> > > >>>>>>>>> >>>>>> > > >>>>>>>>>> >>>>>> > > >>>>>>>>>> True, I may have to do that at some point, although I'm >>>>>> not >>>>>> > > super >>>>>> > > >>>>>>>>>> confident I'll find such specs. >>>>>> > > >>>>>>>>>> What do you say to Ross's comment? Why is it multipart? >>>>>> > > >>>>>>>>>> >>>>>> > > >>>>>>>>>> ------------------------------------- >>>>>> > > >>>>>>>>>> David Pollak<[email protected]> wrote: >>>>>> > > >>>>>>>>>> >>>>>> > > >>>>>>>>>> On Mon, Oct 12, 2009 at 6:17 PM, Naftoli Gugenheim < >>>>>> > > >>>>>>>>>> [email protected]>wrote: >>>>>> > > >>>>>>>>>> >>>>>> > > >>>>>>>>>> > >>>>>> > > >>>>>>>>>> > Does this help? It's from GMail / Show original >>>>>> > > >>>>>>>>>> > >>>>>> > > >>>>>>>>>> >>>>>> > > >>>>>>>>>> GMail munges things, so I don't know if that's the >>>>>> original >>>>>> > > >>>>>>>>>> message. >>>>>> > > >>>>>>>>>> >>>>>> > > >>>>>>>>>> You might want to figure out what the specs are for >>>>>> blackberry >>>>>> > > to >>>>>> > > >>>>>>>>>> convert >>>>>> > > >>>>>>>>>> messages and see why this kind of message is not being >>>>>> > > converted. >>>>>> > > >>>>>>>>>> >>>>>> > > >>>>>>>>>> >>>>>> > > >>>>>>>>>> > >>>>>> > > >>>>>>>>>> > Delivered-To: [email protected] >>>>>> > > >>>>>>>>>> > Received: by 10.86.30.11 with SMTP id d11cs12302fgd; >>>>>> > > >>>>>>>>>> > Wed, 7 Oct 2009 12:28:57 -0700 (PDT) >>>>>> > > >>>>>>>>>> > Received: by 10.229.19.149 with SMTP id >>>>>> > > >>>>>>>>>> a21mr391667qcb.29.1254943736364; >>>>>> > > >>>>>>>>>> > Wed, 07 Oct 2009 12:28:56 -0700 (PDT) >>>>>> > > >>>>>>>>>> > Return-Path: <[email protected]> >>>>>> > > >>>>>>>>>> > Received: from lrbcol ( >>>>>> 174-143-236-122.static.slicehost.net >>>>>> > > >>>>>>>>>> [174.143.236.122]) >>>>>> > > >>>>>>>>>> > by mx.google.com with ESMTP id >>>>>> > > >>>>>>>>>> > 1si71430296yxe.11.2009.10.07.12.28.55; >>>>>> > > >>>>>>>>>> > Wed, 07 Oct 2009 12:28:56 -0700 (PDT) >>>>>> > > >>>>>>>>>> > Received-SPF: neutral (google.com: 174.143.236.122 >>>>>> is >>>>>> > neither >>>>>> > > >>>>>>>>>> > permitted nor denied by best guess record for domain >>>>>> of >>>>>> > > >>>>>>>>>> > [email protected]) client-ip=174.143.236.122; >>>>>> > > >>>>>>>>>> > Authentication-Results: mx.google.com; spf=neutral ( >>>>>> > > google.com: >>>>>> > > >>>>>>>>>> > 174.143.236.122 is neither permitted nor denied by >>>>>> best >>>>>> > guess >>>>>> > > >>>>>>>>>> record >>>>>> > > >>>>>>>>>> > for domain of [email protected]) smtp.mail= >>>>>> > > [email protected] >>>>>> > > >>>>>>>>>> > Received: from lrbcol (localhost [127.0.0.1]) >>>>>> > > >>>>>>>>>> > by lrbcol (Postfix) with ESMTP id CDB51A0055 >>>>>> > > >>>>>>>>>> > for <[email protected]>; Wed, 7 Oct 2009 >>>>>> > 15:28:56 >>>>>> > > >>>>>>>>>> -0400 (EDT) >>>>>> > > >>>>>>>>>> > From: [email protected] >>>>>> > > >>>>>>>>>> > To: [email protected] >>>>>> > > >>>>>>>>>> > Message-ID: >>>>>> <2107786874.01254943736214.javamail.r...@lrbcol >>>>>> > > >>>>>> > > >>>>>>>>>> > Subject: Detail of Transportation #843 >>>>>> > > >>>>>>>>>> > MIME-Version: 1.0 >>>>>> > > >>>>>>>>>> > Content-Type: multipart/alternative; >>>>>> > > >>>>>>>>>> > >>>>>> boundary="----=_Part_0_1227069312.1254943735894" >>>>>> > > >>>>>>>>>> > Date: Wed, 7 Oct 2009 15:28:56 -0400 (EDT) >>>>>> > > >>>>>>>>>> > >>>>>> > > >>>>>>>>>> > ------=_Part_0_1227069312.1254943735894 >>>>>> > > >>>>>>>>>> > Content-Type: text/plain; charset=UTF-8 >>>>>> > > >>>>>>>>>> > Content-Transfer-Encoding: 7bit >>>>>> > > >>>>>>>>>> > >>>>>> > > >>>>>>>>>> > naftuli gugenheim; 617 6st >>>>>> > > >>>>>>>>>> > ; M: 7325342893; From : ; To : 39 hearth ct; >>>>>> > > >>>>>>>>>> > Request URL: [TODO] >>>>>> > > >>>>>>>>>> > ------=_Part_0_1227069312.1254943735894-- >>>>>> > > >>>>>>>>>> > >>>>>> > > >>>>>>>>>> > >>>>>> > > >>>>>>>>>> > On Mon, Oct 12, 2009 at 6:15 PM, David Pollak >>>>>> > > >>>>>>>>>> > <[email protected]> wrote: >>>>>> > > >>>>>>>>>> > > Please send some test email to an account you can >>>>>> access >>>>>> > > using >>>>>> > > >>>>>>>>>> > Thunderbird. >>>>>> > > >>>>>>>>>> > > Open the message and look at the message source. >>>>>> Is it >>>>>> > > >>>>>>>>>> really plain >>>>>> > > >>>>>>>>>> > text? >>>>>> > > >>>>>>>>>> > > What do the headers say it is? >>>>>> > > >>>>>>>>>> > > >>>>>> > > >>>>>>>>>> > > On Mon, Oct 12, 2009 at 1:11 PM, Naftoli Gugenheim >>>>>> < >>>>>> > > >>>>>>>>>> [email protected] >>>>>> > > >>>>>>>>>> > > >>>>>> > > >>>>>>>>>> > > wrote: >>>>>> > > >>>>>>>>>> > >> >>>>>> > > >>>>>>>>>> > >> Hi. I'm sending an email using PlainMailBodyType >>>>>> that >>>>>> > > >>>>>>>>>> contains a URL. >>>>>> > > >>>>>>>>>> > >> Normally when a BlackBerry receives a plain text >>>>>> email it >>>>>> > > >>>>>>>>>> > >> automatically hyperlinks URLS and potential phone >>>>>> > numbers. >>>>>> > > >>>>>>>>>> For some >>>>>> > > >>>>>>>>>> > >> reason this email is not being hyperlinked on the >>>>>> > > BlackBerry. >>>>>> > > >>>>>>>>>> Is it >>>>>> > > >>>>>>>>>> > >> possible that it's somehow not purely plain text? >>>>>> How >>>>>> > would >>>>>> > > I >>>>>> > > >>>>>>>>>> solve >>>>>> > > >>>>>>>>>> > >> this? I don't want to send HTML messages because >>>>>> some >>>>>> > > >>>>>>>>>> recipients may >>>>>> > > >>>>>>>>>> > >> not be able to view it. >>>>>> > > >>>>>>>>>> > >> Thanks. >>>>>> > > >>>>>>>>>> > >> >>>>>> > > >>>>>>>>>> > >> >>>>>> > > >>>>>>>>>> > > >>>>>> > > >>>>>>>>>> > > >>>>>> > > >>>>>>>>>> > > >>>>>> > > >>>>>>>>>> > > -- >>>>>> > > >>>>>>>>>> > > Lift, the simply functional web framework >>>>>> > > http://liftweb.net >>>>>> > > >>>>>>>>>> > > Beginning Scala >>>>>> > http://www.apress.com/book/view/1430219890 >>>>>> > > >>>>>>>>>> > > Follow me: http://twitter.com/dpp >>>>>> > > >>>>>>>>>> > > Surf the harmonics >>>>>> > > >>>>>>>>>> > > >>>>>> > > >>>>>>>>>> > > > >>>>>> > > >>>>>>>>>> > > >>>>>> > > >>>>>>>>>> > >>>>>> > > >>>>>>>>>> > > >>>>>> > > >>>>>>>>>> > >>>>>> > > >>>>>>>>>> >>>>>> > > >>>>>>>>>> >>>>>> > > >>>>>>>>>> -- >>>>>> > > >>>>>>>>>> Lift, the simply functional web framework >>>>>> http://liftweb.net >>>>>> > > >>>>>>>>>> Beginning Scala >>>>>> http://www.apress.com/book/view/1430219890 >>>>>> > > >>>>>>>>>> Follow me: http://twitter.com/dpp >>>>>> > > >>>>>>>>>> Surf the harmonics >>>>>> > > >>>>>>>>>> >>>>>> > > >>>>>>>>>> >>>>>> > > >>>>>>>>>> >>>>>> > > >>>>>>>>>> >>>>>> > > >>>>>>>>>> >>>>>> > > >>>>>>>>> >>>>>> > > >>>>>>>>> >>>>>> > > >>>>>>>>> >>>>>> > > >>>>>>>> >>>>>> > > >>>>>>>> >>>>>> > > >>>>>>>> -- >>>>>> > > >>>>>>>> Lift, the simply functional web framework >>>>>> http://liftweb.net >>>>>> > > >>>>>>>> Beginning Scala >>>>>> http://www.apress.com/book/view/1430219890 >>>>>> > > >>>>>>>> Follow me: http://twitter.com/dpp >>>>>> > > >>>>>>>> Surf the harmonics >>>>>> > > >>>>>>>> >>>>>> > > >>>>>>>> >>>>>> > > >>>>>>>> >>>>>> > > >>>>>>> >>>>>> > > >>>>>>> >>>>>> > > >>>>>>> >>>>>> > > >>>>>> >>>>>> > > >>>>>> >>>>>> > > >>>>>> >>>>>> > > >>>>> >>>>>> > > >>>>> >>>>>> > > >>>>> >>>>>> > > >>>> >>>>>> > > >>> >>>>>> > > >>> >>>>>> > > >>> >>>>>> > > >> >>>>>> > > >> >>>>>> > > >> -- >>>>>> > > >> Lift, the simply functional web framework http://liftweb.net >>>>>> > > >> Beginning Scala http://www.apress.com/book/view/1430219890 >>>>>> > > >> Follow me: http://twitter.com/dpp >>>>>> > > >> Surf the harmonics >>>>>> > > >> >>>>>> > > >> >>>>>> > > >> >>>>>> > > > >>>>>> > > > > >>>>>> > > > >>>>>> > > >>>>>> > > >>>>>> > > -- >>>>>> > > Lift, the simply functional web framework http://liftweb.net >>>>>> > > Beginning Scala http://www.apress.com/book/view/1430219890 >>>>>> > > Follow me: http://twitter.com/dpp >>>>>> > > Surf the harmonics >>>>>> > > >>>>>> > > >>>>>> > > >>>>>> > > > >>>>>> > > >>>>>> > >>>>>> > >>>>>> > -- >>>>>> > Lift, the simply functional web framework http://liftweb.net >>>>>> > Beginning Scala http://www.apress.com/book/view/1430219890 >>>>>> > Follow me: http://twitter.com/dpp >>>>>> > Surf the harmonics >>>>>> > >>>>>> > >>>>>> > >>>>>> > > >>>>>> > >>>>>> >>>>>> >>>>>> -- >>>>>> Lift, the simply functional web framework http://liftweb.net >>>>>> Beginning Scala http://www.apress.com/book/view/1430219890 >>>>>> Follow me: http://twitter.com/dpp >>>>>> Surf the harmonics >>>>>> >>>>>> >>>>>> >>>>> >>>> >>>> >>>> >>> >>> >>> >> > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~----------~----~----~----~------~----~------~--~---
