View | Details | Raw Unified | Return to bug 224924 | Differences between
and this patch

Collapse All | Expand All

(-)/etc/periodic/daily/460.status-mail-rejects (-9 / +16 lines)
Lines 11-16 then Link Here
11
    source_periodic_confs
11
    source_periodic_confs
12
fi
12
fi
13
13
14
security_daily_compat_var security_status_logdir
15
16
LOG="${security_status_logdir}"
17
14
case "$daily_status_mail_rejects_shorten" in
18
case "$daily_status_mail_rejects_shorten" in
15
[Yy][Ee][Ss])	shorten='cut -d" " -f2,3';;
19
[Yy][Ee][Ss])	shorten='cut -d" " -f2,3';;
16
*)		shorten=cat;;
20
*)		shorten=cat;;
Lines 23-32 case "$daily_status_mail_rejects_enable" Link Here
23
	    echo '$daily_status_mail_rejects_enable is set but /etc/mail' \
27
	    echo '$daily_status_mail_rejects_enable is set but /etc/mail' \
24
		"doesn't exist"
28
		"doesn't exist"
25
	    rc=2
29
	    rc=2
26
	elif [ ! -f /var/log/maillog ]
30
	elif [ ! -f ${LOG}/maillog ]
27
	then
31
	then
28
	    echo '$daily_status_mail_rejects_enable is set but ' \
32
	    echo '$daily_status_mail_rejects_enable is set but ' \
29
		"/var/log/maillog doesn't exist"
33
		${LOG}"/maillog doesn't exist"
30
	    rc=2
34
	    rc=2
31
	elif [ "$daily_status_mail_rejects_logs" -le 0 ]
35
	elif [ "$daily_status_mail_rejects_logs" -le 0 ]
32
	then
36
	then
Lines 43-61 case "$daily_status_mail_rejects_enable" Link Here
43
	    rc=$({
47
	    rc=$({
44
		while [ $n -ge 0 ]
48
		while [ $n -ge 0 ]
45
		do
49
		do
46
		    if [ -f /var/log/maillog.$n ]
50
		    if [ -f ${LOG}/maillog.$n ]
47
		    then
51
		    then
48
			cat /var/log/maillog.$n
52
			cat ${LOG}/maillog.$n
49
		    elif [ -f /var/log/maillog.$n.gz ]
53
		    elif [ -f ${LOG}/maillog.$n.gz ]
50
		    then
54
		    then
51
			zcat -fc /var/log/maillog.$n.gz
55
			zcat -fc ${LOG}/maillog.$n.gz
52
		    elif [ -f /var/log/maillog.$n.bz2 ]
56
		    elif [ -f ${LOG}/maillog.$n.bz2 ]
53
		    then
57
		    then
54
			bzcat -fc /var/log/maillog.$n.bz2
58
			bzcat -fc ${LOG}/maillog.$n.bz2
59
		    elif [ -f ${LOG}/maillog.$n.xz ]
60
		    then
61
			xzcat -fc ${LOG}/maillog.$n.xz
55
		    fi
62
		    fi
56
		    n=$(($n - 1))
63
		    n=$(($n - 1))
57
		done
64
		done
58
		cat /var/log/maillog
65
		cat ${LOG}/maillog
59
	    } | sed -Ene "/^$today/q" -e "/^$yesterday/{"'
66
	    } | sed -Ene "/^$today/q" -e "/^$yesterday/{"'
60
		    s/.*ruleset=check_relay,.* relay=([^,]+), reject=([^ ]*).*/\2 check_relay \1/p
67
		    s/.*ruleset=check_relay,.* relay=([^,]+), reject=([^ ]*).*/\2 check_relay \1/p
61
		    t end
68
		    t end

Return to bug 224924