sending mail through ssh tunnel with

Discussion in 'Mac Apps and Mac App Store' started by dpope, Dec 18, 2006.

  1. dpope macrumors member

    Sep 5, 2006
    Hi all,

    I've setup a manual ssh tunnel to my university that connects to the imap and smtp ports (if anyone wants to the command line just let me know) and can check that it works by manually telneting into the local ports and interacting with the servers. This works fine for getting mail but when I try to send using it says it can't send the mail. I've manually telneted into the local port and used the SMTP protocol to successfully send some mail. I'm pretty sure the problem is the "hello" command in the SMTP protocol. When I send mail manually I have to type in something like "hello" where should be the same domain as the mailserver is in. I'm guessing is, instead, giving the domain name of the domain I'm connecting from. Does anyone know how to check if this is indeed the problem and how I can work around it. I'm sure people have setup to work with an SSH tunnel before so I hope there's some kind of a workaround for this.
  2. superbovine macrumors 68030


    Nov 7, 2003
  3. dpope thread starter macrumors member

    Sep 5, 2006
    I'm already aware of STM. I don't really need it because I'm just running ssh manually. That was not what my question was about. Are you suggesting that STM contains something that will resolve my issue or did you just misunderstand the question? My problem is more about setting up to send a different domain name on the SMTP hello command.
  4. Westside guy macrumors 601

    Westside guy

    Oct 15, 2003
    The soggy side of the Pacific NW
    Not necessarily. Since has the ability to handle TLS and SSL encryption, and most mailservers offer (at least) SSL support now, I wouldn't count on too many people having tried this - so you may be stuck working it out yourself.
  5. dpope thread starter macrumors member

    Sep 5, 2006
    Thanks for the response. Actually I should have mentioned that my mail server does support SSL and TLS but if I use with SSL then its extremely unresponsive. It won't get new mail until hours after it arrives (while thunderbird on SSL gets the new mail with no problem). This caused me to first switch to thunderbird but it had its own, unrelated, problems so I switched back to mail once I realized the problem was SSL. With the SSH tunnel I no longer need to run SSL so receiving mail is not a problem.

    The problem is sending mail and I don't think SSL/TLS addresses this problem because the real issue is that most mail servers don't relay so if you don't access them from the same domain then they won't send your mail. I guess most people work around this using SSH tunneling or a VPN. The latter would probably resolve my problem but at the cost of a lot of speed. Its the former that I'm trying to get to work (i.e. i don't want a VPN because I don't want all my connections to go through a remote server only IMAP and SMTP). If anyone has gotten to work through an SSH tunnel I'd like to hear about it.

  6. superbovine macrumors 68030


    Nov 7, 2003
    I am suggesting you don't know how to configure a ssh tunnel.

    post your settings.
  7. dpope thread starter macrumors member

    Sep 5, 2006
    Hi Superbovine,

    Thanks for your help. The SSH setup, however, was _not_ a problem since I can manually telnet to the local port which is being used for SMTP and send mail by typing in the correct SMTP commands. My stupidity was something much less subtle. I was configuring to use "localhost" for SMTP but apparently that doesn't work for some reason (though this does work for IMAP strangely enough). When I told it to use everything suddenly worked.

    Also, for reference you don't need two ssh commands to open two ports (as suggested in the post you linked to) but you can do it all on one line:

    ssh -L -L

    This is an IMAP setup not a POP setup so change 143 to 110 above if you want to use POP.

Share This Page