472,143 Members | 1,337 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,143 software developers and data experts.

How to auto detect a remote IMAP/POP3 server given only an emailaddress ?

mp-
I want to be able to allow people to check their email from my PHP
online application.

Given only the users 1) email address, 2) username (if applicable) and
3) password - how can I auto detect a remote IMAP/POP3 server so that
I can connect and fetch mail for the user. (Ultimately, I don't want
users to have to know what the IMAP/POP3 server name / port is .... I
would like to auto-detect all of that).

At first I thought I could use "getmxrr" but quickly realized that is
only good for determining the SMTP server.

If anyone has ever "add account" in Gmail Preferences, it's
essentially the exact same functionality where Gmail auto-detects the
IMAP/POP3 server.

Any help will be greatly appreciated.

Dec 28 '07 #1
11 10413

"mp-" <mi******@gmail.comwrote in message
news:b4**********************************@x29g2000 prg.googlegroups.com...
>I want to be able to allow people to check their email from my PHP
online application.

Given only the users 1) email address, 2) username (if applicable)
and
3) password - how can I auto detect a remote IMAP/POP3 server so
that
I can connect and fetch mail for the user. (Ultimately, I don't
want
users to have to know what the IMAP/POP3 server name / port is ....
I
would like to auto-detect all of that).

At first I thought I could use "getmxrr" but quickly realized that
is
only good for determining the SMTP server.

If anyone has ever "add account" in Gmail Preferences, it's
essentially the exact same functionality where Gmail auto-detects
the
IMAP/POP3 server.

Any help will be greatly appreciated.
Just try to connect to the server.
POP3 and IMAP use different port numbers, so if either one does not
work you try the other.

Richard.
Dec 28 '07 #2
mp-
On Dec 28, 11:54 am, "Richard" <root@localhostwrote:
"mp-" <miche...@gmail.comwrote in message

news:b4**********************************@x29g2000 prg.googlegroups.com...
I want to be able to allow people to check their email from my PHP
online application.
Given only the users 1) email address, 2) username (if applicable)
and
3) password - how can I auto detect a remote IMAP/POP3 server so
that
I can connect and fetch mail for the user. (Ultimately, I don't
want
users to have to know what the IMAP/POP3 server name / port is ....
I
would like to auto-detect all of that).
At first I thought I could use "getmxrr" but quickly realized that
is
only good for determining the SMTP server.
If anyone has ever "add account" in Gmail Preferences, it's
essentially the exact same functionality where Gmail auto-detects
the
IMAP/POP3 server.
Any help will be greatly appreciated.

Just try to connect to the server.
POP3 and IMAP use different port numbers, so if either one does not
work you try the other.

Richard.

Richard

Thanks for the reply. I guess my question is, how do I figure out the
server imap/pop3 with only knowing the persons email address?

Dec 28 '07 #3

"mp-" <mi******@gmail.comwrote in message
news:b5**********************************@e23g2000 prf.googlegroups.com...
On Dec 28, 11:54 am, "Richard" <root@localhostwrote:
>"mp-" <miche...@gmail.comwrote in message

news:b4**********************************@x29g200 0prg.googlegroups.com...
>I want to be able to allow people to check their email from my PHP
online application.
Given only the users 1) email address, 2) username (if
applicable)
and
3) password - how can I auto detect a remote IMAP/POP3 server so
that
I can connect and fetch mail for the user. (Ultimately, I don't
want
users to have to know what the IMAP/POP3 server name / port is
....
I
would like to auto-detect all of that).
At first I thought I could use "getmxrr" but quickly realized
that
is
only good for determining the SMTP server.
If anyone has ever "add account" in Gmail Preferences, it's
essentially the exact same functionality where Gmail auto-detects
the
IMAP/POP3 server.
Any help will be greatly appreciated.

Just try to connect to the server.
POP3 and IMAP use different port numbers, so if either one does not
work you try the other.

Richard.


Richard

Thanks for the reply. I guess my question is, how do I figure out
the
server imap/pop3 with only knowing the persons email address?
The mailserver should be in DNS, not?

R.
Dec 28 '07 #4

"Richard" <root@localhostwrote in message
news:47***********************@news.euronet.nl...
>
"mp-" <mi******@gmail.comwrote in message
news:b5**********************************@e23g2000 prf.googlegroups.com...
>On Dec 28, 11:54 am, "Richard" <root@localhostwrote:
>>"mp-" <miche...@gmail.comwrote in message

news:b4**********************************@x29g20 00prg.googlegroups.com...

I want to be able to allow people to check their email from my
PHP
online application.

Given only the users 1) email address, 2) username (if
applicable)
and
3) password - how can I auto detect a remote IMAP/POP3 server so
that
I can connect and fetch mail for the user. (Ultimately, I don't
want
users to have to know what the IMAP/POP3 server name / port is
....
I
would like to auto-detect all of that).

At first I thought I could use "getmxrr" but quickly realized
that
is
only good for determining the SMTP server.

If anyone has ever "add account" in Gmail Preferences, it's
essentially the exact same functionality where Gmail
auto-detects
the
IMAP/POP3 server.

