Re: [exim] Retry times

Top Page
Delete this message
Reply to this message
Author: Steve Sargent
Date:  
To: exim-users
Subject: Re: [exim] Retry times


Philip Hazel wrote:
> On Wed, 22 Jun 2005, Steve Sargent wrote:
>
>
>>The exim running on our imap server has this retry rule:-
>>
>>
>>imap.qmul.ac.uk        *           F,1h,5m; F,2h,15m; G,16h,2h,1.5; F,4d,8h

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

>>
>>
>>Messages addressed to username@??? get stuck in the queue because
>>the user is over quota, and remain in the queue for 10 days even though the
>>retry rule says 4 days. Does anyone know why?
>
>
> 1. What does
>
> exim -brw username@???
>
> say?



bash$ /usr/local/exim/bin-imap/exim -brt hcw295@???
Retry rule: imap.qmul.ac.uk * F,1h,5m; F,2h,15m; G,16h,2h,1.5; F,4d,8h;



>
> 2. What does
>
> exinext username@???
>
> say?


bash$ exinext hcw295@???
in alias router
in cyrus router
No remote hosts found for hcw295@???
Route: hcw295@??? error 0: SMTP error from remote mailer
after RCPT TO:<hcw295@???>: host localhost.qmul.ac.uk
[127.0.0.1]: 452 4.2.2 Over quota
first failed: 20-Jun-2005 16:04:20
last tried: 23-Jun-2005 13:01:24
next try at: 23-Jun-2005 21:01:24



> 3. What is the debug output from
>
> exim -d -M <an id for a stuck message>
>
> ?



Exim version 4.34 uid=500 gid=500 pid=19077 D=fbb95cfd
Probably ndbm
Support for: iconv()
Lookups: lsearch wildlsearch nwildlsearch iplsearch cdb dbm dbmnz
Authenticators:
Routers: accept dnslookup ipliteral manualroute queryprogram redirect
Transports: appendfile/maildir autoreply lmtp pipe smtp
Fixed never_users: 0
changed uid/gid: forcing real = effective
uid=0 gid=500 pid=19077
auxiliary group list: <none>
configuration file is /usr/local/exim/imap.conf
log selectors = 00000ffc 00013700
trusted user
admin user
skipping ACL configuration - not needed
set_process_info: 19077 delivering specified messages
set_process_info: 19077 delivering 1DkNhR-0000N1-R7
reading spool file 1DkNhR-0000N1-R7-H
user=exim uid=500 gid=500 sender=Waheed.Khan@???
sender_fullhost = mail1.qmul.ac.uk [138.37.6.7]
sender_rcvhost = mail1.qmul.ac.uk ([138.37.6.7])
sender_local=0 ident=unset
Non-recipients:
Empty Tree
---- End of tree ----
recipients_count=1
body_linecount=175 message_linecount=34
Delivery address list:
hcw295@???
locking /var/spool/exim-imap/db/retry.lockfile
locked /var/spool/exim-imap/db/retry.lockfile
opened hints database /var/spool/exim-imap/db/retry: flags=0
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Considering: hcw295@???
unique = hcw295@???
dbfn_read: key=R:imap.qmul.ac.uk
dbfn_read: key=R:hcw295@???
no domain retry record
hcw295@???: queued for routing
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

routing hcw295@???
--------> smart_route router <--------
local_part=hcw295 domain=imap.qmul.ac.uk
checking domains
imap.qmul.ac.uk in "@ : imap.qmw.ac.uk : imap.qmul.ac.uk"? yes (matched "@")
imap.qmul.ac.uk in "! +local_domains"? no (matched "! +local_domains")
smart_route router skipped: domains mismatch
--------> system_aliases router <--------
local_part=hcw295 domain=imap.qmul.ac.uk
in alias router
calling system_aliases router
rda_interpret (string): ${lookup{$local_part}lsearch{/etc/aliases}}
search_open: lsearch "/etc/aliases"
search_find: file="/etc/aliases"
key="hcw295" partial=-1 affix=NULL starflags=0
LRU list:
:/etc/aliases
End
internal_search_find: file="/etc/aliases"
type=lsearch key="hcw295"
file lookup required for hcw295
in /etc/aliases
lookup failed
expanded:
file is not a filter file
parse_forward_list:
system_aliases router declined for hcw295@???
--------> local_user_cyrus router <--------
local_part=hcw295 domain=imap.qmul.ac.uk
in cyrus router
calling local_user_cyrus router
local_user_cyrus router called for hcw295@???
domain = imap.qmul.ac.uk
set transport lmtp_delivery_over_ip
queued for lmtp_delivery_over_ip transport: local_part = hcw295
domain = imap.qmul.ac.uk
errors_to=NULL
domain_data=NULL localpart_data=NULL
routed by local_user_cyrus router
envelope to: hcw295@???
transport: lmtp_delivery_over_ip
added retry item for R:hcw295@???: errno=-1 0 flags=1
added retry item for R:imap.qmul.ac.uk: errno=-1 0 flags=1
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

