aboutsummaryrefslogtreecommitdiff
path: root/mc/relay1.mc
blob: c56a7d3f671a8fbf90d00bcef4990487d8e1680f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
dnl * Sendmail configuration for Relay1

divert(-1)

VERSIONID(`$Id$')
OSTYPE(linux)dnl

define(`confCF_VERSION',`Relay1 $Revision$')

# Additional header 
HOrganization: Farlep-Internet
DUsun
Cwsun 

dnl * Include common defaults
include(common.mc)

dnl * Features
FEATURE(use_cw_file)
FEATURE(redirect)
FEATURE(always_add_domain)
FEATURE(access_db, hash -o /etc/mail/access -T<TMPF>)
FEATURE(mailertable, hash -o /etc/mail/xroutes)
FEATURE(domaintable, hash -o /etc/mail/domains)
FEATURE(virtusertable, hash -o /etc/mail/virtusers)
FEATURE(relay_entire_domain)
FEATURE(blacklist_recipients)

dnl * RBL configuration
FEATURE(dnsbl,`dialups.mail-abuse.org',` Mail from dial-up rejected; see http://mail-abuse.org/dul/enduser.htm')
FEATURE(dnsbl, `rbl.farlep.net', ` Stop SPAM from this host')
FEATURE(dnsbl, `dyn-rbl.farlep.net', ` E-Cards are not allowed to use SMTP')

PUSHDIVERT(8)
# Allow all addresses from our dialup pool
R$*			$: $&{client_addr}
R::ffff:$-.$-.$-.$-	$: OKSOFAR
R$-.$-.$-.$-		$: <?> $(host $4.$3.$2.$1.dialup-rev.farlep.net. $: OK $)
R<?>OK			$: OKSOFAR
R<?>$*			$@ OKSOFAR

# Jebem ti dusu
R$*			$: $&{client_addr}
R::ffff:$-.$-.$-.$-	$: OKSOFAR
R213.130.1.225		$@ OKSOFAR

POPDIVERT

FEATURE(dnsbl, `bl.spamcop.net', ` "Spam blocked; see http://spamcop.net/bl.shtml?"$&{client_addr}')

include(`milter.conf')

dnl * *******************************************************
dnl * Defines for local mailer with quota checking
dnl * Current mailbox quota is 5mB
undefine(`LOCAL_MAILER_PATH')
dnl undefine(`_DEF_LOCAL_MAILER_FLAGS')
dnl define(`_DEF_LOCAL_MAILER_FLAGS', `lsDFMA5:/|@q')
dnl define(`LOCAL_MAILER_FLAGS', `SPfhn9')

define(`LOCAL_MAILER_PATH', `/usr/local/libexec/mail.local')
define(`SQL_LOCAL_MAILER_PATH', `/usr/local/libexec/mail.local')
define(`LOCAL_MAILER_ARGS', `mail -q /etc/mail/userquota -S /home/%u/.filter.scm $u')

MAILER(local)

dnl * Other mailers
MAILER(smtp)

dnl * Local configuration
LOCAL_CONFIG
F{Trusted_Hosts}/etc/mail/trusted_hosts
FB/etc/mail/accounts
Kdialup host -T<TEMP>
Kgetpwnam user

Mlocal-sql,	P=/usr/local/libexec/mail.local, F=lsDFMA5:/|@qSPfhn9, S=EnvFromL/HdrFromL, R=EnvToL/HdrToL,
		T=DNS/RFC822/X-Unix,
		A=mail.local -S /var/spool/filter/%u $u


LOCAL_RULESETS

SLocal_check_rcpt
# check address against various regex checks
R$*				$: $>Parse0 $1
R< $* >				$: $1
R$=B @ $m 			$@ $| $>"Local_check_allusers" $1
R$=B @ $=m 			$#error $: "550 Intet slikt bruker"
R$=B @ $=w			$#error $: "550 Intet slikt bruker"

SLocal_check_allusers
# check IP address/sender name
R$*				$: $1:$&{client_addr}:$&f 	
R$={Trusted_Hosts}		$@ OK
R$*				$: ALL:$&{client_addr}:$&f 
R$={Trusted_Hosts}		$@ OK
# anything else is bogus
R$*				$#error $: "550 Ikke tilgjengelig" 

SLocal_localaddr
R$+			$: $1 $| $(getpwnam $1 $: USER $)
R$+ $| USER		$: $>MailerToTriple < local-sql: $1 > $1
R$*			$: $1


Return to:

Send suggestions and report system problems to the System administrator.