# NGINX SMTP Proxy

**URL:** <https://www.ruby-forum.com/t/nginx-smtp-proxy/213121>\
**Category:** NGINX\
**Created:** [October 24, 2011, 2:02pm UTC](https://www.ruby-forum.com/t/nginx-smtp-proxy/213121 "2011-10-24T14:02:38Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [October 24, 2011, 2:02pm UTC](https://www.ruby-forum.com/t/nginx-smtp-proxy/213121/1 "2011-10-24T14:02:38Z")

</div>

Hi,

i already googled, but unfortanly i wasnt able to find a example for  
nginx smtp proxy configuration. i wanted to setup as a simple smtp proxy  
in front of a sendmail daemon.

thanks!

Juergen

---

<div class="post-metadata">

**Author:** ![gromminger](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/a4c791/32.png) [@gromminger](https://www.ruby-forum.com/u/gromminger)\
**Post date:** [October 24, 2011, 3:03pm UTC](https://www.ruby-forum.com/t/nginx-smtp-proxy/213121/2 "2011-10-24T15:03:17Z")

</div>

Hi,

You can check this one  
[http://wiki.nginx.org/MailCoreModule](http://wiki.nginx.org/MailCoreModule)

and probably (albeit, only through a translation 🙂  
[http://citrin.ru/nginx:ngx\_mail\_core\_module](http://citrin.ru/nginx:ngx_mail_core_module)

We’ll shortly be adding an updated version on [nginx documentation](http://nginx.org/en/docs/)  
too.

Also, do you need smtp proxy with or w/o authorization? What’s the  
scenario of use?

---

<div class="post-metadata">

**Author:** ![gromminger](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/a4c791/32.png) [@gromminger](https://www.ruby-forum.com/u/gromminger)\
**Post date:** [October 24, 2011, 3:15pm UTC](https://www.ruby-forum.com/t/nginx-smtp-proxy/213121/3 "2011-10-24T15:15:40Z")

</div>

Am 24.10.11 15:02, schrieb Andrew A.:

> Also, do you need smtp proxy with or w/o authorization? What’s the scenario of  
> use?
> 
> > 
> 
> [mailman.nginx.org archive](http://mailman.nginx.org/mailman/listinfo/nginx)

Hi Andrew,

thanks! the 2nd link looks good.

we just need to protect the real smtp server from the bad bad internet  
🙂 no smtp auth at all.

cheers,

juergen

---

<div class="post-metadata">

**Author:** ![gromminger](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/a4c791/32.png) [@gromminger](https://www.ruby-forum.com/u/gromminger)\
**Post date:** [October 24, 2011, 4:10pm UTC](https://www.ruby-forum.com/t/nginx-smtp-proxy/213121/4 "2011-10-24T16:10:47Z")

</div>

On Monday 24 of October 2011 14:02:15 Juergen G. wrote:

> Hi,
> 
> i already googled, but unfortanly i wasnt able to find a example for  
> nginx smtp proxy configuration. i wanted to setup as a simple smtp proxy  
> in front of a sendmail daemon.

This one works for me:

mail {

auth\_http localhost:9090/cgi-bin/auth;  
server {  
listen [a:b:c::d]:25;

```
# this is SMTP proxy!
protocol smtp;
smtp_capabilities "PIPELINING" "SIZE 10240000" "VRFY" "ETRN" 

```

“ENHANCEDSTATUSCODES” “8BITMIME” “DSN”;

```
server_name maili2.prod.interseek.com;

proxy on;
proxy_timeout 30;
proxy_pass_error_message on;

# only if upstream supports XCLIENT
xclient on;

smtp_auth none;
so_keepalive on;

```

}  
}

Brane

---

<div class="post-metadata">

**Author:** ![gromminger](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/a4c791/32.png) [@gromminger](https://www.ruby-forum.com/u/gromminger)\
**Post date:** [October 25, 2011, 12:15am UTC](https://www.ruby-forum.com/t/nginx-smtp-proxy/213121/5 "2011-10-25T00:15:34Z")

</div>

On Monday 24 of October 2011 16:16:19 Maxim D. wrote:

> > ```
> > smtp_capabilities "PIPELINING" "SIZE 10240000" "VRFY" "ETRN"
> > "ENHANCEDSTATUSCODES" "8BITMIME" "DSN";
> > 
> > ```
> 
> The “PIPELINING” here may be problematic, as out of the box nginx  
> _doesn’t_ support SMTP pipelining.

Thanks _alot_ for this clarification!

Brane

---

<div class="post-metadata">

**Author:** ![gromminger](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/a4c791/32.png) [@gromminger](https://www.ruby-forum.com/u/gromminger)\
**Post date:** [October 24, 2011, 4:16pm UTC](https://www.ruby-forum.com/t/nginx-smtp-proxy/213121/6 "2011-10-24T16:16:59Z")

</div>

Hello!

On Mon, Oct 24, 2011 at 03:58:33PM +0200, Brane F. Gračnar wrote:

> mail {
> 
> auth\_http localhost:9090/cgi-bin/auth;  
> server {  
> listen [a:b:c::d]:25;
> 
> ```
> # this is SMTP proxy!
> protocol smtp;
> smtp_capabilities "PIPELINING" "SIZE 10240000" "VRFY" "ETRN" 
> 
> ```

“ENHANCEDSTATUSCODES” “8BITMIME” “DSN”;

The “PIPELINING” here may be problematic, as out of the box nginx  
_doesn’t_ support SMTP pipelining.

Maxim D.
