Skip to content

Add show_received_date option to control output of "Received on" at bottom of message body - fixes #31 #43

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions docs/hmrc.4
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH hmrc 4 "February 04, 2004"
.TH hmrc 4 "July 10, 2017"
.SH NAME
hmrc \- Hypermail configuration file
.SH DESCRIPTION
Expand Down Expand Up @@ -749,15 +749,15 @@ the index files. This will happen thru a
.B LINK
element in the index document's
.B HEAD.
By default this option is desactivated.
By default this option is disabled.
.TP
.B mcss_url = "URL"
This will link an external stylesheet found at the given URL to
the message files. This will happen thru a
.B LINK
element in the message document's
.B HEAD.
By default this option is desactivated.
By default this option is disabled.
.TP
.B show_headers = list_of_RFC_Headers_to_display
This is the list of headers to be displayed if showheaders is set to
Expand All @@ -766,6 +766,15 @@ line. If it contains the special character ``*''
.B hypermail
will display all header lines.
.TP
.B show_received_date = boolean_number
This controls whether the date the message was received is displayed
at the end of the message text. If set to
.B 0
the received date is not displayed.
This option is
.B enabled
by default.
.TP
.B readone = boolean_number
Set this to
.B 1
Expand Down
9 changes: 9 additions & 0 deletions docs/hmrc.html
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ <h1 align=center><img src="hypermail.png" width="60" align="middle" height="60"
<li><a href="#show_index_links">show_index_links</a> control links to index pages
<li><a href="#showheaders">showheaders</a> To:, From:, Subject:
<li><a href="#show_headers">show_headers</a> others (Message-ID, etc)
<li><a href="#show_received_date">show_received_date</a> show date message was received
<li><a href="#mhtmlheaderfile">mhtmlheaderfile</a> template
<li><a href="#mhtmlfooterfile">mhtmlfooterfile</a> template
</ul>
Expand Down Expand Up @@ -833,6 +834,14 @@ <h3><a name="msg_head">Message page headers/footers</a></h3>
<br><i>show_headers = From,Subject,Date,Message-ID</i> (disabled by default)
</dd>

<a name="show_received_date"></a>
<dt><strong>show_received_date = [ 0 | 1 ]</strong></dt><dd>
Set this to 0 to disable displaying the date the message was received
at the end of the message body.
<br>
<br><i>show_received_date = 0</i> (enabled by default)
</dd>

<a name="mhtmlheaderfile"></a>
<dt><strong>mhtmlheaderfile = [ path to message header template file | NONE ]</strong></dt><dd>
Set this to the path to the Message header template file. The template
Expand Down
5 changes: 3 additions & 2 deletions src/print.c
Original file line number Diff line number Diff line change
Expand Up @@ -2263,8 +2263,9 @@ void writearticles(int startnum, int maxnum)
fprintf (fp, "<div class=\"mail\">\n");
print_headers(fp, email, FALSE);
printbody(fp, email, maybe_reply, is_reply);
fprintf (fp, "<span id=\"received\"><dfn>%s</dfn> %s</span>\n",
lang[MSG_RECEIVED_ON], getdatestr(email->fromdate));
if (set_show_received_date)
fprintf (fp, "<span id=\"received\"><dfn>%s</dfn> %s</span>\n",
lang[MSG_RECEIVED_ON], getdatestr(email->fromdate));
fprintf (fp, "</div>\n");
printcomment(fp, "body", "end");

Expand Down
6 changes: 6 additions & 0 deletions src/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ bool set_showheaders;
bool set_showbr;
bool set_showhr;
bool set_showreplies;
bool set_show_received_date;
int set_show_msg_links;
int set_show_index_links;
bool set_usetable;
Expand Down Expand Up @@ -309,6 +310,10 @@ struct Config cfg[] = {
"# Set this to On to show all replies to a message as links\n"
"# in article files.\n", FALSE},

{"show_received_date", &set_show_received_date, BTRUE, CFG_SWITCH,
"# Set this to On to show the Received date at the end of the message\n"
"# body.\n", FALSE},

{"show_msg_links", &set_show_msg_links, INT(1), CFG_INTEGER,
"# Set this to 1 to put the individual message links at the top\n"
"# of the individual message pages. Set this to 0 to produce pages\n"
Expand Down Expand Up @@ -1250,6 +1255,7 @@ void dump_config(void)
printf("set_showbr = %d\n",set_showbr);
printf("set_showhr = %d\n",set_showhr);
printf("set_showreplies = %d\n",set_showreplies);
printf("set_show_received_date = %d\n",set_show_received_date);
printf("set_show_msg_links = %d\n",set_show_msg_links);
printf("set_usetable = %d\n",set_usetable);
printf("set_indextable = %d\n",set_indextable);
Expand Down
1 change: 1 addition & 0 deletions src/setup.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ extern bool set_showheaders;
extern bool set_showbr;
extern bool set_showhr;
extern bool set_showreplies;
extern bool set_show_received_date;
extern int set_show_msg_links;
extern int set_show_index_links;
extern bool set_usetable;
Expand Down