473,326 Members | 2,111 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 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 10644

"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Alexander Schumann | last post by:
Hello everyone, We are building a new web based e-mail client "Fiezel" that will support IMAP, POP3 and SMTP protocols. Will be written in php4. I am trying to collect all the infomation on SNMP...
5
by: F. GEIGER | last post by:
Hi all! As I saw Alex Martelli's post about a mbox cleaner based on POP3, I thought, it could be possible to do that based on IMAP too. That way I could ask the server for mails having attached...
1
by: !TG | last post by:
I'm looking for something that should be simple. What I want to do it just connect to an IMAP or POP server and see how many unread messages there are and display that number. Does anyone know how...
3
by: chirag | last post by:
i want a IMAP server for windows so that i can retrive incoming mails. I use mssql server to store user information. i need IMAP server to develop project i.e mail system can any body sent me...
2
by: Mike Brearley | last post by:
I need to write a script that will check a catch-all mailbox (pop3) and send a non delivery report back to the sender of the email. Background info: I have a domain hosted on a site that offers...
3
by: Richard Thornley | last post by:
Hello, I was just been given a project and I have some questions on how to accomplish the first part of the task. If a user sends an email to a specific email address I need to detect...
1
by: Trevor | last post by:
In the PHP manual (http://us3.php.net/imap) it reads: >LIX. IMAP, POP3 and NNTP Functions >Introduction > >These functions are not limited to the IMAP protocol, despite their name. The...
0
by: Christian Hofmann | last post by:
Hello, I am looking for a smtp/imap/pop3-component to build an own mailserver. I searched all the web but the onliest I found were complete mailservers or components to fetch mails via...
1
by: CodeSeeker | last post by:
I have an application, which uses pop3 to read the messages from the mailbox, and it has been working fine for so many year. We recently have started changing this application to use java mail IMAP 4...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.