Any help will be greatly appreciated.

Just try to connect to the server.
POP3 and IMAP use different port numbers, so if either one does
not
work you try the other.

Richard.


Richard

Thanks for the reply. I guess my question is, how do I figure out
the
server imap/pop3 with only knowing the persons email address?

The mailserver should be in DNS, not?

R.
Oh... oops. I understand now. :S
I think most would try to guess. As far as I know there is not a
standard for that.

Richard
Dec 28 '07 #5
mp-
On Dec 28, 5:04 pm, "Richard" <root@localhostwrote:
"Richard" <root@localhostwrote in message

news:47***********************@news.euronet.nl...


"mp-" <miche...@gmail.comwrote in message
news:b5**********************************@e23g2000 prf.googlegroups.com...
On Dec 28, 11:54 am, "Richard" <root@localhostwrote:
"mp-" <miche...@gmail.comwrote in message
>>news:b4**********************************@x29g20 00prg.googlegroups.com...
>I want to be able to allow people to check their email from my
PHP
online application.
Given only the users 1) email address, 2) username (if
applicable)
and
3) password - how can I auto detect a remote IMAP/POP3 server so
that
I can connect and fetch mail for the user. (Ultimately, I don't
want
users to have to know what the IMAP/POP3 server name / port is
....
I
would like to auto-detect all of that).
At first I thought I could use "getmxrr" but quickly realized
that
is
only good for determining the SMTP server.
If anyone has ever "add account" in Gmail Preferences, it's
essentially the exact same functionality where Gmail
auto-detects
the
IMAP/POP3 server.
Any help will be greatly appreciated.
>Just try to connect to the server.
POP3 and IMAP use different port numbers, so if either one does
not
work you try the other.
>Richard.
Richard
Thanks for the reply. I guess my question is, how do I figure out
the
server imap/pop3 with only knowing the persons email address?
The mailserver should be in DNS, not?
R.

Oh... oops. I understand now. :S
I think most would try to guess. As far as I know there is not a
standard for that.

Richard

Yeah, I'm stumped as well.

I know Google has figured out how to auto detect the imap/pop3 since
when you go into the GMail -Preference -"Add Account" (so that
Gmail can pull mail from another non-Gmail server) it auto detects the
imap/pop3 server using only a person email address information.

Hmm ... anyone else have any ideas?

Thanks in advance

Dec 28 '07 #6
mp- wrote:
On Dec 28, 5:04 pm, "Richard" <root@localhostwrote:
>"Richard" <root@localhostwrote in message

news:47***********************@news.euronet.nl. ..


>>"mp-" <miche...@gmail.comwrote in message
news:b5**********************************@e23g20 00prf.googlegroups.com...
On Dec 28, 11:54 am, "Richard" <root@localhostwrote:
"mp-" <miche...@gmail.comwrote in message
news:b4**********************************@x29g 2000prg.googlegroups.com...
>I want to be able to allow people to check their email from my
>PHP
>online application.
>Given only the users 1) email address, 2) username (if
>applicable)
>and
>3) password - how can I auto detect a remote IMAP/POP3 server so
>that
>I can connect and fetch mail for the user. (Ultimately, I don't
>want
>users to have to know what the IMAP/POP3 server name / port is
>....
>I
>would like to auto-detect all of that).
>At first I thought I could use "getmxrr" but quickly realized
>that
>is
>only good for determining the SMTP server.
>If anyone has ever "add account" in Gmail Preferences, it's
>essentially the exact same functionality where Gmail
>auto-detects
>the
>IMAP/POP3 server.
>Any help will be greatly appreciated.
Just try to connect to the server.
POP3 and IMAP use different port numbers, so if either one does
not
work you try the other.
Richard.
Richard
Thanks for the reply. I guess my question is, how do I figure out
the
server imap/pop3 with only knowing the persons email address?
The mailserver should be in DNS, not?
R.
Oh... oops. I understand now. :S
I think most would try to guess. As far as I know there is not a
standard for that.

Richard


Yeah, I'm stumped as well.

I know Google has figured out how to auto detect the imap/pop3 since
when you go into the GMail -Preference -"Add Account" (so that
Gmail can pull mail from another non-Gmail server) it auto detects the
imap/pop3 server using only a person email address information.
take the domain part of their address and try looking for MX, then A
records..and hope their ISP doesn't have a relay in the way..

Hmm ... anyone else have any ideas?

Thanks in advance
Dec 28 '07 #7
The Natural Philosopher wrote:
take the domain part of their address and try looking for MX, then A
records..and hope their ISP doesn't have a relay in the way..
.... And do a port scan on pop3.domain, and imap.domain, and do keep a
whitelist of known domains and servers (together with a manual way of
adding a domain+server to that whitelist).

--
----------------------------------
Iván Sánchez Ortega -ivansanchez-algarroba-escomposlinux-punto-org-

