copying or moving the mail message using imaplib

2005-02-21 Thread Raghul
Hi Friends,

I am doing project in python.I am new to this. My problem
is I want to move the mail message to other folder in the mail using
imaplib (E.g) I want to move a message from the inbox to the Draft
folder in my account using python code. Can any one help me by giving a
sample code to do this?


Thanks in advance

-- 
http://mail.python.org/mailman/listinfo/python-list


about uid in imaplib

2005-02-21 Thread Raghul
Hi guys,
 How to use "uid" and copy a message to the other folders using
python.Please help in explainig with sample code.I think,imaplib uid
object need atleast a sample to understand clearly.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: copying or moving the mail message using imaplib

2005-02-21 Thread Raghul
Thanks for ur message .How it is possible to copy the  messages betwwen
folder ?I can't understand the copy function in python documentation.
Please Can u give me a sample example for this. And I also to copy
using uid but in vain. here is my program.

#!/usr/bin/env python
#Normal Library
import socket
import os
import re
import time
import sys
import getopt
import types
import traceback
import email
import mhlib,popen2


import string, random
import StringIO, rfc822

import email.Parser
from getpass import getpass
from email.Header import Header
from email.Utils import parsedate
from imaplib import IMAP4 as BaseIMAP
from email.Message import Message
from email.Header import Header
# Antispam database lib


class IMAPSession(BaseIMAP):

   def __init__(self, server, port, debug=0, do_expunge=False):

BaseIMAP.__init__(self, server, port)



   def getsizes(imap, msgs):
uidfetchbatchsize =25
res2=[]

# Python really needs do - while
while 1:
if len(msgs)==0: break
if len(msgs)>uidfetchbatchsize:
msgmore=msgs[uidfetchbatchsize:]
msgs=msgs[:uidfetchbatchsize]
else:
msgmore=[]
msgs=string.join(msgs, ',')
res=imap.uid("FETCH", msgs, "(UID RFC822.SIZE)")
assertok(res, "uid fetch", msgs, "(UID RFC822.SIZE)")
for i in res[1]:
mo=gsre.match(i)
if mo is None:
if verbose: print "getsize Eh?", i
else:
res2.append((mo.group(2), mo.group(1)))
msgs=msgmore
return res2




def run():
import getpass
#name = raw_input("Enter User name : ")
passwd = getpass.getpass ("Enter the password : ")
server ="mail.myhost.com"
port = 143
ss = IMAPSession(server,port)
sd = ss.login ("raghul",passwd)
uidfetchbatchsize =25
print ss.list()
print ss.select('Junk E-mail')
typ, data = ss.search(None,"ALL" )
for num in data[0].split():
  typ, data = ss.fetch(num, '(RFC822)')
  print 'Message %s\n%s\n' % (num, data[0][1])
  print "_"
  dat = ss.uid('copy',num,'INBOX')
  print "copied"
  print dat
  print num
  print "_"
ss.logout()











if __name__ == '__main__':
run()

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: copying or moving the mail message using imaplib

2005-02-21 Thread Raghul
Thanx I got some clear view about this. In the above program I used uid
method to copy thje mail to "Inbox".This shows the out put of my mail
messages and In the copy of messages I got the output
when printing the "dat"

('OK', [None])
('OK', ['2 (UID 16 FLAGS (\\Seen))'])
2

I cannot see the message in the INBOX. Can anyone give me a solution.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: copying or moving the mail message using imaplib

2005-02-21 Thread Raghul
Thanx I got some clear view about this. In the above program I used uid
method to copy thje mail to "Inbox".This shows the out put of my mail
messages and In the copy of messages I got the output
when printing the "dat"

('OK', [None])
('OK', ['2 (UID 16 FLAGS (\\Seen))'])
2

I cannot see the message in the INBOX. Can anyone give me a solution.

-- 
http://mail.python.org/mailman/listinfo/python-list


UID python reading mail

