• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

No date in e-mail

 
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I noticed that "Message posted" automatic e-mail (sent to the users watching a topic) has no date. Messages without date can be a spam, occur very down in the list of messages, and make bad impression to the reader.

If that is only my case, please advice how to solve this?
If it common, please fix this in next release.

Evgeny
[originally posted on jforum.net by Evgeny]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hm, the ones I get there is a date associated. Can you please post the message headers here?

Rafael
[originally posted on jforum.net by Rafael Steil]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here is what one of my users wrote: "The activation mail doesn't containt "Date:" in its header. So the mail date equals to 1/1/1970 2:00 and though the mail appears at the top of the mail list ordered by mail arrival time".

Basically, all e-mail notifications from JForum have similar problem
Do you set current date directly in the Message class just before you send an e-mail?

Evgeny
[originally posted on jforum.net by Evgeny]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Nope, I do not. There is already an improvement request for that.

Rafael
[originally posted on jforum.net by Rafael Steil]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Rafael,
in addition to "date", please set the "encoding" header in each e-mail.
Messages may contain non-English characters, for example, in a Forum message subject. The "encoding" header will allow to correctly see such text.

So, the "date" and "encoding" please!

It would also be better to set these parameters in SystemGlobals.properties, instead of current

mail.newAnswer.subject=[\${forum.name}] Message posted: {0}
mail.newPm.subject=[\${forum.name}] Private message

and similarly

mail.lostPassword.subject = [${forum.name}] Password recovery


PLEASE, PLEASE, PLEASE!!! And please update the SF, it's much easer to update the whole forum at once with all small fixes happened in the last time!

Evgeny
[originally posted on jforum.net by Evgeny]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
To be honest, I don't know how to set dates using javamail :\
I'll add the code for the encoding. Abuot the " It would also be better to set these parameters in SystemGlobals.properties, instead of current ", I didn't understand this part.

Rafael
[originally posted on jforum.net by Rafael Steil]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
charset="UTF-8";
MimeMessage message = new MimeMessage(session);
message.setSentDate(new Date()); // set date
message.setSubject("subject", charset); // set subject encoding
message.setText("content", charset); // set content encoding
...

I meant change this

mail.newAnswer.subject=[${forum.name}] Nofity of answer to the topic: {0}
mail.newPm.subject=[${forum.name}] Nofity of Private Message
mail.lostPassword.subject = [${forum.name}] - Password recovery

to that

mail.newAnswer.subject=[\${forum.name}] Message posted: {0}
mail.newPm.subject=[\${forum.name}] Private message
mail.lostPassword.subject = [${forum.name}] Password recovery

Please update SF, so I can apply all improvements and fixes at once.
Evgeny
[originally posted on jforum.net by Evgeny]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks, I'll update the code.

Rafael
[originally posted on jforum.net by Rafael Steil]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks!
Evgeny
[originally posted on jforum.net by Evgeny]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Rafael,
please check what charset you set in

message.setSubject("subject", charset); // set subject encoding
message.setText("content", charset); // set content encoding

I just received a "Message posted" notification with gibberish, the message looks like

[MyForum] Message posted: ??? ??? ???

where ??? is an incorrectly displayed text in Russian, because the encoding is ISO-8859-1 not UTF8.
Evgeny
[originally posted on jforum.net by Evgeny]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You just need to change the charset in SystemGlobals.properties / jforum-custon.comf. It's the key "mail.charset".

Rafael
[originally posted on jforum.net by Rafael Steil]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Rafael,
I understand.

Anyway I think mail.charset=UTF-8 is more useful, especially because you already use UTF-8 for web pages. I mean, it makes no difference for English text, but can already cover many international charsets and special symbols (inside English text, too). Also, if mail.charset is not set to UTF-8 by default, there is a need to set that parameter each time when the forum is updated.

Evgeny
[originally posted on jforum.net by Evgeny]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I aggree. I'll change it to UTF-8.

Rafael
[originally posted on jforum.net by Rafael Steil]
 
what if we put solar panels on top of the semi truck trailer? That could power this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic