Re: [exim] Exim drops mails

Página Principal
Apagar esta mensagem
Responder a esta mensagem
Autor: Peter Kirk
Data:  
Para: Peter Bowyer, exim users
Assunto: Re: [exim] Exim drops mails

On 07/02/2008, Peter Kirk <peterki@???> wrote:
>
> On 07/02/2008, Peter Kirk <peterki@???> wrote:
>
> >> 2008-02-07 12:44:25 [18647] unexpected disconnection while reading
> SMTP
> >> command from (peterkilap) [x.x.x.x]:3564 I=[x.x.x.x]:25 (error:
> >> Operation timed out)
>
> >So the SMTP client at x.x.x.x hung up on the Exim server at x.x.x.x
> >unexpectedly. What is the client? What's it saying about all this?
>
> >Peter
>
> --------------------------------------------------------
>
> Tested sending this mail with an attachment as our server does not

scan
> for spam over a certain size and still the same thing, so not a config
> error by the looks of it.
>
> When I Used wireshark to see what was going on, the mail server "after
> the 100th recipient was received" said expected retransmission and

then
> resets the connection.


The output of your wireshark session might be a useful thing to post,
rather than your translation of it.

>
> Any idea's im pretty much at a dead end and looks like a reboot on the
> weekend to see if I can fix it.


You don't seem to want to answer my requests for more information, so
no, sorry, no more ideas.
--
Peter Bowyer
Email: peter@???

-------------------------------------------------------


Below is the exim config, I will try to redo the wireshark test


MESSAGE_SIZE_LIMIT = 7M

MESSAGE_SIZE_SPAM_MAX = 1M

# Greylising queries
GL_TEST    =     SELECT CASE \
        WHEN now() - block_expires > 0 THEN 2 \
        ELSE 1 \
        END \
        FROM relaytofrom \
        WHERE relay_ip='${quote_pgsql:$sender_host_address}' \
        AND from_domain='${quote_pgsql:$sender_address_domain}'


GL_ADD  =     INSERT INTO relaytofrom (relay_ip, from_domain) \
        VALUES ( '${quote_pgsql:$sender_host_address}', \
        '${quote_pgsql:$sender_address_domain}')


GL_UPDATE = SELECT * FROM $acl_m6('$sender_host_address', \
        '$sender_address_domain')


USE_GLISTING = yes

hostlist = removed

hostlist reserve_hosts = removed
hostlist relay_from_hosts = removed
domainlist relay_to_domains = removed
domainlist local_domains = removed

dns_again_means_nonexist = !+local_domains : !+relay_to_domains

smtp_accept_max = 0
smtp_load_reserve = 15
smtp_reserve_hosts = +reserve_hosts

smtp_accept_max_per_connection = 998
smtp_accept_queue_per_connection = 51

pipelining_advertise_hosts = :

primary_hostname = removed

acl_smtp_connect = acl_check_connect
acl_smtp_helo    = acl_check_helo
acl_smtp_mail    = acl_check_mail_from
acl_smtp_rcpt      = acl_check_rcpt
acl_smtp_data      = acl_check_data


av_scanner = clamd:/var/run/clamav/clamd
spamd_address = 127.0.0.1 783
hide pgsql_servers = (/tmp/.s.PGSQL.5432)/exim/exim/exim

exim_user = mailnull
exim_group = mail
never_users = root

system_filter = /usr/local/etc/exim/system.filter
system_filter_user = mailnull
system_filter_group = mail

host_lookup = !+relay_from_hosts

rfc1413_hosts = !+relay_from_hosts
rfc1413_query_timeout = 5s
ignore_bounce_errors_after = 2d
timeout_frozen_after = 7d

######################################################################
#                       ACL CONFIGURATION                            #
#         Specifies access control lists for incoming SMTP mail      #
######################################################################


begin acl