Why was God able to create the universe in only seven days? Because he
didn't have an installed base to deal with.
Dec 29 '07 #8
mp-
On Dec 28, 5:56 pm, Iván Sánchez Ortega <ivansanchez-...@rroba-
escomposlinux.-.punto.-.orgwrote:
The Natural Philosopher wrote:
take the domain part of their address and try looking for MX, then A
records..and hope their ISP doesn't have a relay in the way..

... And do a port scan on pop3.domain, and imap.domain, and do keep a
whitelist of known domains and servers (together with a manual way of
adding a domain+server to that whitelist).

--
----------------------------------
Iván Sánchez Ortega -ivansanchez-algarroba-escomposlinux-punto-org-

Why was God able to create the universe in only seven days? Because he
didn't have an installed base to deal with.


Doing a port scan on imap.domain.com, pop.domain.com, etc.. just seems
like taking an educated guess as to what the IMAP/POP3 server name
is.

Does a DNS record exist describing the hostname for a particular
domains IMAP/POP3 servers? It seems that the MX record is only for
SMTP - which doesn't necessarily mean IMAP/POP3 is on that same
machine.
Dec 29 '07 #9
mp- wrote:
On Dec 28, 5:56 pm, Iván Sánchez Ortega <ivansanchez-...@rroba-
escomposlinux.-.punto.-.orgwrote:
>The Natural Philosopher wrote:
>>take the domain part of their address and try looking for MX, then A
records..and hope their ISP doesn't have a relay in the way..
... And do a port scan on pop3.domain, and imap.domain, and do keep a
whitelist of known domains and servers (together with a manual way of
adding a domain+server to that whitelist).

--
----------------------------------
Iván Sánchez Ortega -ivansanchez-algarroba-escomposlinux-punto-org-

Why was God able to create the universe in only seven days? Because he
didn't have an installed base to deal with.

Doing a port scan on imap.domain.com, pop.domain.com, etc.. just seems
like taking an educated guess as to what the IMAP/POP3 server name
is.

Does a DNS record exist describing the hostname for a particular
domains IMAP/POP3 servers? It seems that the MX record is only for
SMTP - which doesn't necessarily mean IMAP/POP3 is on that same
machine.
No DNS record for IMAP/POP3 because it isn't used for mail transfer.
SMTP needs it so that one system can send to another system. But with
IMAP/POP3 the user is requesting mail. Entirely different process which
doesn't require special DNS records.

As others have said - try the MX record for the domain. If that doesn't
exist, try the A record. If that doesn't work, you're SOL.

And it will fail on a large number of systems. Many large ISP's and
some large hosting companies use different IMAP/POP3 servers to keep the
load down on a single server, for instance. And many large companies do
similar, also.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Dec 29 '07 #10
mp- wrote:
On Dec 28, 5:56 pm, Iv�n S�nchez Ortega <ivansanchez-...@rroba-
escomposlinux.-.punto.-.orgwrote:
>The Natural Philosopher wrote:
>>take the domain part of their address and try looking for MX, then A
records..and hope their ISP doesn't have a relay in the way..
... And do a port scan on pop3.domain, and imap.domain, and do keep a
whitelist of known domains and servers (together with a manual way of
adding a domain+server to that whitelist).

--
----------------------------------
Iv�n S�nchez Ortega -ivansanchez-algarroba-escomposlinux-punto-org-

Why was God able to create the universe in only seven days? Because he
didn't have an installed base to deal with.

Doing a port scan on imap.domain.com, pop.domain.com, etc.. just seems
like taking an educated guess as to what the IMAP/POP3 server name
is.

Does a DNS record exist describing the hostname for a particular
domains IMAP/POP3 servers? It seems that the MX record is only for
SMTP - which doesn't necessarily mean IMAP/POP3 is on that same
machine.
MX is the target for publically recievable mail. It may, or may not be,
on the same machine.
For small domains it usually is.
Dec 29 '07 #11
On 28 Dec, 17:19, mp- <miche...@gmail.comwrote:
I want to be able to allow people to check their email from my PHP
online application.

Given only the users 1) email address, 2) username (if applicable) and
3) password - how can I auto detect a remote IMAP/POP3 server so that
I can connect and fetch mail for the user. (Ultimately, I don't want
users to have to know what the IMAP/POP3 server name / port is .... I
would like to auto-detect all of that).

At first I thought I could use "getmxrr" but quickly realized that is
only good for determining the SMTP server.

If anyone has ever "add account" in Gmail Preferences, it's
essentially the exact same functionality where Gmail auto-detects the
IMAP/POP3 server.

Any help will be greatly appreciated.
You can't.

You can guess at what the name might be (see Iván Sánchez Ortega's
response).

Even if you know the name, it doesn't necessarily follow that the
service is accessible via the internet - many ISPs will firewall
access to their own IP addresses.

C.
Dec 30 '07 #12

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Alexander Schumann | last post: by
5 posts views Thread by F. GEIGER | last post: by
1 post views Thread by !TG | last post: by
3 posts views Thread by chirag | last post: by
2 posts views Thread by Mike Brearley | last post: by
3 posts views Thread by Richard Thornley | last post: by
1 post views Thread by Trevor | last post: by
reply views Thread by Christian Hofmann | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.