[Home] / Mac setup / ssh-smtp
How to send mails through your smtp server from outside
If you are at your institution, you probably use an smtp server at your
institution to send mails.
However, if you are outside your institution, there are cases when you cannot
reach the smtp server. For example, :
- the smtp server at your institution does not accept
mails from outside, or
- the port to smtp servers (25) is being closed, and you cannot even use the smtp servers by internet providers.
Even in those cases, if you can log on to your smtp server by using ssh,
you can send mails. I learned this trick from Sato-san at Osaka Univ.
- On Mail, open Preferences > Accounts.
- Create a new "Outgoing Mail Server (SMTP):", named "localhost".
- Click "Server Settings..." and set the "Server port" to 10025.
- Select the "localhost" as your SMTP server for your mail account.
- On Terminal, type:
ssh -L 10025:localhost:25 smtp.foo.edu
where smtp.foo.edu should be replaced by your smtp server.
- Type password and log in.
- Now that the SSH port forwarding is established, you can send mails.
Here is an image of how it works.
2005-07-08 Taku Yamanaka