We are using nginx behind an ELB with PROXY protocol enabled and the mail module. After going though the code it became apparent that the mail module we use in nginx to proxy to our upstream mail applications does not support the PROXY command and it just returns a 500 from https://github.com/nginx/ nginx/blob/master/src/mail/ngx_mail_smtp_handler.c#L43.
Is there a reason why the mail module does not support the PROXY protocol? It seems rather trivial to implement it in https://github.com/nginx/ nginx/blob/master/src/mail/ngx_mail.h#L153 and further up the chain. We could probably use the stream module instead, but we use starttls and auth in the mail module.