2005-02-21 Thread Raghul
I am totally confused of using uid .Can anyone help me in giving a
sample code for reading mail nad printing their uid's. I think this
would be more useful for freshers like me.

Thanks  in advance

-- 
http://mail.python.org/mailman/listinfo/python-list


Copy functio in imaplib

2005-02-21 Thread Raghul
What is message_set in the python documentation for copy in imaplib? Is
they referring message set  to the particular mail message in my inbox
or something else.

copy(   message_set, new_mailbox)
Copy message_set messages onto end of new_mailbox.

-- 
http://mail.python.org/mailman/listinfo/python-list


how can i read a mail using uid?

2005-02-21 Thread Raghul
I want to read the content of the mail and split it words using uid.If
the word is found in my database I want to delete the mail using  its
uid.

-- 
http://mail.python.org/mailman/listinfo/python-list


imaplib.error: command COPY illegal in state AUTH

2005-02-22 Thread Raghul
I am getting this error while copying n number of messages to the
folder using imaplib.What to do to copy n number of folders in mail

 The error i got is

imaplib.error: command COPY illegal in state AUTH

I am executing the lines

for i in alluids:
print i
print alluids
copymsg(obj,res,alluids[n],'INBOX') #copy to folder
deletemsg(ss,alluids[n])  # delete from folder
n+=1

-- 
http://mail.python.org/mailman/listinfo/python-list


user interface for python

2005-02-22 Thread Raghul
Hi,
   Which of the UI I can used for my program that I can use both in
windows and in Linux. Is it possible for me to use Wxpython for my
program so that it can run on both the windows and linux machine? Will
it be platform independent?

-- 
http://mail.python.org/mailman/listinfo/python-list


reading only new messages in imaplib

2005-02-22 Thread Raghul
Is it posssible to read only the new messages or unread messages using
imaplib in python? If it is possible pls specify the module or give a
sample code.

Thanks in advance

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: reading only new messages in imaplib