acl_check_connect:

  warn
    set acl_m2  = $tod_epoch


  accept
    hosts       = : +relay_from_hosts


  warn
    !hosts      = ${if exists {/usr/local/etc/mail/whitelist-hosts} \
                              {/usr/local/etc/mail/whitelist-hosts}}
    dnslists    = list.dsbl.org : \
                  dnsbl.njabl.org : \
                  bl.spamcop.net : \
                  dsn.rfc-ignorant.org : \
                  dnsbl.sorbs.net : \
                  sbl-xbl.spamhaus.org : \
                  l1.spews.dnsbl.sorbs.net
    set acl_c1  = X-DNSbl-Warning: \
                  $sender_host_address is listed in $dnslist_domain\
                  ${if def:dnslist_text { ($dnslist_text)}}


  warn
    condition   = ${if !def:acl_c1 {true}{false}}
    !verify     = reverse_host_lookup
    set acl_m9  = Reverse DNS lookup failed for host
$sender_host_address
    set acl_c1  = X-DNS-Warning: $acl_m9


  accept
    set acl_m2  = ${if def:acl_c1 {${eval:20 + $acl_m2 -
$tod_epoch}}{0}}
    delay       = ${if >{$acl_m2}{0}{$acl_m2}{0}}s


acl_check_helo:

  warn
    set acl_m2  = $tod_epoch


  accept
    hosts       = : +relay_from_hosts


  warn
    condition   = ${if isip {$sender_helo_name}{true}{false}}
    set acl_c0  = Message was delivered by ratware
    set acl_c1  = remote host used IP address in HELO/EHLO greeting


  warn
    condition   = ${if match_domain{$sender_helo_name}\


{$primary_hostname:+local_domains:+relay_to_domains}\
                       {true}{false}}
    set acl_c0  = Message was delivered by ratware
    set acl_c1  = remote host used our name in HELO/EHLO greeting.


  warn
    condition   = ${if !def:acl_c1 {true}{false}}
    !verify     = helo
    set acl_c1  = X-HELO-Warning: Remote host $sender_host_address \
                  ${if def:sender_host_name {($sender_host_name) }}\
                  incorrectly presented itself as $sender_helo_name
    log_message = remote host presented unverifiable HELO/EHLO greeting.


  accept
    set acl_m2  = ${if def:acl_c1 {${eval:20 + $acl_m2 -
$tod_epoch}}{0}}
    delay       = ${if >{$acl_m2}{0}{$acl_m2}{0}}s


acl_check_mail_from:

  warn
    set acl_m2  = $tod_epoch


  accept
    hosts     = : +relay_from_hosts


  accept
    authenticated = *


  warn
    set acl_m0  = $acl_c0
    set acl_m1  = $acl_c1
    message     = $acl_c1


  accept
    set acl_m9     = /usr/local/etc/mail/whitelist-senders
    senders    = ${if exists {$acl_m9}{$acl_m9}}
    set acl_m0    = 
    set acl_m1    = 
    set acl_m9     =


  warn
    set acl_m9    = ${if exists {/usr/local/etc/mail/blacklist-senders} \
                              {/usr/local/etc/mail/blacklist-senders}}
    senders    = ${if exists {$acl_m9}{$acl_m9}}
    set acl_m0  = Delivery not permitted from your address
    set acl_m1     = Sender blacklisted <$sender_address>
    set acl_m9  =


  warn
    condition   = ${if def:sender_helo_name {0}{1}}
    set acl_m0  = Message was delivered by ratware
    set acl_m1  = remote host did not present HELO/EHLO greeting.


  warn
    condition   = ${if !def:acl_m1 {true}{false}}
    !verify     = sender
    set acl_m1  = Invalid sender <$sender_address>
    message     = X-Sender-Verify-Failed: $acl_m1
    log_message = $acl_m1


  warn
    condition    = ${if !def:acl_m0 {true}{false}}
    sender_domains = +relay_to_domains
    set acl_m0  = Message was delivered by ratware
    set acl_m1  = Invalid use of sender address ($sender_address) from
host ($sender_host_address)


  accept
    set acl_m2  = ${if def:acl_c1 {${eval:20 + $acl_m2 -
$tod_epoch}}{0}}
    delay       = ${if >{$acl_m2}{0}{$acl_m2}{0}}s


