From sheepkiller@cultdeadsheep.org  Wed Nov 26 04:10:24 2003
Return-Path: <sheepkiller@cultdeadsheep.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 088F316A4CE
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 26 Nov 2003 04:10:23 -0800 (PST)
Received: from cultdeadsheep.org (charon.cultdeadsheep.org [80.65.226.72])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 7FB3043FE0
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 26 Nov 2003 04:10:21 -0800 (PST)
	(envelope-from sheepkiller@cultdeadsheep.org)
Received: (qmail 48872 invoked by uid 85); 26 Nov 2003 13:10:20 +0100
Received: from sheepkiller@cultdeadsheep.org by goofy.cultdeadsheep.org by uid 82 with qmail-scanner-1.20rc2 
 ( Clear:RC:1:. 
 Processed in 0.045742 secs); 26 Nov 2003 12:10:20 -0000
Received: from unknown (HELO lucifer.cultdeadsheep.org) (192.168.0.2)
  by goofy.cultdeadsheep.org with SMTP; 26 Nov 2003 13:10:19 +0100
Received: by lucifer.cultdeadsheep.org (sSMTP sendmail emulation); Wed, 26 Nov 2003 13:10:41 +0100
Message-Id: <20031126121021.7FB3043FE0@mx1.FreeBSD.org>
Date: Wed, 26 Nov 2003 13:10:41 +0100
From: "Clement Laforet" <sheepkiller@cultdeadsheep.org>
Reply-To: Clement Laforet <sheepkiller@cultdeadsheep.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc: Clement Laforet <sheepkiller@cultdeadsheep.org>
Subject: [patch] add sSMTP support for Mail selection in sysinstall
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         59708
>Category:       bin
>Synopsis:       sysinstall(8): [patch] add sSMTP support for Mail selection in sysinstall
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-sysinstall
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Nov 26 04:20:19 PST 2003
>Closed-Date:    Sat Feb 19 14:40:15 UTC 2011
>Last-Modified:  Sat Feb 19 14:40:15 UTC 2011
>Originator:     Clement Laforet
>Release:        FreeBSD 5.2-BETA i386
>Organization:
cotds.org
>Environment:
System: FreeBSD lucifer.cultdeadsheep.org 5.2-BETA FreeBSD 5.2-BETA #0: Sat Nov 22 21:09:27 CET 2003 clement@lucifer.cultdeadsheep.org:/usr/obj/usr/src/sys/LUCIFER i386


	
>Description:
	MTA proposed by sysinstall are full features ones, and are not appropriate
	for satellite systems. sSMTP is a small MTA/sendmail emulator which only 
	forwards mails to a mailhub.
	package is small (17kb) and can be added to disc1.

	http://lists.freebsd.org/pipermail/freebsd-qa/2003-September/000127.html
	
>How-To-Repeat:
	N/A.
>Fix:

	

--- sysintall-ssmtp.diff begins here ---
Index: src/usr.sbin/sysinstall/config.c
===================================================================
RCS file: /WORK/REPO/FreeBSD/src/usr.sbin/sysinstall/config.c,v
retrieving revision 1.216
diff -u -r1.216 config.c
--- src/usr.sbin/sysinstall/config.c	28 Sep 2003 05:21:23 -0000	1.216
+++ src/usr.sbin/sysinstall/config.c	26 Nov 2003 11:52:51 -0000
@@ -1263,3 +1263,66 @@
 
     return DITEM_SUCCESS;
 }
