From: Xianwen Chen on
Dear Pythoners,

I need to send one line of commands to an IMAP server. The commands
are not standard IMAP protocols, hence it's not specified in
http://docs.python.org/library/imaplib.html. Can you please give me a
hint?

Best regards,

Xianwen
From: Tim Chase on
On 06/23/2010 05:22 PM, Xianwen Chen wrote:
> I need to send one line of commands to an IMAP server. The commands
> are not standard IMAP protocols, hence it's not specified in
> http://docs.python.org/library/imaplib.html.

Sounds like you want to use the imaplib's IMAP4.xatom() to send a
custom command to your IMAP server:

http://docs.python.org/library/imaplib.html#imaplib.IMAP4.xatom

Given that you don't detail what you want to send or expect back,
it's a little hard to give you more than that, but at least that
should get you started. However, the full source to imaplib is
in your $PYTHONLIB directory so you can see how other commands
are implemented and responses are interpreted.

-tkc







From: Xianwen Chen on
On 6/24/10, Tim Chase <python.list(a)tim.thechases.com> wrote:
> On 06/23/2010 05:22 PM, Xianwen Chen wrote:
>> I need to send one line of commands to an IMAP server. The commands
>> are not standard IMAP protocols, hence it's not specified in
>> http://docs.python.org/library/imaplib.html.
>
> Sounds like you want to use the imaplib's IMAP4.xatom() to send a
> custom command to your IMAP server:
>
> http://docs.python.org/library/imaplib.html#imaplib.IMAP4.xatom
>
> Given that you don't detail what you want to send or expect back,
> it's a little hard to give you more than that, but at least that
> should get you started. However, the full source to imaplib is
> in your $PYTHONLIB directory so you can see how other commands
> are implemented and responses are interpreted.
>
> -tkc
>
>
>
>
>
>
>
>

Hi Tim,

Thanks a lot for your reply! I thought it would be simpler if the
problem was presented in a brief way. Unfortunately, not for this
case.

Here is the detail. Free Yahoo! mail accounts can be accsessed via
IMAP protocal, however, a non-standard shake hand code is needed
before log in [1]:

ID ("GUID" "1")

.. This is what I'm now working for. I tried:

IMAP4.xatom('','ID ("GUID" "1")','',)

and

dest_srv.xatom('ID ("GUID" "1")')

, but I got error messages. Any hint please?

Best regards,

Xianwen

[1] http://en.wikipedia.org/wiki/Yahoo!_Mail#Free_IMAP_and_SMTPs_access

--
Xianwen Chen
University of Tromsø
http://u.nu/9uubc
From: Michael Torrie on
On 06/24/2010 03:47 AM, Xianwen Chen wrote:
> . This is what I'm now working for. I tried:
>
> IMAP4.xatom('','ID ("GUID" "1")','',)
>
> and
>
> dest_srv.xatom('ID ("GUID" "1")')
>
> , but I got error messages. Any hint please?

What error messages?
From: Michael Torrie on
On 06/24/2010 03:47 AM, Xianwen Chen wrote:
> , but I got error messages. Any hint please?

Why not just use a proxy server:

http://sourceforge.net/projects/imapidproxy/