[SCM] GNU Mailutils branch, master, updated. rel-2_1-38-g9d39221

"Sergey Poznyakoff" <[email protected]>
Newsgroups gmane.comp.gnu.mailutils.cvs
Message-ID <[email protected]>
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Mailutils".

http://git.savannah.gnu.org/cgit/mailutils.git/commit/?id=9d392215f9a067fd1951b2d727371fd2f682036a

The branch, master has been updated
       via  9d392215f9a067fd1951b2d727371fd2f682036a (commit)
      from  bb3a903e6c9e590ba8397219255d399c99621042 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 9d392215f9a067fd1951b2d727371fd2f682036a
Author: Sergey Poznyakoff <[email protected]>
Date:   Wed Feb 17 23:35:55 2010 +0200

    Minor fix
    
    * mail/send.c (mail_send0): Pipe message to the program if
    the value of sendmail variable begins with a slash.
    Otherwise, issue meaningful error messages if the mailer cannot
    be created or opened.

-----------------------------------------------------------------------

Summary of changes:
 mail/send.c |   46 ++++++++++++++++++++++++++++------------------
 1 files changed, 28 insertions(+), 18 deletions(-)

diff --git a/mail/send.c b/mail/send.c
index 7ebdaaa..6538a49 100644
--- a/mail/send.c
+++ b/mail/send.c
@@ -594,30 +594,40 @@ mail_send0 (compose_env_t * env, int save_to)
 		  || compose_header_get (env, MU_HEADER_BCC, NULL))
 		{
 		  char *sendmail;
-		  if (mailvar_get (&sendmail, "sendmail", mailvar_type_string, 0) 
-                       == 0)
+		  if (mailvar_get (&sendmail, "sendmail",
+				   mailvar_type_string, 0) == 0)
 		    {
-		      int status = mu_mailer_create (&mailer, sendmail);
-		      if (status == 0)
+		      if (sendmail[0] == '/')
+			msg_to_pipe (sendmail, msg);
+		      else
 			{
-			  if (mailvar_get (NULL, "verbose", mailvar_type_boolean, 0)
-			      == 0)
-			    {
-			      mu_debug_t debug = NULL;
-			      mu_mailer_get_debug (mailer, &debug);
-			      mu_debug_set_level (debug,
-				         MU_DEBUG_LEVEL_UPTO (MU_DEBUG_PROT));
-			    }
-			  status = mu_mailer_open (mailer, MU_STREAM_RDWR);
+			  int status = mu_mailer_create (&mailer, sendmail);
 			  if (status == 0)
 			    {
-			      mu_mailer_send_message (mailer, msg, NULL, NULL);
-			      mu_mailer_close (mailer);
+			      if (mailvar_get (NULL, "verbose",
+					       mailvar_type_boolean, 0) == 0)
+				{
+				  mu_debug_t debug = NULL;
+				  mu_mailer_get_debug (mailer, &debug);
+				  mu_debug_set_level (debug,
+						      MU_DEBUG_LEVEL_UPTO (MU_DEBUG_PROT));
+				}
+			      status = mu_mailer_open (mailer, MU_STREAM_RDWR);
+			      if (status == 0)
+				{
+				  mu_mailer_send_message (mailer, msg,
+							  NULL, NULL);
+				  mu_mailer_close (mailer);
+				}
+			      else
+				util_error (_("Cannot open mailer: %s"),
+					    mu_strerror (status));
+			      mu_mailer_destroy (&mailer);
 			    }
-			  mu_mailer_destroy (&mailer);
+			  else
+			    util_error (_("Cannot create mailer: %s"),
+					mu_strerror (status));
 			}
-		      if (status != 0)
-			msg_to_pipe (sendmail, msg);
 		    }
 		  else
 		    util_error (_("Variable sendmail not set: no mailer"));


hooks/post-receive
-- 
GNU Mailutils
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.