Mail port forwarding issue?

Hi,
I'm having problems getting Mail to deal with using localhost ports to get an ssh tunnel connection to work. I can set up the tunnel, so that for example I forward port 7001 locally to port 993 of my remote IMAP server's port 993. Now if I set up Thunderbird as a mail client, tell it to connect to server localhost on port 7001 with SSL on and authentication on, then I get a nice connection to my mail server at work.

Now if I try to do the same thing with Mail.app, it fails, and I don't know why. I set SSL on, tell mail that the server is localhost and the port is 7001, and I get an error message that mail is trying to connect to server "localhost" on port 0 and can't? I have 7001 set as the port in preferences but Mail seems to be ignoring this. Anyone seen this behaviour before?

I know the tunnel is fine, because Thunderbird can use it perfectly well. Any clues?
Many thanks,
Bill

Posted on Oct 19, 2005 2:33 AM

Reply
2 replies

Jan 2, 2006 7:17 PM in response to Bill Brocklesby1

Mail does not seem to be able to use IMAP/SSL on a non-standard port; see this thread: http://discussions.apple.com/thread.jspa?threadID=277077

However, I have used it successfully over an SSH tunnel to a non-SSL IMAP server. Do you need to be using double encryption like that? (If the SSH server and IMAP server are the same, then it's pointless, right?)

Another workaround is to run your SSH tunnel as root, so that you can forward a privileged port. Then you should be able to map local 993 to remote 993 (or anything, actually), and Mail.app should have no problems.

Hope this gets fixed quickly though: I just want to connect to an SSL IMAP server on a non-standard port... (without any port-forwarding tunnel).


PowerBook G4 Mac OS X (10.4.3)

Feb 2, 2006 12:24 PM in response to chrystophe

Also, I found that specifying "localhost" as my imap or smtp server in Mail.app's account preferences doesn't work. I think it has something to do with localhost referring to IPv6 and Mail wanting to use IPv4, or something like that. Specifying "127.0.0.1" as my server, rather than "localhost," cured my problem with ssh port forwarding. I was still able to specify "localhost" in the "ssh" command, but if you still had problems, I guess you could try "127.0.0.1" in the "ssh" directive as well

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Mail port forwarding issue?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.