After routing:
   Local deliveries:
   Remote deliveries:
     hcw295@???
   Failed addresses:
   Deferred addresses:
search_tidyup called

>>>>>>>>>>>>>>>> Remote deliveries >>>>>>>>>>>>>>>>

--------> hcw295@??? <--------
search_tidyup called
changed uid/gid: remote delivery to hcw295@??? with 
transport=lmtp_delivery_over_ip
   uid=500 gid=500 pid=19078
   auxiliary group list: <none>
set_process_info: 19078 delivering 1DkNhR-0000N1-R7 using 
lmtp_delivery_over_ip
*** lmtp over tcp/ip: local part hcw295
lmtp_delivery_over_ip transport entered
   hcw295@???
using the transport's hosts: localhost
getting address for localhost
DNS lookup of localhost (A) succeeded
fully qualified name = localhost.qmul.ac.uk
localhost.qmul.ac.uk 127.0.0.1 mx=-1 sort=-195
checking status of localhost.qmul.ac.uk
locking /var/spool/exim-imap/db/retry.lockfile
locked /var/spool/exim-imap/db/retry.lockfile
opened hints database /var/spool/exim-imap/db/retry: flags=0
dbfn_read: key=T:localhost.qmul.ac.uk:127.0.0.1:24
dbfn_read: key=T:localhost.qmul.ac.uk:127.0.0.1:24:1DkNhR-0000N1-R7
no host retry record
no message retry record
localhost.qmul.ac.uk [127.0.0.1]:24 status = usable
127.0.0.1 in serialize_hosts? no (option unset)
delivering 1DkNhR-0000N1-R7 to localhost.qmul.ac.uk [127.0.0.1] 
(hcw295@???)
set_process_info: 19078 delivering 1DkNhR-0000N1-R7 to 
localhost.qmul.ac.uk [127.0.0.1] (hcw295@???)
set_process_info: 19077 delivering 1DkNhR-0000N1-R7: waiting for a 
remote delivery subprocess to finish
selecting on subprocess pipes
Connecting to localhost.qmul.ac.uk [127.0.0.1]:24 ... connected
read response data: size=38
   SMTP<< 220 upsilon LMTP Cyrus v2.1.11 ready
127.0.0.1 in hosts_avoid_esmtp? no (option unset)
   SMTP>> LHLO imap.qmul.ac.uk
read response data: size=114
   SMTP<< 250-upsilon
          250-8BITMIME
          250-ENHANCEDSTATUSCODES
          250-PIPELINING
          250-SIZE
          250-AUTH EXTERNAL
          250 IGNOREQUOTA
using PIPELINING
127.0.0.1 in hosts_require_auth? no (option unset)
127.0.0.1 in hosts_try_auth? no (option unset)
   SMTP>> MAIL FROM:<Waheed.Khan@???> SIZE=7554
   SMTP>> RCPT TO:<hcw295@???>
   SMTP>> DATA
read response data: size=61
   SMTP<< 250 2.1.0 ok
   SMTP<< 452 4.2.2 Over quota
added retry item for R:hcw295@???: errno=0 65 flags=0
   SMTP<< 503 5.5.1 No recipients
SMTP error from remote mailer after pipelined DATA: host 
localhost.qmul.ac.uk [127.0.0.1]: 503 5.5.1 No recipients
error for DATA ignored: pipelining is in use and there were no good 
recipients
ok=1 send_quit=1 send_rset=1 continue_more=0 yield=0 first_address=0
   SMTP>> QUIT
set_process_info: 19078 delivering 1DkNhR-0000N1-R7: just tried 
localhost.qmul.ac.uk [127.0.0.1] for hcw295@???: result OK
all IP addresses skipped or deferred at least one address
locking /var/spool/exim-imap/db/wait-lmtp_delivery_over_ip.lockfile
locked /var/spool/exim-imap/db/wait-lmtp_delivery_over_ip.lockfile
opened hints database 
/var/spool/exim-imap/db/wait-lmtp_delivery_over_ip: flags=2
Leaving lmtp_delivery_over_ip transport
set_process_info: 19078 delivering 1DkNhR-0000N1-R7 (just run 
lmtp_delivery_over_ip for hcw295@??? in subprocess)
search_tidyup called
reading pipe for subprocess 19078 (not ended)
read() yielded 235
reading retry information for R:hcw295@??? from subprocess
   existing delete item dropped
   added retry item
reading retry information for R:imap.qmul.ac.uk from subprocess
   existing delete item dropped
   added delete item
