[exim] (sommige) mail van localhost NIET scannen.. ?

Pagina: 1
Acties:

  • gvdh81
  • Registratie: Juli 2001
  • Laatst online: 22-01 09:01

gvdh81

To got or not to got..

Topicstarter
Hallo,

Hieronder volgt mijn exim config. Ik heb nog geen users die gebruik maken van mijn mailserver. Ik wil graag dat bepaalde afzenders (voornamelijk noreply@...) niet gescanned worden. Hoe kan ik dit in onderstaande config verwerken? Je zou mij er enorm mee helpen.

code:
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
# Begin /etc/exim/exim.conf.
#

# Allow the domains group to use the "from" flag
# See: http://www.exim.org/exim-html-4.50/doc/html/spec_51.html#SECT51.7
# See: http://www.exim.org/eximwiki/FAQ/General_Debugging/Q0056
trusted_groups = domains

# Set primary hostname.
primary_hostname = aardbei.webunity.nl

# Domains we deliver e-mail for.
domainlist local_domains = @ : ${lookup mysql {SELECT domain FROM \
                                domains WHERE domain="${domain}"}}

# Domains we relay e-mail for.
domainlist relay_to_domains = ${lookup mysql {SELECT domain FROM \
                                relays WHERE domain="${domain}"}}

# Hosts we relay e-mail from.
hostlist relay_from_hosts = 127.0.0.1

# Never use root for mail delivery.
never_users = root

# MySQL settings.
# --> REMOVED

# Send all logs to syslog.
log_file_path = syslog

# Accept 20 incoming SMTP connections at once.
smtp_accept_max = 20
smtp_connect_backlog = 20

# Accept 100 messages per SMTP connection.
smtp_accept_max_per_connection = 100

# Accept 150 SMTP calls before queuing messages instantly.
smtp_accept_queue = 150

# Accept 15 messages at once before starting a new queue.
smtp_accept_queue_per_connection = 15

# Resolve all SMTP connections.
host_lookup = *

# Query no SMTP peers on ident.
rfc1413_hosts = 

# Ignore bouncing error messages after 2 days.
ignore_bounce_errors_after = 2d

# Delete frozen messages after 7 days.
timeout_frozen_after = 7d

# Feed all incoming SMTP traffic to ACLs.
acl_smtp_rcpt = acl_check_rcpt

# Start ACL rules.
begin acl
    # Recipient ACLs.
    acl_check_rcpt:
        accept hosts = :
        deny message = Restricted characters in address
            domains = +local_domains
            local_parts = ^[.] : ^.*[@%!/|]
        deny message = Restricted characters in address
            domains = !+local_domains
            local_parts   = ^[./|] : ^.*[@%!] : ^.*/\\.\\./
                deny message = This address no longer accepts mail
            domains = +local_domains
            local_parts = noreply
        deny message = Sender verification failed
            !hosts = 127.0.0.1
            !verify = sender
        accept local_parts = postmaster
            domains = +local_domains
        accept domains = +local_domains
            endpass
            verify = recipient
        accept domains = +relay_to_domains
            endpass
            verify = recipient
        accept hosts = +relay_from_hosts
        accept authenticated = *

        # Deny all other messages.
        deny message = Relay not permitted.

