Lift Mailer: Email Threading: Adding Unique Email Headers

74 views
Skip to first unread message

Dan

unread,
Mar 29, 2011, 3:50:20 PM3/29/11
to Lift
As part of a webapp, users can receive notification emails when users
reply to a given post. However, the emails are not currently threaded,
and I don't see how to add a unique header to notification emails that
are for replies to the same post. My goal is to have all replies
threaded together for a given post.

Adding a unique per-post subject and unique per-post reference header
could help solve this threading problem.

I've enjoyed working with Lift, but this has proved troublesome.

I appreciate the help.


Best,
Dan

TylerWeir

unread,
Mar 29, 2011, 3:58:25 PM3/29/11
to lif...@googlegroups.com
Lift's mailer uses javax.mail - http://www.oracle.com/technetwork/java/javamail/index.html

Can you not do what you want with that?

Dan

unread,
Mar 29, 2011, 4:43:35 PM3/29/11
to Lift
Thanks Tyler.

I wanted to see if a strategy for this already existed within Lift. I
could go about and build my own Mailer class, but I was checking out
Mailer (
http://scala-tools.org/mvnsites/liftweb-2.0-M3/framework/lift-base/lift-util/scaladocs/net/liftweb/util/Mailer.scala.html#Some(31)
) which creates the conventional headers, though I wanted to add my
own.


Any other thoughts?

-DAN

On Mar 29, 3:58 pm, TylerWeir <tyler.w...@gmail.com> wrote:
> Lift's mailer uses javax.mail -http://www.oracle.com/technetwork/java/javamail/index.html

Richard Dallaway

unread,
Mar 29, 2011, 5:43:01 PM3/29/11
to lif...@googlegroups.com, Dan
You can add a custom unique per-post subject easily enough:

Mailer.sendMail(From("y...@example.com"), Subject("whatever you like here"), To(som...@example.com"), msg)

But I don't see an easy way to add a custom Message-Id, References and/or In-Reply-To header for an outgoing email. Maybe someone else can spot how to do it, otherwise it does sounds like a useful addition.  Perhaps a HeaderType (key->value) to add to MailTypes?

Richard


--
You received this message because you are subscribed to the Google Groups "Lift" group.
To post to this group, send email to lif...@googlegroups.com.
To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.


David Pollak

unread,
Mar 29, 2011, 8:53:47 PM3/29/11
to lif...@googlegroups.com
On Tue, Mar 29, 2011 at 2:43 PM, Richard Dallaway <ric...@dallaway.com> wrote:
You can add a custom unique per-post subject easily enough:

Mailer.sendMail(From("y...@example.com"), Subject("whatever you like here"), To(som...@example.com"), msg)

But I don't see an easy way to add a custom Message-Id, References and/or In-Reply-To header for an outgoing email. Maybe someone else can spot how to do it, otherwise it does sounds like a useful addition.  Perhaps a HeaderType (key->value) to add to MailTypes?

Sounds good.  Please open a ticket and assign it to me.
 

Richard

On Tue, Mar 29, 2011 at 8:50 PM, Dan <d.p.fl...@gmail.com> wrote:
As part of a webapp, users can receive notification emails when users
reply to a given post. However, the emails are not currently threaded,
and I don't see how to add a unique header to notification emails that
are for replies to the same post. My goal is to have all replies
threaded together for a given post.

Adding a unique per-post subject and unique per-post reference header
could help solve this threading problem.

I've enjoyed working with Lift, but this has proved troublesome.

I appreciate the help.


Best,
Dan

--
You received this message because you are subscribed to the Google Groups "Lift" group.
To post to this group, send email to lif...@googlegroups.com.
To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.


--
You received this message because you are subscribed to the Google Groups "Lift" group.
To post to this group, send email to lif...@googlegroups.com.
To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.



--
Lift, the simply functional web framework http://liftweb.net

Richard Dallaway

unread,
Mar 30, 2011, 10:12:38 AM3/30/11
to lif...@googlegroups.com
Hi Dan - just to confirm, being able to set headers is all you need?

Cheers
Richard

Dan

unread,
Mar 30, 2011, 10:40:27 AM3/30/11
to Lift
--Richard

Right, what you mentioned in your first message is what I need:
ability to set headers: ( " custom Message-Id, References and/or In-
Reply-To header for an outgoing email " ).

Though, did you have any other capabilities in mind related to
threading emails?

Thanks for the help.

(Also, once we are confirmed, should I file the ticket?)


Best,
Dan





On Mar 30, 10:12 am, Richard Dallaway <rich...@dallaway.com> wrote:
> Hi Dan - just to confirm, being able to set headers is all you need?
>
> Cheers
> Richard
>
> On Wed, Mar 30, 2011 at 1:53 AM, David Pollak <feeder.of.the.be...@gmail.com
>
>
>
>
>
>
>
> > wrote:
>
> > On Tue, Mar 29, 2011 at 2:43 PM, Richard Dallaway <rich...@dallaway.com>wrote:
>
> >> You can add a custom unique per-post subject easily enough:
>
> >> Mailer.sendMail(From("y...@example.com"), Subject("whatever you like
> >> here"), To(some...@example.com"), msg)
>
> >> But I don't see an easy way to add a custom Message-Id, References and/or
> >> In-Reply-To header for an outgoing email. Maybe someone else can spot how to
> >> do it, otherwise it does sounds like a useful addition.  Perhaps a
> >> HeaderType (key->value) to add to MailTypes?
>
> > Sounds good.  Please open a ticket and assign it to me.
>
> >> Richard
>
> > Beginning Scalahttp://www.apress.com/book/view/1430219890

Richard Dallaway

unread,
Mar 30, 2011, 10:49:35 AM3/30/11
to lif...@googlegroups.com, Dan
Hi Dan - I don't have anything else in mind.   If you wouldn't mind creating the ticket, that'd be good, as it sounds like you're in a position to try it when it's done. See http://www.assembla.com/wiki/show/liftweb/Creating_tickets

One comment: I was just looking at JavaMail 1.4, and setting Message-ID might be tricker than it should be as it seems to require subclassing MimeMessage to jump in on updateMessageID() to prevent JavaMail from setting its own ID if we try to set one first.

Richard

Dan

unread,
Mar 30, 2011, 11:52:11 AM3/30/11
to Lift
Richard,

All right, ticket (#953) created.

Thanks. Look forward to the enhancement!


-DAN

On Mar 30, 10:49 am, Richard Dallaway <rich...@dallaway.com> wrote:
> Hi Dan - I don't have anything else in mind.   If you wouldn't mind creating
> the ticket, that'd be good, as it sounds like you're in a position to try it
> when it's done. Seehttp://www.assembla.com/wiki/show/liftweb/Creating_tickets

Richard Dallaway

unread,
Mar 30, 2011, 12:00:39 PM3/30/11
to lif...@googlegroups.com
Thank you - and I've assigned it to David as he requested.
Reply all
Reply to author
Forward
0 new messages