# A patch for using postfix as smtp-backend with xclient extension

**URL:** <https://www.ruby-forum.com/t/a-patch-for-using-postfix-as-smtp-backend-with-xclient-extension/132697>\
**Category:** NGINX\
**Created:** [March 23, 2008, 6:15pm UTC](https://www.ruby-forum.com/t/a-patch-for-using-postfix-as-smtp-backend-with-xclient-extension/132697 "2008-03-23T18:15:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yingbo\_Qiu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/94ad74/32.png) [@Yingbo\_Qiu](https://www.ruby-forum.com/u/Yingbo_Qiu)\
**Post date:** [March 23, 2008, 6:15pm UTC](https://www.ruby-forum.com/t/a-patch-for-using-postfix-as-smtp-backend-with-xclient-extension/132697/1 "2008-03-23T18:15:01Z")

</div>

Hi, Igor

The XCLIENT command that nginx send to backend include  
“LOGIN=foobar” attribute. But postfix couldn’t recognise it and report  
“501 5.5.4 Bad XCLIENT attribute name: LOGIN” and close connection. I  
wrote this patch to resolve the issue.

The patch add a new nginx.conf item “xclient\_capabilities”. Postfix  
user could custom it to avoid send LOGIN attribute. It make nginx more  
flexible.

I wish it accord with nginx’s coding style. 🙂

Regards.

---

<div class="post-metadata">

**Author:** ![Yingbo\_Qiu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/94ad74/32.png) [@Yingbo\_Qiu](https://www.ruby-forum.com/u/Yingbo_Qiu)\
**Post date:** [March 23, 2008, 7:29pm UTC](https://www.ruby-forum.com/t/a-patch-for-using-postfix-as-smtp-backend-with-xclient-extension/132697/2 "2008-03-23T19:29:55Z")

</div>

Hello!

On Mon, Mar 24, 2008 at 01:02:18AM +0800, Yingbo Qiu wrote:

> The XCLIENT command that nginx send to backend include  
> “LOGIN=foobar” attribute. But postfix couldn’t recognise it and report  
> “501 5.5.4 Bad XCLIENT attribute name: LOGIN” and close connection. I  
> wrote this patch to resolve the issue.

Yes, xclient in nginx was designed to be used with postfix  
extended to support LOGIN= in xclient. Patching postfix to support  
this is trivial.

> The patch add a new nginx.conf item “xclient\_capabilities”. Postfix  
> user could custom it to avoid send LOGIN attribute. It make nginx more  
> flexible.

Your patch introduces additional cycle and a bunch of unneded  
strcmp()'s in main execution path so I don’t think it will be  
accepted. At least it should be converted to do all strcmp()'s at  
configuration phase.

But actually I think using much more simple solution with e.g.

```
 xclient <on|off|compat>;

```

will do.

Anyway, thank you for your work.

Maxim D.