# Start mail routers.
begin routers

    # This router routes addresses that are not in local domains by
    # doing a DNS lookup on the domain name. CHECK ONLY!
    check_dnslookup:
        driver = dnslookup
        domains = ! +local_domains
        ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8
        verify_only
        pass_router = amavis
        no_more
    
    # This router handles aliasing using a linearly searched alias
    # file with the name /etc/mail/aliases. CHECK ONLY!
    check_system_aliases:
        driver = redirect
        allow_fail
        allow_defer
        data = ${lookup{$local_part}lsearch{/etc/mail/aliases}}
        verify_only
        pass_router = amavis
        condition = ${if eq {$domain}{$primary_hostname} \
                     {yes}{no} }
        
    # This router handles aliasing using a MySQL table.
    check_mysql_aliases:
        driver = redirect
        allow_fail
        allow_defer
        data = ${lookup mysql{ SELECT dest FROM aliases \
                WHERE address = '${local_part}@${domain}' }}
        verify_only
        pass_router = amavis

     # This router matches local user mailboxes.
     check_localuser:
        driver = accept
        check_local_user
        verify_only
        pass_router = amavis
        condition = ${if eq {$domain}{$primary_hostname} \
                     {yes}{no} }
    
    # This router matches virtual users.
    check_virtual_user:
        driver = accept
        verify_only
        pass_router = amavis
        condition = ${lookup mysql {SELECT home FROM users \
                      WHERE address = '${local_part}@${domain}'}}

    failed_address_router:
        driver = accept
        verify_only
        fail_verify

    amavis:
        driver = manualroute
        condition = "${if or {{eq {$interface_port}{10025}} \
            {eq {$received_protocol}{spam-scanned}} \
            {eq {$sender_address}{}} \
            }{0}{1}}"
        transport = amavis
        route_list = "* localhost byname"
        self = send
    
    # This router routes addresses that are not in local domains by
    # doing a DNS lookup on the domain name.
    dnslookup:
        driver = dnslookup
        domains = ! +local_domains
        transport = remote_smtp
        ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8
        no_more
    
    # This router handles aliasing using a linearly searched alias
    # file with the name /etc/mail/aliases.
    system_aliases:
        driver = redirect
        allow_fail
        allow_defer
        data = ${lookup{$local_part}lsearch{/etc/mail/aliases}}
        file_transport = address_file
        pipe_transport = address_pipe
        condition = ${if eq {$domain}{$primary_hostname} \
                     {yes}{no} }
    
    # This router handles aliasing using a MySQL table.
    mysql_aliases:
        driver = redirect
        allow_fail
        allow_defer
        data = ${lookup mysql{ SELECT dest FROM aliases \
                WHERE address = '${local_part}@${domain}' }}
    
    # This router handles forwarding using traditional .forward
    # files in users' home directories. 
    userforward:
        driver = redirect
        check_local_user
        file = $home/.forward
        no_verify
        no_expn
        check_ancestor
        file_transport = address_file
        pipe_transport = address_pipe
        reply_transport = address_reply
        condition = ${if eq {$domain}{$primary_hostname} \
                                     {yes}{no} }

     # This router matches local user mailboxes.
     localuser:
        driver = accept
        check_local_user
        transport = local_delivery
        condition = ${if eq {$domain}{$primary_hostname} \
                     {yes}{no} }
    
    # This router matches virtual users.
    virtual_user:
        driver = accept
        condition = ${lookup mysql {SELECT home FROM users \
                      WHERE address = '${local_part}@${domain}'}}
        transport = mysql_delivery

    # Error when no user found.
    cannot_route_message = Unknown user.

# Start mail transports.
begin transports

    # This transport is used for delivering messages over SMTP
    # connections.
    remote_smtp:
        driver = smtp

    amavis:
        driver = smtp
        port = 10024
        allow_localhost

    # This transport is used for local delivery to *REAL* user
    # mailboxes in maildir format. By default it will be run under
    # the uid and gid of the local user.
    local_delivery:
        driver = appendfile
        directory = /home/$local_part/.maildir
        maildir_format
        delivery_date_add
        envelope_to_add
        return_path_add

    # This transport is used for local delivery to *VIRTUAL* user
    # mailboxes in maildir format.
    mysql_delivery:
        driver = appendfile
        directory = ${lookup mysql {SELECT home FROM users \
                     WHERE address = '${local_part}@${domain}'}}
        maildir_format
        delivery_date_add
        envelope_to_add
        return_path_add
        user = $domain
        group = mail
    
    # This transport is used for handling pipe deliveries generated
    # by alias or .forward files. If the pipe generates any standard
    # error, it is returned to the sender of the message as a
    # delivery error.
    address_pipe:
        driver = pipe
        return_fail_output

    # This transport is used for handling deliveries directly to
    # files that are generated by aliasing or forwarding.
    address_file:
        driver = appendfile
        delivery_date_add
        envelope_to_add
        return_path_add

    # This transport is used for handling autoreplies generated by
    # the filtering option of the userforward router.
    address_reply:
        driver = autoreply

# Start mail retry configuration.
begin retry

    # This single retry rule applies to all domains and all errors.
    # It specifies retries every 15 minutes for 2 hours, then
    # increasing retry intervals, starting at 1 hour and increasing
    # each time by a factor of 1.5, up to 16 hours, then retries
    # every 6 hours until 4 days have passed since the first failed
    # delivery.
    * * F,2h,15m; G,16h,1h,1.5; F,4d,6h

# Start mail rewrite configuration.
begin rewrite

    # No rewrite specifications available in this configuration.

# Start mail authentication configuration.
begin authenticators

    # AUTH for RFC compliant software.
    plain:
        driver = plaintext
        public_name = PLAIN
        server_condition = "${if and { {!eq{$2}{}} {!eq{$3}{}} {crypteq{$3}{\\{md5\\}${lookup mysql{SELECT password FROM users WHERE address='${quote_mysql:$2}'}{$value}fail}}}  } {yes}{no}}"
        server_set_id = $2

    # AUTH for non-RFC (aka Micro$oft) software.
    login:
        driver = plaintext
        public_name = LOGIN
        server_prompts = "Username:: : Password::"
        server_condition = "${if and { {!eq{$1}{}} {!eq{$2}{}} {crypteq{$2}{\\{md5\\}${lookup mysql{SELECT password FROM users WHERE address='${quote_mysql:$1}'}{$value}fail}}}  } {yes}{no}}"
        server_set_id = $1

# End /etc/exim/exim.conf.