33dd1af8b3
PR: ports/107680 Submitted by: Udo Schweigert <udo.schweigert@siemens.com> (maintainer)
141 lines
4 KiB
Text
141 lines
4 KiB
Text
--- globals.h.orig 2006-08-11 12:07:12.000000000 +0300
|
|
+++ globals.h 2006-12-14 12:26:14.000000000 +0200
|
|
@@ -50,6 +50,7 @@
|
|
WHERE char *FolderFormat;
|
|
WHERE char *ForwFmt;
|
|
WHERE char *Fqdn;
|
|
+WHERE char *Greeting;
|
|
WHERE char *HdrFmt;
|
|
WHERE char *Homedir;
|
|
WHERE char *Hostname;
|
|
--- hdrline.c.orig 2006-04-28 22:43:51.000000000 +0300
|
|
+++ hdrline.c 2006-12-14 16:47:16.000000000 +0200
|
|
@@ -730,3 +730,61 @@
|
|
|
|
mutt_FormatString (dest, destlen, s, hdr_format_str, (unsigned long) &hfi, flags);
|
|
}
|
|
+
|
|
+/* %n = recipient name
|
|
+ * %u = user (login) name of recipient
|
|
+ * %v = first name of recipient */
|
|
+const char *
|
|
+greeting_string (char *dest,
|
|
+ size_t destlen,
|
|
+ char op,
|
|
+ const char *src,
|
|
+ const char *prefix,
|
|
+ const char *ifstring,
|
|
+ const char *elsestring,
|
|
+ unsigned long data,
|
|
+ format_flag flags)
|
|
+{
|
|
+ HEADER *hdr = (HEADER *)data;
|
|
+ char *p, buf2[SHORT_STRING];
|
|
+
|
|
+ dest[0] = '\0';
|
|
+ switch (op)
|
|
+ {
|
|
+ case 'n':
|
|
+ mutt_format_s (dest, destlen, prefix, mutt_get_name (hdr->env->to));
|
|
+ break;
|
|
+
|
|
+ case 'u':
|
|
+ if (hdr->env->to)
|
|
+ {
|
|
+ strfcpy (buf2, mutt_addr_for_display (hdr->env->to), sizeof (buf2));
|
|
+ if ((p = strpbrk (buf2, "%@")))
|
|
+ *p = '\0';
|
|
+ }
|
|
+ else
|
|
+ buf2[0] = '\0';
|
|
+ mutt_format_s (dest, destlen, prefix, buf2);
|
|
+ break;
|
|
+
|
|
+ case 'v':
|
|
+ if (hdr->env->to)
|
|
+ mutt_format_s (buf2, sizeof (buf2), prefix, mutt_get_name (hdr->env->to));
|
|
+ else if (hdr->env->cc)
|
|
+ mutt_format_s (buf2, sizeof (buf2), prefix, mutt_get_name (hdr->env->cc));
|
|
+ else
|
|
+ *buf2 = '\0';
|
|
+ if ((p = strpbrk (buf2, " %@")))
|
|
+ *p = '\0';
|
|
+ mutt_format_s (dest, destlen, prefix, buf2);
|
|
+ break;
|
|
+
|
|
+ default:
|
|
+ snprintf (dest, destlen, "%%%s%c", prefix, op);
|
|
+ break;
|
|
+ }
|
|
+ if (flags & M_FORMAT_OPTIONAL)
|
|
+ mutt_FormatString (dest, destlen, elsestring, greeting_string, data, flags);
|
|
+
|
|
+ return(src);
|
|
+}
|
|
--- init.h.orig 2006-08-11 12:04:04.000000000 +0300
|
|
+++ init.h 2006-12-14 16:49:16.000000000 +0200
|
|
@@ -710,6 +710,22 @@
|
|
** a regular expression that will match the whole name so mutt will expand
|
|
** "Franklin" to "Franklin, Steve".
|
|
*/
|
|
+ { "greeting", DT_STR, R_NONE, UL &Greeting, UL "" },
|
|
+ /*
|
|
+ ** .pp
|
|
+ ** When set, this is the string that will precede every message as a
|
|
+ ** greeting phrase to the recipients.
|
|
+ ** .pp
|
|
+ ** ``Format strings'' are similar to the strings used in the ``C''
|
|
+ ** function printf to format output (see the man page for more detail).
|
|
+ ** The following sequences are defined in Mutt:
|
|
+ ** .pp
|
|
+ ** .dl
|
|
+ ** .dt %n .dd recipient name
|
|
+ ** .dt %u .dd user (login) name of recipient
|
|
+ ** .dt %v .dd first name of recipient
|
|
+ ** .de
|
|
+ */
|
|
{ "hdr_format", DT_SYN, R_NONE, UL "index_format", 0 },
|
|
/*
|
|
*/
|
|
--- PATCHES.orig 2006-08-11 13:55:43.000000000 +0300
|
|
+++ PATCHES 2006-12-14 15:59:14.000000000 +0200
|
|
@@ -0,0 +1 @@
|
|
+vc.greeting
|
|
--- protos.h.orig 2006-07-12 02:32:28.000000000 +0300
|
|
+++ protos.h 2006-12-14 15:43:09.000000000 +0200
|
|
@@ -509,4 +509,5 @@
|
|
void ci_bounce_message (HEADER *, int *);
|
|
int ci_send_message (int, HEADER *, char *, CONTEXT *, HEADER *);
|
|
|
|
-
|
|
+const char *greeting_string (char *, size_t, char, const char *, const char *,
|
|
+ const char *, const char *, unsigned long, format_flag);
|
|
--- send.c.orig 2006-03-03 12:12:34.000000000 +0200
|
|
+++ send.c 2006-12-14 15:57:36.000000000 +0200
|
|
@@ -395,6 +395,18 @@
|
|
}
|
|
}
|
|
|
|
+void mutt_make_greeting (HEADER *hdr, FILE *out, int flags)
|
|
+{
|
|
+ char buffer[STRING];
|
|
+ if (Greeting)
|
|
+ {
|
|
+ mutt_FormatString(buffer, sizeof(buffer), Greeting, greeting_string,
|
|
+ (unsigned long) hdr, flags);
|
|
+ fputs(buffer, out);
|
|
+ fputc ('\n', out);
|
|
+ }
|
|
+}
|
|
+
|
|
void mutt_make_post_indent (CONTEXT *ctx, HEADER *cur, FILE *out)
|
|
{
|
|
char buffer[STRING];
|
|
@@ -1268,6 +1280,7 @@
|
|
if (option (OPTHDRS))
|
|
process_user_header (msg->env);
|
|
|
|
+ mutt_make_greeting(msg, tempfp, flags);
|
|
|
|
if (option (OPTSIGONTOP) && (! (flags & (SENDMAILX | SENDKEY)) && Editor && mutt_strcmp (Editor, "builtin") != 0))
|
|
append_signature (tempfp);
|