Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a mail server that uses postfix to relay all the outbound mail through Gmail's smtp servers. Now I have another internet provider and this one is through a SOCKS proxy connection.

How can I setup my postfix server to route all its outbound mail traffic to the SOCKS proxy?

share|improve this question
Why would you want to do this? As far as I know, postfix doesn't support SOCKS proxies. Additionally, you really ought to go back and "accept" answers to your previous six questions. Having a "0% accept rate" isn't doing you any favors at the moment. – EEAA Feb 25 '12 at 0:06
Ok Sorry, i am just new here, i already accept my questions. – nerdhacker Feb 25 '12 at 1:04
I need to do this cause my internet connection is trough a socks proxy server, to be more explicit, i have to do an shh tunnel to another server to gain internet access, then i can setup my apps with socks proxy to to use them, i already know about "tsocks" to socksificate an application that does not supports proxys, or also "proxychains" , but i dont know how (or if is possible) to setup Postfix with them, i just need help on however can be the way to route Postfix outgoing traffic to . Thanks – nerdhacker Feb 25 '12 at 1:14
up vote 3 down vote accepted

First off, what situation landed you in such an awkward internet connection scenario? I've seen a lot of messed up configurations, but requiring customers to tunnel all of their traffic to a remote ssh server is absurd. I must say, it sounds like you're perhaps trying to run a server somewhere where you aren't supposed to, or are trying to fly under the radar somehow.

Anyway, why don't you just make another non-dynamic ssh tunnel for the smtp traffic? Something like:

$ ssh user@host -L:2525:remote.smtp.server:25

Then you can have postfix deliver use localhost:2525 as its "smarthost".

This will be much more straightforward than using a dynamic proxy like you're currently trying to do.

share|improve this answer
Ok, this sounds like a great idea. My escenario is like a intermedial dialup server, where customers connect to it to send and recieve mail. Is an akward scenario like you say. But it works good for a lot of people with no internet connection. The new internet connection that i am thinking to use is by a ssh tunnel already. any other suggestion?? – nerdhacker Feb 25 '12 at 5:33
And if the remote smtp server needs authentication?? – nerdhacker Feb 25 '12 at 5:36

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.