File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed
Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # Define exim config
4+ if [ -e " /etc/exim/exim.conf" ]; then
5+ # RHEL or CentOS
6+ conf=" /etc/exim/exim.conf"
7+ else
8+ # Debian or Ubuntu
9+ conf=" /etc/exim4/exim4.conf.template"
10+ fi
11+
12+ # Check existance
13+ if [ ! -e " $conf " ]; then
14+ exit
15+ fi
16+
17+ # Check if fwd_only flag
18+ check_flag=$( grep localuser_fwd_only $conf )
19+ if [ ! -z " $check_flag " ]; then
20+ exit
21+ fi
22+
23+ # Define new router
24+ fwd1=' localuser_fwd_only:\n driver = accept\n transport = devnull\n'
25+ fwd2=' condition = \${if exists{/etc/exim/domains/\$domain/fwd_only}'
26+ fwd3=' {\${lookup{\$local_part}lsearch{/etc/exim/domains/\$domain/fwd_only}'
27+ fwd4=' {true}{false}}}}\n\n'
28+
29+ # Insert router
30+ sed -i " s%localuser_spam:%$fwd1$fwd2$fwd3 ${fwd4} localuser_spam:%" $conf
31+
32+ # Restart mail server
33+ /usr/local/vesta/bin/v-restart-mail
34+
35+ exit
You can’t perform that action at this time.
0 commit comments