Proxying non-ssl SMTP/POP to ssl SMTP/POP

Hi everyone,
I’m now using nginx in
setting up a proxying mail system in my company. The model is as below:

Mail client
<=========> Nginx proxy <===========> Mail server

The stream between mail
client and nginx is non-ssl connection (includes smtp and pop3 stream),
whereas the stream between nginx and mail server uses ssl. The reason I
this model is that: I want to create a neutral node that can modify the
emails before being delivered to mail server or client. However, I’m
still stuck on the configuration of nginx to implement this model. So if
you have any idea about how to configure this system as well as it’s
possibility with nginx, please help me.

I’m still a newbie to this field, so if this is a
dump question, please forgive for my awkwardness.
Thank you very much!

Btw: I also referenced to
the question of kgoj at :
proxying SMTP+SSL to SSL-unaware mail server. However, his
model is contrasted with my model and I haven’t found any idea yet!