<<< Date Index >>>     <<< Thread Index >>>

patch: signin & signoff feature (1.5.18)



Hi!

Patch to add signin and signoff features is in attach. Use this way:

send-hook .                   'set signoff="\n" signin="Hi!\n\n"'
send-hook friend@xxxxxxxxxx   'set signoff="\n\nBug - it's when computer play 
with us..." signin="Hello, my friend!\n\n"'


P.S. Is there reasons why so useful and trivial patch wasn't added yet
(and won't be added in the future)? I use it for many years.

-- 
                        WBR, Alex.
diff -uNr mutt-1.5.18.orig/globals.h mutt-1.5.18/globals.h
--- mutt-1.5.18.orig/globals.h	2008-01-30 06:26:50.000000000 +0200
+++ mutt-1.5.18/globals.h	2008-10-08 15:38:08.000000000 +0300
@@ -116,7 +116,9 @@
 WHERE char *SendCharset;
 WHERE char *Sendmail;
 WHERE char *Shell;
+WHERE char *Signin;
 WHERE char *Signature;
+WHERE char *Signoff;
 WHERE char *SimpleSearch;
 #if USE_SMTP
 WHERE char *SmtpAuthenticators INITVAL (NULL);
diff -uNr mutt-1.5.18.orig/init.h mutt-1.5.18/init.h
--- mutt-1.5.18.orig/init.h	2008-01-30 06:26:50.000000000 +0200
+++ mutt-1.5.18/init.h	2008-10-08 15:38:08.000000000 +0300
@@ -2591,6 +2591,19 @@
   ** assumed that filename is a shell command and input should be read from
   ** its stdout.
   */
+  { "signin",	DT_STR, R_NONE, UL &Signin, 0},
+  /*
+  ** .pp
+  ** Create a ``signin'' setting.  This will be preprended to ougoing 
+  ** messages right after the header.  Newlines may be included.
+  */
+  { "signoff",  DT_STR, R_NONE, UL &Signoff, 0},
+  /*
+  ** .pp
+  ** Create a ``signoff'' setting.  This will be appended to outgoing
+  ** messages, before the ``-- '' of any signatures.  If there is to
+  ** be a newline before the sigdashes, it must be included here.
+  */
   { "simple_search",	DT_STR,	 R_NONE, UL &SimpleSearch, UL "~f %s | ~s %s" },
   /*
   ** .pp
diff -uNr mutt-1.5.18.orig/send.c mutt-1.5.18/send.c
--- mutt-1.5.18.orig/send.c	2008-01-30 06:26:53.000000000 +0200
+++ mutt-1.5.18/send.c	2008-10-08 15:38:08.000000000 +0300
@@ -1305,6 +1305,8 @@
     if (option (OPTHDRS))
       process_user_header (msg->env);
 
+    if (Signin)
+      fputs(Signin, tempfp);
 
     if (option (OPTSIGONTOP) && (! (flags & (SENDMAILX | SENDKEY)) && Editor && mutt_strcmp (Editor, "builtin") != 0))
       append_signature (tempfp);
@@ -1314,6 +1316,9 @@
 	&& generate_body (tempfp, msg, flags, ctx, cur) == -1)
       goto cleanup;
 
+    if (Signoff)
+      fputs (Signoff, tempfp);
+
     if (!option (OPTSIGONTOP) && (! (flags & (SENDMAILX | SENDKEY)) && Editor && mutt_strcmp (Editor, "builtin") != 0))
       append_signature (tempfp);