acl_check_rcpt:

  accept
    hosts       = : +relay_from_hosts


  accept
    authenticated     = *


  accept
    set acl_m9  = /usr/local/etc/mail/whitelist-hosts
    hosts       = ${if exists {$acl_m9}{$acl_m9}}
    set acl_m0  = accept
    set acl_m1  = 
    set acl_m9  = 


  deny
    local_parts = ^.*[@%!/|] : ^\\.


  deny
    message     = $acl_m0
    log_message = $acl_m1
    condition   = ${if and {{def:acl_m0}{def:acl_m1}} {true}}
    delay       = 20s


  deny
    message     = relay not permitted
    !domains    = +local_domains : +relay_to_domains
    delay       = 20s


  deny
    message     = unknown user
    !verify     = recipient/callout=20s,defer_ok,use_sender,no_cache
    delay       = ${if def:sender_address {5m}{0s}}


  drop
    message      = Legitimate bounces are never sent to more than one \
                   recipient.
    senders      = : postmaster@*
    condition    = $recipients_count
    delay        = 5m


# GREYLISTING #

.ifdef USE_GLISTING

  warn    
    condition    = ${if eq{$acl_m1}{}{false}{true}}
    set acl_m7    = ${lookup pgsql{GL_TEST}{$value}{0}}


  defer   
    message = Greylisted  - please try again a little later
    log_message = Greylisted for the following reason: $acl_m1
    condition    = ${if eq{$acl_m7}{0}{1}}
    condition    = ${lookup pgsql{GL_ADD}{yes}{no}}


  defer   
    condition   = ${if eq{$acl_m7}{1}{1}}
    set acl_m6    = graylist_exp_upd
    set acl_m7  = ${lookup pgsql{GL_UPDATE}{1}{1}}


  warn
    condition    = ${if eq{$acl_m7}{2}{1}}
    set acl_m6    = graylist_upd
    set acl_m7    = ${lookup pgsql{GL_UPDATE}{2}{2}}
    logwrite    = Updating expiration record for relay
($sender_host_address) and relaying for domain ($sender_address_domain)


.endif

accept

acl_check_data:

   warn
    logwrite    = Subject: $h_Subject:


  warn
    condition   = ${if !def:h_Message-ID: {1}}
    hosts       = +relay_from_hosts
    message     = Message-ID: <E$message_id@$primary_hostname>


  accept
    hosts       = : +relay_from_hosts


  accept
    authenticated = *


  accept
    set acl_m9  = /usr/local/etc/mail/whitelist-senders
    senders     = ${if exists {$acl_m9}{$acl_m9}}
    set acl_m0  =
    set acl_m1  =
    set acl_m9  =


    accept
     set acl_m9  = /usr/local/etc/mail/whitelist-domains
     sender_domains     = ${if exists {$acl_m9}{$acl_m9}}
     set acl_m0  =
     set acl_m1  =
     set acl_m9  =


  deny
    message     = $acl_m0
    log_message = $acl_m1
    condition   = ${if and {{def:acl_m0}{def:acl_m1}} {true}{false}}
    delay       = 20s


   deny
    message     = Message size $message_size is larger than limit of \
                  MESSAGE_SIZE_LIMIT
    condition   = ${if >{$message_size}{MESSAGE_SIZE_LIMIT}{yes}{no}}


  warn
    message     = X-Sender-Verify-Failed: No valid sender in message
header
    log_message = No valid sender in message header
    !verify     = header_sender


  deny
    message     = Serious MIME defect detected ($demime_reason)
    demime      = *
    condition   = ${if >{$demime_errorlevel}{2}{1}{0}}


  accept
    condition   = ${if >{$message_size}{MESSAGE_SIZE_SPAM_MAX} {true}}
    logwrite    = :main: Not classified \
                  (message size larger than MESSAGE_SIZE_SPAM_MAX)


  deny
    message  = This message contains a virus ($malware_name)
    demime   = *
    malware  = */defer_ok


  warn
    set acl_m9  = ham
    set acl_m8  = NO
    spam        = mail
    set acl_m9  = spam
    set acl_m8  = YES
    condition   = ${if !eq {$acl_m0}{accept}{true}}
    condition   = ${if <{$spam_score_int}{100}{1}{0}}
    control     = fakereject
    logwrite    = :reject: Fakerejected spam (score $spam_score):
