1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-06 01:57:40 +00:00

- add flag -quiet

PR:		106602
Submitted by:	Denis Eremenko
This commit is contained in:
Dirk Meyer 2007-02-17 09:09:43 +00:00
parent 1034310476
commit 7d8819ea3d
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=185358
2 changed files with 52 additions and 0 deletions

View File

@ -8,6 +8,7 @@
PORTNAME= milter-regex
PORTVERSION= 1.6
PORTREVISION= 1
CATEGORIES= mail
MASTER_SITES= http://www.benzedrine.cx/

View File

@ -0,0 +1,51 @@
--- milter-regex.8.orig Thu Dec 21 17:15:05 2006
+++ milter-regex.8 Thu Dec 21 17:22:46 2006
@@ -52,6 +52,8 @@
.It Fl d
Don't detach from controlling terminal and produce verbose debug
output on stdout.
+.It Fl q
+Don't send to syslog messages with priority higher than LOG_NOTICE.
.It Fl c Ar config
Use the specified configuration file instead of the default,
/etc/milter-regex.conf.
--- milter-regex.c.orig Thu Dec 21 17:13:26 2006
+++ milter-regex.c Thu Dec 21 17:23:28 2006
@@ -57,6 +57,7 @@
static const char *rule_file_name = "/etc/milter-regex.conf";
static int debug = 0;
+static int quiet = 0;
struct context {
struct ruleset *rs;
@@ -520,6 +521,9 @@
va_list ap;
char msg[8192];
+ if (LOG_PRI(priority) > LOG_INFO && quiet)
+ return;
+
va_start(ap, fmt);
if (context != NULL)
snprintf(msg, sizeof(msg), "%s: ", context->host_addr);
@@ -563,13 +567,16 @@
tzset();
openlog("milter-regex", LOG_PID | LOG_NDELAY, LOG_DAEMON);
- while ((ch = getopt(argc, argv, "c:dp:u:")) != -1) {
+ while ((ch = getopt(argc, argv, "c:dqp:u:")) != -1) {
switch (ch) {
case 'c':
rule_file_name = optarg;
break;
case 'd':
debug = 1;
+ break;
+ case 'q':
+ quiet = 1;
break;
case 'p':
oconn = optarg;