Updated
Showing
10 changed files
with
179 additions
and
11 deletions
1 | 2003-09-20 Sergey Poznyakoff | ||
2 | |||
3 | Install under mailutils/gnu only those headers which are | ||
4 | missing on the system. | ||
5 | Include regex to libmailbox if the system's libc lacks it. | ||
6 | Add new functions for handling reply subject headers. | ||
7 | |||
8 | * Makefile.am: Added headers | ||
9 | * m4/mu_libobj.m4 (MU_HEADER,MU_FINISH_LINKS): New macros | ||
10 | * configure.ac: Use MU_HEADER and MU_FINISH_LINKS where needed | ||
11 | * m4/regex.m4: Likewise | ||
12 | |||
13 | * dotlock/Makefile.am: Fixed INCLUDES | ||
14 | * lib/Makefile.am: Updated | ||
15 | * mailbox/Makefile.am: Likewise. | ||
16 | * examples/Makefile.am: Likewise. | ||
17 | * frm/Makefile.am: Likewise. | ||
18 | * guimb/Makefile.am: Likewise. | ||
19 | * imap4d/Makefile.am: Likewise. | ||
20 | * include/mailutils/gnu/Makefile.am: Likewise. | ||
21 | * libsieve/Makefile.am: Likewise. | ||
22 | * mail/Makefile.am: Likewise. | ||
23 | * mail.local/Makefile.am: Likewise. | ||
24 | * mail.remote/Makefile.am: Likewise. | ||
25 | * mailbox/imap/Makefile.am: Likewise. | ||
26 | * mailbox/maildir/Makefile.am: Likewise. | ||
27 | * mailbox/mbox/Makefile.am: Likewise. | ||
28 | * mailbox/mh/Makefile.am: Likewise. | ||
29 | * mailbox/pop/Makefile.am: Likewise. | ||
30 | * messages/Makefile.am: Likewise. | ||
31 | * mh/Makefile.am: Likewise. | ||
32 | * pop3d/Makefile.am: Likewise. | ||
33 | * readmsg/Makefile.am: Likewise. | ||
34 | * sieve/Makefile.am: Likewise. | ||
35 | * from/Makefile.am: Likewise. | ||
36 | * comsat/Makefile.am: Likewise. | ||
37 | * auth/Makefile.am: Likewise. | ||
38 | |||
39 | * headers: New directory | ||
40 | * headers/Makefile.am: New file | ||
41 | * headers/posix/Makefile.am: New file | ||
42 | |||
43 | * include/mailutils/gnu/argp.h: Moved to ... | ||
44 | * headers/argp.h: ... here | ||
45 | * include/mailutils/gnu/getopt.h: Moved to ... | ||
46 | * headers/getopt.h: ... here | ||
47 | |||
48 | * lib/regex.h: Moved to ... | ||
49 | * headers/regex.h: ... here | ||
50 | * lib/posix/regex.h: Moved to ... | ||
51 | * headers/posix/regex.h: ... here | ||
52 | * lib/posix/Makefile.am: Removed | ||
53 | * lib/posix/.cvsignore: Removed | ||
54 | * lib/posix: Removed | ||
55 | |||
56 | * lib/regex.c: Moved to ... | ||
57 | * mailbox/regex.c: ... here | ||
58 | |||
59 | * include/mailutils/gnu/.cvsignore: Updated | ||
60 | |||
61 | * mailbox/munre.c: New file | ||
62 | * include/mailutils/mutil.h (munre_set_regex) | ||
63 | (munre_subject): New functions. | ||
64 | |||
65 | * mail/followup.c: Use munre_subject() and util_reply_prefix(). | ||
66 | * mail/reply.c: Likewise | ||
67 | * mail/mail.c (struct argp_option options): Removed irrelevant | ||
68 | OPTION_DOC. | ||
69 | (main): Set default replyprefix | ||
70 | * mail/mail.h (util_reply_prefix): New function | ||
71 | * mail/util.c: Likewise | ||
72 | (util_setenv): A hack to properly handle "replyregex". | ||
73 | * mail/var.c (run_editor): Fixed return type. | ||
74 | |||
75 | * mh/mh_format.c (builtin_unre): Use munre_subject() | ||
76 | (builtin_isreply,builtin_reply_regex): New functions | ||
77 | * mh/mh.h (mh_set_reply_regex): New function. | ||
78 | * mh/mh_init.c: Likewise. | ||
79 | * mh/mh_global.c (mh_read_profile): Read Reply-Regex | ||
80 | |||
81 | * mh/README: Updated | ||
82 | * mh/replcomps: Updated | ||
83 | * mh/replgroupcomps: Updated | ||
84 | |||
85 | * doc/texinfo/programs.texi: Updated | ||
86 | |||
1 | 2003-09-18 Sergey Poznyakoff | 87 | 2003-09-18 Sergey Poznyakoff |
2 | 88 | ||
3 | * mailbox/mh/mbox.c (_mh_message_delete): Zero out the | 89 | * mailbox/mh/mbox.c (_mh_message_delete): Zero out the | ... | ... |
... | @@ -17,7 +17,7 @@ | ... | @@ -17,7 +17,7 @@ |
17 | ## Foundation, Inc. | 17 | ## Foundation, Inc. |
18 | ## 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 18 | ## 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
19 | 19 | ||
20 | INCLUDES = -I${top_srcdir}/include -I${top_srcdir}/mailbox/include -I${top_srcdir}/lib @INTLINCS@ | 20 | INCLUDES = -I${top_srcdir}/include -I${top_srcdir}/mailbox/include -I${top_srcdir}/lib -I${top_builddir}/include/mailutils/gnu @INTLINCS@ |
21 | AM_CFLAGS = -DSITE_VIRTUAL_PWDDIR=\"@SITE_VIRTUAL_PWDDIR@\" \ | 21 | AM_CFLAGS = -DSITE_VIRTUAL_PWDDIR=\"@SITE_VIRTUAL_PWDDIR@\" \ |
22 | -DSITE_CRAM_MD5_PWD=\"@SITE_CRAM_MD5_PWD@\" | 22 | -DSITE_CRAM_MD5_PWD=\"@SITE_CRAM_MD5_PWD@\" |
23 | 23 | ... | ... |
... | @@ -17,7 +17,7 @@ | ... | @@ -17,7 +17,7 @@ |
17 | ## Foundation, Inc. | 17 | ## Foundation, Inc. |
18 | ## 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 18 | ## 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
19 | 19 | ||
20 | INCLUDES =-I$(srcdir) -I$(top_srcdir)/lib -I$(top_srcdir)/include @INTLINCS@ | 20 | INCLUDES =-I$(srcdir) -I$(top_srcdir)/lib -I${top_builddir}/include/mailutils/gnu -I$(top_srcdir)/include @INTLINCS@ |
21 | 21 | ||
22 | sbin_PROGRAMS = comsatd | 22 | sbin_PROGRAMS = comsatd |
23 | 23 | ... | ... |
... | @@ -1913,6 +1913,33 @@ configuration file upon startup. See @ref{Mail Configuration Files}. | ... | @@ -1913,6 +1913,33 @@ configuration file upon startup. See @ref{Mail Configuration Files}. |
1913 | 1913 | ||
1914 | When set, any outgoing message will be saved to the named file. | 1914 | When set, any outgoing message will be saved to the named file. |
1915 | 1915 | ||
1916 | @item replyprefix | ||
1917 | @*Type: String | ||
1918 | @*Default: @samp{Re: } | ||
1919 | |||
1920 | Sets the prefix that will be used when constructing the subject line | ||
1921 | of a reply message. | ||
1922 | |||
1923 | @item replyregex | ||
1924 | @*Type: String | ||
1925 | @*Default: @samp{^re: *} | ||
1926 | |||
1927 | Sets the regular expression used to recognize subjects of reply | ||
1928 | messages. If the @code{Subject} header of the message matches this | ||
1929 | expression, the value of @code{replyprefix} will not be prepended to | ||
1930 | it before replying. The expression should be a POSIX extended regular | ||
1931 | expression. The comparison is case-insensitive. | ||
1932 | |||
1933 | For example, to recognize usual English, Polish, Norwegian and German | ||
1934 | reply subject styles, use: | ||
1935 | |||
1936 | @example | ||
1937 | set replyregex="^(re|odp|aw|ang)(\\[[0-9]+\\])?:[[:blank:]]" | ||
1938 | @end example | ||
1939 | |||
1940 | @noindent | ||
1941 | (Notice the quoting of backslash characters). | ||
1942 | |||
1916 | @item save | 1943 | @item save |
1917 | @*Type: Boolean. | 1944 | @*Type: Boolean. |
1918 | @*Default: True. | 1945 | @*Default: True. | ... | ... |
... | @@ -17,7 +17,7 @@ | ... | @@ -17,7 +17,7 @@ |
17 | ## Foundation, Inc. | 17 | ## Foundation, Inc. |
18 | ## 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 18 | ## 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
19 | 19 | ||
20 | INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/lib @INTLINCS@ | 20 | INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/lib -I${top_builddir}/include/mailutils/gnu @INTLINCS@ |
21 | SUBDIRS = testsuite | 21 | SUBDIRS = testsuite |
22 | 22 | ||
23 | bin_PROGRAMS = from | 23 | bin_PROGRAMS = from | ... | ... |
... | @@ -20,11 +20,7 @@ | ... | @@ -20,11 +20,7 @@ |
20 | 20 | ||
21 | #include <mailutils/types.h> | 21 | #include <mailutils/types.h> |
22 | 22 | ||
23 | #ifdef HAVE_ARGP_H | 23 | #include <argp.h> |
24 | # include <argp.h> | ||
25 | #else | ||
26 | # include <mailutils/gnu/argp.h> | ||
27 | #endif | ||
28 | 24 | ||
29 | #define MODE_INTERACTIVE 0 | 25 | #define MODE_INTERACTIVE 0 |
30 | #define MODE_DAEMON 1 | 26 | #define MODE_DAEMON 1 | ... | ... |
... | @@ -50,6 +50,48 @@ from its argument. Useful for creating subjects in reply messages: | ... | @@ -50,6 +50,48 @@ from its argument. Useful for creating subjects in reply messages: |
50 | 50 | ||
51 | %<{subject}Subject: Re: %(unre{subject})\\n%> | 51 | %<{subject}Subject: Re: %(unre{subject})\\n%> |
52 | 52 | ||
53 | *** reply_regex | ||
54 | Argument: string | ||
55 | Return: none | ||
56 | |||
57 | Sets the regular expression used to recognize reply messages. The | ||
58 | argument should be a POSIX extended regular expression. The matching | ||
59 | is case insensitive. | ||
60 | |||
61 | For example, the following invocation | ||
62 | |||
63 | %(reply_regex ^\(re|aw|ang|odp\)\(\\[[0-9]+\\]\)?:[[:blank:]]) | ||
64 | |||
65 | corresponds to the English "Re", Polish "Odp", Norwegian "Aw" or | ||
66 | German "Ang", optionally followed by a number in brackets, followed | ||
67 | by colon and any amount of whitespace. Notice the quoting of the | ||
68 | regex metacharacters. | ||
69 | |||
70 | See also `Reply-Regex' and `isreply' below. | ||
71 | |||
72 | *** isreply | ||
73 | Argument: [OPTIONAL] string | ||
74 | Return: boolean | ||
75 | |||
76 | If argument is not given, the value of Subject: header is taken. | ||
77 | |||
78 | The function returns true if its argument matches the "reply subject" | ||
79 | regular expression. This expression is set via the global profile variable | ||
80 | Reply-Regex or via the format function %(reply_regex). | ||
81 | |||
82 | This function is useful for creating Subject: headers in reply | ||
83 | messages. For example, consider the following construction: | ||
84 | |||
85 | %<{subject}%(lit)%<(isreply)%?\ | ||
86 | (profile reply-prefix)%(concat)%|%(concat Re:)%>\ | ||
87 | %(concat{subject})%(printhdr Subject: )\n%> | ||
88 | |||
89 | If the Subject: header already contained reply prefix, this construct | ||
90 | leaves it unchanged. Otherwise it prepends to it the value of | ||
91 | Reply-Prefix profile variable, or, if it is unset, the string "Re:". | ||
92 | |||
93 | This expression is used in default replcomps and replgroupcomps files. | ||
94 | |||
53 | *** rcpt | 95 | *** rcpt |
54 | Argument: string, one of "to", "cc", "me", "all" | 96 | Argument: string, one of "to", "cc", "me", "all" |
55 | Return: boolean | 97 | Return: boolean |
... | @@ -78,7 +120,6 @@ argument. The output is formatted as RFC 822 header, i.e. | ... | @@ -78,7 +120,6 @@ argument. The output is formatted as RFC 822 header, i.e. |
78 | it is split at whitespace characters nearest to the width boundary | 120 | it is split at whitespace characters nearest to the width boundary |
79 | and each subsequent segment is prefixed with horizontal tabulation. | 121 | and each subsequent segment is prefixed with horizontal tabulation. |
80 | 122 | ||
81 | |||
82 | *** in_reply_to | 123 | *** in_reply_to |
83 | Argument: none | 124 | Argument: none |
84 | Return: string | 125 | Return: string |
... | @@ -91,6 +132,23 @@ Return: string | ... | @@ -91,6 +132,23 @@ Return: string |
91 | 132 | ||
92 | Generates the value for the References: header according to RFC 2822. | 133 | Generates the value for the References: header according to RFC 2822. |
93 | 134 | ||
135 | * New profile variables: | ||
136 | |||
137 | ** Reply-Regex | ||
138 | |||
139 | Sets the regular expression used to recognize reply messages. The | ||
140 | argument should be a POSIX extended regular expression. The matching | ||
141 | is case insensitive. | ||
142 | |||
143 | For example, setting in your .mh_profile: | ||
144 | |||
145 | Reply-Regex: ^(re|aw|ang|odp)(\[[0-9]+\])?:[[:blank:]] | ||
146 | |||
147 | will make the default replcomps and replgroupcomps formats recognize | ||
148 | usual English, Norwiegian, German and Polish reply subject prefixes. | ||
149 | |||
150 | See also format functions `reply_regex' and `isreply'. | ||
151 | |||
94 | * rmm | 152 | * rmm |
95 | 153 | ||
96 | ** Different behaviour if one of the messages in the list does not exist. | 154 | ** Different behaviour if one of the messages in the list does not exist. | ... | ... |
... | @@ -9,7 +9,7 @@ | ... | @@ -9,7 +9,7 @@ |
9 | %(lit)%<(rcpt to)%(formataddr{to})%>%<(rcpt cc)%(formataddr{cc})%>%<(rcpt me)%(formataddr(me))%>\ | 9 | %(lit)%<(rcpt to)%(formataddr{to})%>%<(rcpt cc)%(formataddr{cc})%>%<(rcpt me)%(formataddr(me))%>\ |
10 | %<(nonnull)%(void(width))%(putaddr cc: )\n%>\ | 10 | %<(nonnull)%(void(width))%(putaddr cc: )\n%>\ |
11 | %<{fcc}Fcc: %{fcc}\n%>\ | 11 | %<{fcc}Fcc: %{fcc}\n%>\ |
12 | %<{subject}%(lit)%(concat(unre{subject}))%(printhdr Subject: Re: )\n%>\ | 12 | %<{subject}%(lit)%<(isreply)%?(profile reply-prefix)%(concat)%|%(concat Re:)%>%(concat{subject})%(printhdr Subject: )\n%>\ |
13 | %(lit)%(concat(in_reply_to))%<(nonnull)%(void(width))%(printhdr In-reply-to: )\n%>\ | 13 | %(lit)%(concat(in_reply_to))%<(nonnull)%(void(width))%(printhdr In-reply-to: )\n%>\ |
14 | %(lit)%(concat(references))%<(nonnull)%(void(width))%(printhdr References: )\n%>\ | 14 | %(lit)%(concat(references))%<(nonnull)%(void(width))%(printhdr References: )\n%>\ |
15 | X-Mailer: MH \(%(package_string)\)\n\ | 15 | X-Mailer: MH \(%(package_string)\)\n\ | ... | ... |
... | @@ -13,7 +13,7 @@ | ... | @@ -13,7 +13,7 @@ |
13 | %<(nonnull)%(void(width))%(putaddr cc: )\n%>%>\ | 13 | %<(nonnull)%(void(width))%(putaddr cc: )\n%>%>\ |
14 | %; | 14 | %; |
15 | %<{fcc}Fcc: %{fcc}\n%>\ | 15 | %<{fcc}Fcc: %{fcc}\n%>\ |
16 | %<{subject}%(lit)%(concat(unre{subject}))%(printhdr Subject: Re: )\n%>\ | 16 | %<{subject}%(lit)%<(isreply{subject})%?(profile reply-prefix)%(concat)%|%(concat Re:)%>%(concat{subject})%(printhdr Subject: )\n%>\ |
17 | %(lit)%(concat(in_reply_to))%<(nonnull)%(void(width))%(printhdr In-reply-to: )\n%>\ | 17 | %(lit)%(concat(in_reply_to))%<(nonnull)%(void(width))%(printhdr In-reply-to: )\n%>\ |
18 | %(lit)%(concat(references))%<(nonnull)%(void(width))%(printhdr References: )\n%>\ | 18 | %(lit)%(concat(references))%<(nonnull)%(void(width))%(printhdr References: )\n%>\ |
19 | X-Mailer: MH \(%(package_string)\)\n\ | 19 | X-Mailer: MH \(%(package_string)\)\n\ | ... | ... |
-
Please register or sign in to post a comment