$spam_report


  deny
   spam         = mail
   condition    = ${if eq {$acl_m9}{spam}{true}}
   condition    = ${if >{$spam_score_int}{99}{1}{0}}
   message      = Rejected: This message is rated as spam
   logwrite    = :reject: Rejected spam (score $spam_score):
$spam_report


  warn
    message    = X-New-Subject: *SPAM* $rh_subject:
    spam    = mail


   warn
    spam    = mail:true
    set acl_m3    = $spam_score ($spam_bar)
    set acl_m4    = $spam_report
    logwrite    = :main: Classified as $acl_m9 (score $spam_score)


accept


######################################################################
#                      ROUTERS CONFIGURATION                         #
#               Specifies how addresses are handled                  #
######################################################################
#     THE ORDER IN WHICH THE ROUTERS ARE DEFINED IS IMPORTANT!       #
# An address is passed to each router in turn until it is accepted.  #
######################################################################


begin routers

virtual_aliases:
  driver = redirect
  allow_defer
  allow_fail
  data = ${if exists{/usr/local/etc/exim/DB/virtual-aliases/$domain.db}\
                          {${lookup{$local_part}\


dbm{/usr/local/etc/exim/DB/virtual-aliases/$domain.db}\
                          }}\
                  }
  domains = "dbm;/usr/local/etc/exim/DB/config.db"
  more
  qualify_preserve_domain
  retry_use_local_part


virtual_postmaster:
  driver = redirect
  allow_defer
  allow_fail
  data = "${if eq{${lc:$local_part}}{}\
                    {${extract{contact}{${lookup{$domain}\
                        dbm{/usr/local/etc/exim/DB/config.db}}}\
                        {$value}\
                        fail\
                    }}\
        fail}"
  domains = "dbm;/usr/local/etc/exim/DB/config.db"
  local_part_prefix = "postmaster"
  more
  retry_use_local_part


virtual_fallback:
  driver = redirect
  allow_defer
  allow_fail
  data = "${expand:${extract{fallback}\
                          {${lookup{$domain}\
                                  dbm{/usr/local/etc/exim/DB/config.db}\
                                }}{$value}}\
                        }"
  domains = dbm;/usr/local/etc/exim/DB/config.db
  no_more
  retry_use_local_part


dnslookup:
driver = dnslookup
domains = ! +local_domains
transport = remote_smtp
ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8
no_more

system_aliases:
driver = redirect
allow_fail
allow_defer
data = ${lookup{$local_part}lsearch{/etc/aliases}}
user = mailnull
group = mail
file_transport = address_file
pipe_transport = address_pipe



userforward:
driver = redirect
check_local_user
# local_part_suffix = +* : -*
# local_part_suffix_optional
file = $home/.forward
# allow_filter
no_verify
no_expn
check_ancestor
file_transport = address_file
pipe_transport = address_pipe
reply_transport = address_reply
condition = ${if exists{$home/.forward} {yes} {no} }

localuser:
driver = accept
check_local_user
# local_part_suffix = +* : -*
# local_part_suffix_optional
transport = local_delivery
cannot_route_message = Unknown user



######################################################################
#                      TRANSPORTS CONFIGURATION                      #
######################################################################
#                       ORDER DOES NOT MATTER                        #
#     Only one appropriate transport is called for each delivery.    #
######################################################################


begin transports

remote_smtp:
driver = smtp
delay_after_cutoff = false

local_delivery:
driver = appendfile
file = /var/mail/$local_part
delivery_date_add
envelope_to_add
return_path_add
group = mail
user = $local_part
mode = 0660
no_mode_fail_narrower

address_pipe:
driver = pipe
return_output

address_file:
driver = appendfile
delivery_date_add
envelope_to_add
return_path_add

address_reply:
driver = autoreply



######################################################################
#                      RETRY CONFIGURATION                           #
######################################################################


begin retry

# Address or Domain    Error       Retries
# -----------------    -----       -------


*                      *           F,2h,15m; G,16h,1h,1.5; F,4d,6h




######################################################################
#                      REWRITE CONFIGURATION                         #
######################################################################


begin rewrite

######################################################################
#                   AUTHENTICATION CONFIGURATION                     #
######################################################################


begin authenticators
--
## List details at http://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/