Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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!

share|improve this question
    
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 3: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 3:48
add comment

2 Answers 2

up vote 1 down vote accepted

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.

share|improve this answer
add comment

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
share|improve this answer
    
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 3:47
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.