reading retry information for R:hcw295@??? from subprocess
   delete item not added: non-delete item exists
selecting on subprocess pipes
reading pipe for subprocess 19078 (not ended)
read() yielded 147
Z0 item read
remote delivery process 19078 ended
set_process_info: 19077 delivering 1DkNhR-0000N1-R7
post-process hcw295@??? (1)
LOG: MAIN
   == hcw295@??? R=local_user_cyrus T=lmtp_delivery_over_ip 
defer (0): SMTP error from remote mailer after RCPT 
TO:<hcw295@???>: host localhost.qmul.ac.uk [127.0.0.1]: 452 
4.2.2 Over quota

>>>>>>>>>>>>>>>> deliveries are done >>>>>>>>>>>>>>>>

changed uid/gid: post-delivery tidying
uid=500 gid=500 pid=19077
auxiliary group list: <none>
set_process_info: 19077 tidying up after delivering 1DkNhR-0000N1-R7
Processing retry items
Succeeded addresses:
Failed addresses:
Deferred addresses:
hcw295@???
locking /var/spool/exim-imap/db/retry.lockfile
locked /var/spool/exim-imap/db/retry.lockfile
opened hints database /var/spool/exim-imap/db/retry: flags=2
deleted retry information for R:imap.qmul.ac.uk
address match: subject=hcw295@??? pattern=imap.qmul.ac.uk
imap.qmul.ac.uk in "imap.qmul.ac.uk"? yes (matched "imap.qmul.ac.uk")
hcw295@??? in "imap.qmul.ac.uk"? yes (matched "imap.qmul.ac.uk")
retry for R:hcw295@??? = imap.qmul.ac.uk
dbfn_read: key=R:hcw295@???
Writing retry data for R:hcw295@???
first failed=1119279860 last try=1119535065 next try=1119563865 expired=0
error 0 65: SMTP error from remote mailer after RCPT
TO:<hcw295@???>: host localhost.qmul.ac.uk [127.0.0.1]: 452
4.2.2 Over quota
dbfn_write: key=R:hcw295@???
end of retry processing
time on queue = 2d23h1m12s
warning counts: required 2 done 2
delivery deferred: update_spool=0 header_rewritten=0
end delivery of 1DkNhR-0000N1-R7
search_tidyup called
search_tidyup called
>>>>>>>>>>>>>>>> Exim pid=19077 terminating with rc=0 >>>>>>>>>>>>>>>>




The config file is attached.









> One possible scenario is that messages pile up for this user; she clears
> out her mailbox and one message is delivered, filling it up again. This
> sequence continues. The point is that once one message is successfully
> delivered, the retry clock for the address will be reset.
>
> HOWEVER: There is a rule that no message should stay on the queue for
> longer than the longest retry time for any of its addresses. So what I
> wrote above should be superseded by that rule. The debug output might
> give a clue as to what is happening.
>


--
Steve Sargent, Vox +44 020 7882 3220, Fax +44 020 8980 2001
QMUL Computing Services, Mile End Road, London E1 4NS, UK
Email : S.L.Sargent@???
WWW page: http://www.qmul.ac.uk/~cgaa160/index.html

                                 PIPER       _|_
                                 PA28R  ____/___\___
                                 ___________[=o=]___________
                                 ARROW    e/  o  \e

# exim configuration file for cyrus/imap delivery service
# 1.0.0 10  Jun 2004 (sls) - preliminary for version 4 of exim
# 1.0.2 18  Jun 2004 (sls) - allow users to submit mail via this host temporarily.
# 1.0.3 15  Jul 2004 (sls) - change relay_hosts to have 127.0.0.1 instead of localhost and fix a missing ':'.
# 1.0.4 16  Jul 2004 (sls) - change freeze_tell to postmaster-frozen@qm and turn ident calls off.
# 1.0.5 16  Jul 2004 (sls) - change errors_copy to postmaster-errors@qm.
# 1.0.6 16  Jul 2004 (sls) - move the log and spool files into a sub-directory called imap.
# 1.0.7 16  Jul 2004 (sls) - remove 127.0.0.1 from  local_interfaces (should be in imap.local or standard.local).
# 1.0.8 19  Jul 2004 (sls) - change location of the spool and log directories.
# 1.0.9 28  Jul 2004 (sls) - add 127.0.0.1 to qm_hosts.
# 1.0.10 29 Jul 2004 (sls) - add interface = INTERFACE to the remote_smtp transport.
# 1.0.11 02 Aug 2004 (sls) - remove 138.37.0.0/16 from relay_hosts to stop imap from being used as a submission seervice.
#                          - change the message in the rcpt ACL to relay not permitted
# 1.0.12 06 Oct 2004 (mdte)- use: .include imap.conf directive.
#                          - add: bounce_return_body false
# 1.0.13 07 Dec 2004 (sls) - add mail2-test to the list of allowed sending hosts.


# include local configuration.
.include /usr/local/exim/imap.local

SPOOLDIR = /var/spool/exim-imap
LOGDIR = /var/log/exim-imap


######################################################################
#                  Runtime configuration file for Exim               #
######################################################################



acl_smtp_connect = check_connection
acl_smtp_rcpt = check_recipient
acl_smtp_data = check_message

domainlist local_domains = @ : \
    imap.qmw.ac.uk : \
    imap.qmul.ac.uk


hostlist relay_hosts = 127.0.0.1 : \
    138.37.6.7 : 138.37.6.6 : 138.37.6.9 : 138.37.6.37 : 138.37.6.5 : \
    138.37.6.15 : 138.37.8.140 : 138.37.8.139 : 138.37.6.16


# a list of servers allowed to send to the imap server
# ---------------------------------------------------
# 138.37.6.7    - mail1.qmul.ac.uk
# 138.37.6.6    - mail2.qmul.ac.uk
# 138.37.6.9    - delta.qmul.ac.uk
# 138.37.6.37    - theta.qmw.ac.uk
# 138.37.6.5    - chi.qmul.ac.uk
# 138.37.6.15    - mail1-test.qmul.ac.uk
# 138.37.6.16    - mail2-test.qmul.ac.uk
# 138.37.8.140    - mdte.css.qmul.ac.uk
# 138.37.8.139    - sls.css.qmw.ac.uk




hostlist qm_hosts = 138.37.0.0/16 : 127.0.0.1

log_selector =  \
              +received_sender \
              +received_recipients \
              +smtp_confirmation \
              +sender_on_delivery




######################################################################
#                    MAIN CONFIGURATION SETTINGS                     #
######################################################################




primary_hostname = PRIMARY_HOSTNAME

allow_domain_literals = false

never_users = root

spool_directory = SPOOLDIR
log_file_path = LOGDIR/%s
pid_file_path = LOGDIR/exim.pid


host_lookup = 0.0.0.0/0

# allow cyrus to set the sender for sieve support
trusted_users = cyrus


# SMTP settings
# listen only on service IP number
local_interfaces = INTERFACE



# give the local postmaster a copy of any errors
errors_copy = "*@* postmaster-errors@???"

freeze_tell = postmaster-frozen@???
ignore_bounce_errors_after = 2d
timeout_frozen_after = 7d

# do not return body (as it may contain null chars and get stuck).
bounce_return_body = false

# disable ident calls.
rfc1413_query_timeout = 0s




######################################################################
#                   ACL CONFIGURATION                                #
######################################################################



begin acl

# ACL that is used after the initial smtp connection
check_connection:
  drop    hosts = !+qm_hosts
          message = Private internal use only.
  accept  hosts = +relay_hosts
  drop    message = Please use smtp.qmul.ac.uk for message submission.



# ACL that is used after the RCPT command
check_recipient:
  accept  hosts = :
  accept  domains = +local_domains
  accept  hosts = +relay_hosts
  deny    message = relay not permitted



# ACL that is used after the DATA command
check_message:
accept




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





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




######################################################################
#                      ROUTERS CONFIGURATION                         #
#            Specifies how remote addresses are handled              #
######################################################################


begin routers


# just send everything to the main relays
smart_route:
driver = manualroute
domains = ! +local_domains
route_list = * mailrelay.qmul.ac.uk bydns
transport = remote_smtp
no_more



system_aliases:
driver = redirect
allow_defer
allow_fail
data = ${lookup{$local_part}lsearch{/etc/aliases}}
debug_print = "in alias router"
file_transport = address_file
pipe_transport = address_pipe
retry_use_local_part
# user = exim


# Director for sending local mail via the cyrus transport
local_user_cyrus:
driver = accept
debug_print = "in cyrus router"
retry_use_local_part
transport = lmtp_delivery_over_ip






######################################################################
#                      TRANSPORTS CONFIGURATION                      #
######################################################################


# This transport is used for delivering messages over SMTP connections.
begin transports

remote_smtp:
driver = smtp
interface = INTERFACE


# local delivery to Cyrus using LMTP over TCP/IP
lmtp_delivery_over_ip:
driver = smtp
allow_localhost
debug_print = "*** lmtp over tcp/ip: local part $local_part"
hosts = localhost
port = "lmtp"
protocol = LMTP


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                           #
######################################################################


# Domain               Error       Retries
# ------               -----       -------



begin retry

imap.qmul.ac.uk        *           F,1h,5m; F,2h,15m; G,16h,2h,1.5; F,4d,8h


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



# End of Exim 4 configuration