Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

dpope

macrumors member
Original poster
Sep 5, 2006
65
0
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 Mail.app 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 myuniversity.edu" where myuniversity.edu should be the same domain as the mailserver is in. I'm guessing Mail.app 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 Mail.app to work with an SSH tunnel before so I hope there's some kind of a workaround for this.
 
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 Mail.app 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 myuniversity.edu" where myuniversity.edu should be the same domain as the mailserver is in. I'm guessing Mail.app 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 Mail.app to work with an SSH tunnel before so I hope there's some kind of a workaround for this.

http://projects.tynsoe.org/en/stm/
 
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 Mail.app to send a different domain name on the SMTP hello command.
 
I'm sure people have setup Mail.app to work with an SSH tunnel before so I hope there's some kind of a workaround for this.

Not necessarily. Since mail.app 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.
 
Thanks for the response. Actually I should have mentioned that my mail server does support SSL and TLS but if I use Mail.app 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 Mail.app to work through an SSH tunnel I'd like to hear about it.

thanks
 
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 Mail.app to send a different domain name on the SMTP hello command.

I am suggesting you don't know how to configure a ssh tunnel.

http://www.macosxhints.com/article.php?story=20030721022245232

post your settings.
 
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 Mail.app 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 127.0.0.1 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 1143:mail.maildomain.com:143 -L 1025:mail.maildomain.com:25 gateway.maildomain.com

This is an IMAP setup not a POP setup so change 143 to 110 above if you want to use POP.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.