+
+int
+configMTASsmtp(dialogMenuItem *self)
+{
+    int ret;
+    FILE *perconf, *mailerconf;
+
+    ret = package_add("ssmtp");
+
+    if(DITEM_STATUS(ret) == DITEM_FAILURE) {
+	msgConfirm("An error occurred while adding the ssmtp package\n"
+		   "Please change installation media and try again.");
+	return ret;
+    }
+
+    variable_set2(VAR_SENDMAIL_ENABLE, "NONE", 1);
+
+    /* Update periodic.conf */
+    perconf = fopen("/etc/periodic.conf", "a");
+    if (perconf == NULL) {
+	/* Not really a serious problem, so we do not abort */
+	msgConfirm("Unable to open /etc/periodic.conf.\n"
+		   "The daily cleanup scripts might generate errors when\n"
+		   "trying to run some sendmail only cleanup scripts.\n");
+    } else {
+	fprintf(perconf, "# --- Generated by sysinstall ---\n");
+	fprintf(perconf, "daily_clean_hoststat_enable=\"NO\"\n");
+	fprintf(perconf, "daily_status_include_submit_mailq=\"NO\"\n");
+	fprintf(perconf, "daily_status_mail_rejects_enable=\"NO\"\n");
+	fprintf(perconf, "daily_submit_queuerun=\"NO\"\n");
+	fclose(perconf);
+    }
+
+    /* Update mailer.conf */
+    vsystem("mv -f /etc/mail/mailer.conf /etc/mail/mailer.conf.old");
+    mailerconf = fopen("/etc/mail/mailer.conf", "w");
+    if (mailerconf == NULL) {
+	/* Not really a serious problem, so we do not abort */
+	msgConfirm("Unable to open /etc/mailer.conf.\n"
+		   "Some programs which use the sendmail wrappers may not work.\n"
+		   "Please consult the documentation for the sSMTP port on how\n"
+		   "to correct this.");
+    } else {
+	fprintf(mailerconf, "# --- Generated by sysinstall ---\n");
+	fprintf(mailerconf, "# Execute sSMTP instead of sendmail\n");
+	fprintf(mailerconf, "#\n");
+	fprintf(mailerconf, "sendmail	/usr/local/sbin/ssmtp\n");
+	fprintf(mailerconf, "send-mail	/usr/local/sbin/ssmtp\n");
+	fprintf(mailerconf, "mailq		/usr/local/sbin/ssmtp\n");
+	fprintf(mailerconf, "newaliases	/usr/local/sbin/ssmtp\n");
+	fprintf(mailerconf, "hoststat	/usr/bin/true\n");
+	fprintf(mailerconf, "purgestat	/usr/bin/true\n");
+	fclose(mailerconf);
+    }
+
+    msgConfirm("sSMTP is now installed and enabled as the default MTA.\n"
+	       "Please check that the configuration works as expected.\n"
+	       "See the ssmtp (8) man page for more information.\n"
+	       "Don't forget to configure /usr/local/etc/ssmtp/ssmtp.conf.\n");
+
+    return DITEM_SUCCESS;
+}
+
Index: src/usr.sbin/sysinstall/menus.c
===================================================================
RCS file: /WORK/REPO/FreeBSD/src/usr.sbin/sysinstall/menus.c,v
retrieving revision 1.382
diff -u -r1.382 menus.c
--- src/usr.sbin/sysinstall/menus.c	24 Nov 2003 15:27:20 -0000	1.382
+++ src/usr.sbin/sysinstall/menus.c	26 Nov 2003 11:52:51 -0000
@@ -1483,8 +1483,9 @@
     "Selecting Sendmail local disables sendmail's network socket for\n"
     "incoming mail, but still enables sendmail for local and outbound mail.\n"
     "The Postfix option will install the Postfix MTA from the ports\n"
-    "collection.  The Exim option will install the Exim MTA from the ports\n"
-    "collection.  To return to the previous menu, select Exit.",
+    "collection. The Exim option will install the Exim MTA from the ports\n"
+    "collection. The Ssmtp option will install the sSMTP MTA from the ports\n"
+	"collection. To return to the previous menu, select Exit.",
     NULL,
     NULL,
     {
@@ -1496,6 +1497,8 @@
       NULL, configMTAPostfix, NULL, NULL },
       { "Exim",               "Use the Exim MTA",
       NULL, configMTAExim, NULL, NULL },
+      { "Ssmtp",               "Use the sSMTP MTA (forwards mails to a mailhub)",
+      NULL, configMTASsmtp, NULL, NULL },
       { "None",               "Do not install an MTA",
         dmenuVarCheck, dmenuSetVariable, NULL, "sendmail_enable=NONE" },
       { "X Exit",             "Exit this menu (returning to previous)",
Index: src/usr.sbin/sysinstall/sysinstall.h
===================================================================
RCS file: /WORK/REPO/FreeBSD/src/usr.sbin/sysinstall/sysinstall.h,v
retrieving revision 1.252
diff -u -r1.252 sysinstall.h
--- src/usr.sbin/sysinstall/sysinstall.h	2 Nov 2003 08:58:57 -0000	1.252
+++ src/usr.sbin/sysinstall/sysinstall.h	26 Nov 2003 11:52:51 -0000
@@ -530,6 +530,7 @@
 extern int	configNFSServer(dialogMenuItem *self);
 extern int	configMTAPostfix(dialogMenuItem *self);
 extern int	configMTAExim(dialogMenuItem *self);
+extern int	configMTASsmtp(dialogMenuItem *self);
 extern int	configRpcBind(dialogMenuItem *self);
 extern int	configWriteRC_conf(dialogMenuItem *self);
 extern int	configSecurityProfile(dialogMenuItem *self);
--- sysintall-ssmtp.diff ends here ---


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-qa 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Sun Oct 23 22:12:54 GMT 2005 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=59708 
Responsible-Changed-From-To: freebsd-bugs->freebsd-sysinstall 
Responsible-Changed-By: gavin 
Responsible-Changed-When: Tue Jul 13 13:49:03 UTC 2010 
Responsible-Changed-Why:  
Over to maintainer(s) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=59708 
State-Changed-From-To: open->closed 
State-Changed-By: brucec 
State-Changed-When: Sat Feb 19 14:39:10 UTC 2011 
State-Changed-Why:  
Sorry, we're not adding any new packages to disc1 any more so this 
option can't be added. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=59708 
>Unformatted:
