# Nginx imap mail timeout

**URL:** <https://www.ruby-forum.com/t/nginx-imap-mail-timeout/191534>\
**Category:** NGINX\
**Created:** [July 14, 2010, 1:47am UTC](https://www.ruby-forum.com/t/nginx-imap-mail-timeout/191534 "2010-07-14T01:47:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![vsc](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/4491bb/32.png) [@vsc](https://www.ruby-forum.com/u/vsc)\
**Post date:** [July 14, 2010, 1:47am UTC](https://www.ruby-forum.com/t/nginx-imap-mail-timeout/191534/1 "2010-07-14T01:47:53Z")

</div>

Hi

I have a nginx server configured to handle imap mail traffic. i want to  
enforce the following

1. if downstream email client does not send a command for more than 2  
mins, the nginx proxy should disconnect.

2. if upstream server (real mail server) does not respond for more than  
5 mins or takes longer than 5 mins to respond, disconnect both upstream  
and downstream connections.

Does anyone have any ideas on doing this on nginx?

in ngx\_mail\_proxy\_module.c i see

```
{ ngx_string("proxy_timeout"),
  NGX_MAIL_MAIN_CONF|NGX_MAIL_SRV_CONF|NGX_CONF_TAKE1,
  ngx_conf_set_msec_slot,
  NGX_MAIL_SRV_CONF_OFFSET,
  offsetof(ngx_mail_proxy_conf_t, timeout),
  NULL },

```

and in ngx\_mail\_core\_module.c

```
{ ngx_string("timeout"),
  NGX_MAIL_MAIN_CONF|NGX_MAIL_SRV_CONF|NGX_CONF_TAKE1,
  ngx_conf_set_msec_slot,
  NGX_MAIL_SRV_CONF_OFFSET,
  offsetof(ngx_mail_core_srv_conf_t, timeout),
  NULL },

```

does anyone have any experience dealing with these or have any  
suggestions?

thanks!