2005-02-22 Thread Raghul
eceived: from web50
Received: by twmail.
Received: from mail.
Received: from mail.
Received: by twmail.
Received: from adams
Received: by twmail.
Received: by twmail.
Received: by twmail.
Received: from ns2.T
Received: by twmail.
Received: by twmail.
Received: from chat3
Received: by twmail.
Received: by twmail.
Received: from CRM (
Received: by twmail.
Received: by twmail.
Received: by twmail.
Received: by twmail.
thread-index: AcUTaP
Received: by twmail.
Received: from web60
Received: from web60
Received: by twmail.
Received: by twmail.
Received: by twmail.
Received: by twmail.
Received: by twmail.
Received: by twmail.
Received: from ablis
Received: by twmail.
thread-index: AcUXP/
Received: from web50
Received: from mta.n
Received: from ns2.T
Received: by twmail.
Received: by twmail.
Received: by twmail.
Received: by twmail.
Received: from ns2.T
Received: by twmail.


it prints something like this. what it actually display.And pls tell me
what it actually does? I can't understand

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: reading only new messages in imaplib

2005-02-23 Thread Raghul
Thanks ya.It helped me a lot 

-- 
http://mail.python.org/mailman/listinfo/python-list


wxpython tutorials

2005-02-24 Thread Raghul
hi,

I want to learn Wxpython to work in windows.Is there any tutorials
available?Pls specify the link that will be easy to learn for beginers
like me

-- 
http://mail.python.org/mailman/listinfo/python-list


closing tabs in wxpython

2005-02-27 Thread Raghul
hi,
  Can anybody help in closing tabs in wxpython.Pls give me a sample
program for explaining this.Thanx in advance

-- 
http://mail.python.org/mailman/listinfo/python-list


enter key event in wxpython

2005-02-28 Thread Raghul
hi,
   I am developing a jabber client.What I need is whrn i enter text in
the text area and when I press return key. The following text should be
send.I found the way to send the message, the only thing is I want to
handle the enter key event.how to do this? so that when i press enter
key, The key id or the event to be handled. Help me pls.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: closing tabs in wxpython

2005-02-28 Thread Raghul
I think this need some more explanation.Pls help me to understand this
by giving  an example.

Thanks in advance

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: closing tabs in wxpython

2005-03-01 Thread Raghul
Thanx Steve for ur kind advise.And I am in hurry to finish my project.
If this make someone irritating I am sorry.

-- 
http://mail.python.org/mailman/listinfo/python-list


directing windows

2005-03-01 Thread Raghul
Hi,
   I made 3 windows using wxpython.My problem is when I enter the
number 2 in my application the second window to be highlighted when i
press 1 the first should be highlighted.How can this be done? Is it
possible to do this with hash tables or some dictionaries . help me pls

-- 
http://mail.python.org/mailman/listinfo/python-list


calling a same class using threading python

2005-03-05 Thread Raghul
Hi friends,
 I am creating a jabber client and a separate class  for
dialog is created,So when the roster name is clicked this dialog open
and can continue chat.What I need is I am calling the same class when
reciving the message so that the application goes not responding.People
told me to use threading for this.


Can any one help me in calling the same dialog class using threading...

Thanks in advance

-- 
http://mail.python.org/mailman/listinfo/python-list


window not responding

2005-03-08 Thread Raghul
hi
  I am working in making a jabber client.I made upto  chatting with
each other.Any number of people can be simultaneously chat.My problem
is that If I am initiated to talk then the application works
fine.Suppose if my friend initiate the session by sending message the
window goes on not responding.

   What i done is that i used a class named dialog for chat
window.When i dble click on the roster list the window is opened and
can continue chatting .Suppose if they initiate the window appears by
printing the message in the text message box and goes not responding.



Pls Gurus give me a solution.


Thanks in advance

-- 
http://mail.python.org/mailman/listinfo/python-list


removing command prompt excecuting python

2005-03-09 Thread Raghul
friends
When i execute the python bu dbleclick in windows  a command
prompt run s at back what to do to stop the command prompt running back
when running python.

pls give me a solution

-- 
http://mail.python.org/mailman/listinfo/python-list


copying a file in the python script

2005-04-04 Thread Raghul
hi
   I am having a problem. I want to copy a file from the folder and
paste it or move it to another folder. Is it possible in python?
Actually I need to implement this in the zope for my site. When I click
any file it should move or copied to another folder in the same machine
using zope.

Thanks in advance.

-- 
http://mail.python.org/mailman/listinfo/python-list


monitoring folder in python

2005-04-04 Thread Raghul
Is it possible to monitor a folder in the python?My question is if I
put any file in it that particular folder my script should monitor the
folder and read the file name.If so what function can I use?

Thanx in advance

-- 
http://mail.python.org/mailman/listinfo/python-list


authentication in zope server & Python

2005-04-05 Thread Raghul
Hi
   I am trying to execute a sample python script using zope server.The
problem is I need to execute a python script in the linux machine. When
I call that function through the zope server,It shows me the error
regarding authentication that is 'access denied for myfunction'

   In my function just I am copying a file from one location to another
location in the same machine.

Thanx in advance

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: authentication in zope server & Python

2005-04-05 Thread Raghul
Pls help Guys no idea?

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: authentication in zope server & Python

2005-04-06 Thread Raghul
I'm sorry

-- 
http://mail.python.org/mailman/listinfo/python-list


logging as root using python script

2005-04-06 Thread Raghul
Hi
   Is it possible to login as a root in linux using python script?
What I need is when I execute a script it should login as root and
execute my command and logout from root to my existing account. IS is
possible?

Thanx in advance.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: logging as root using python script

2005-04-07 Thread Raghul
But this not the right answer

-- 
http://mail.python.org/mailman/listinfo/python-list


converting jpg to pdf

2005-05-26 Thread Raghul
Hi friends
Is it possible to convert jpg to pdf  in python. I need a
program to convert jpg format file to pdf. Is there any sample or any
library to do that? Pls guide me.

Thanks in advance

-- 
http://mail.python.org/mailman/listinfo/python-list