0

I would like to export my emails from my email account on a linux email server to Gmail. So I was wondering how to get its incoming and outgoing hostnames and ports and get to know if it supports POP3 or IMAP? For example, by some commands that I can run on the server's bash shell?

Thanks and regards!

Tim
  • 1,487
  • 6
  • 28
  • 43
  • Please clarify this question. From your question, it sounds like you want to push email from a linux box to gmail. In your response to Nathan's answer, it sounds like you want mail to go from gmail to your linux box when it is received by google. – Alex Jun 16 '10 at 03:13
  • Sorry for the confusion. I want to push email from a linux email server to gmail, so I need to know the hostname and port of the email server and whether it support POP3 or IMAP. – Tim Jun 16 '10 at 03:48

2 Answers2

1

I am not 100% sure what you are asking, but to see what is listening, you can use either netstat, or nmap.

netstat would be local:

netstat -pan | grep LISTEN | less

nmap can be local or remote:

nmap remote.host.com
Nathan Powell
  • 579
  • 2
  • 6
  • Thanks. I would like to know hostname and port of the email server, so that I can export my emails from the email server to my Gmail account. The methods you mentioned seem not provide such information. – Tim Jun 16 '10 at 03:47
1

What information do you have about the mail server? Are you able to log into it? This should provide you with the hostname, or you can use the hostname command to get it when you are logged in. If that name doesn't correspond to the "real" hostname, then you can always look it up if you know the IP address of the server, by doing a domain name lookup on it (here is an example looking up 8.8.8.8):

$ nslookup 8.8.8.8
Name:    google-public-dns-a.google.com
Address:  8.8.8.8

The netstat command provided above will tell you what ports the linux server is listening on, but the -n tells it not to resolve IPs and Port names, and instead to display the raw numbers. If you leave off the -n you'll see hostnames and port numbers, or you can just look for the ports that POP and IMAP use, 110 and 143 respectively. Of course it should be noted that those ports are not secure by default, and anything transmitted to them over the internet will be in the clear unless the email client is configured to do a TLS upgrade.

Hope some of that helps.

Jed Daniels
  • 7,282
  • 2
  • 34
  • 42