Re: Constructing RFC2822 Message

2005-12-19 Thread Narendra
Thanks Steve, No I'm not using windows XP client. I'm using linux
client and no firewall is there

Thanks,
Narendra

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


Constructing RFC2822 Message

2005-12-05 Thread Narendra
Hi All,

This is narendra from india doing my engineering.

i need to develop an E-mail client in python,which connects to my MTA
on port 25 and sends email from there.

I was able to do that but my e-mail is ending in bulk when i'm trying
to senf to hotmail/msn.

here im giving the code of my program.
**
import socket,string
import sys
import time
from email import Encoders
import email.Message
import email.Utils
from email.MIMEBase import MIMEBase
from email.MIMEText import MIMEText
# Reading IPConfig File
clientSendingPort = 9000
headuni = '000119-000257-454777-'
headadd  = 555650
i = 0
def read(infile):
try:
flopen = open(infile,'r')
flines = flopen.readlines()
flopen.close()
return flines
except IOError:
print sys.exc_info()

if len(sys.argv) != 3:
print 'Usage: IPAuditMain.py IPConfig File Name Email Address
File Name'
sys.exit()
try:
ipConfigLines = read(sys.argv[1])
emailAddConfigLines = read(sys.argv[2])
print(reading is over)
for line in ipConfigLines:
print(hello)
print line
clIpAddress,injectIPAddress,extnIP,fromadd =
string.split(line,',')
print clIpAddress,injectIPAddress,extnIP
print(how come)

timestamp=time.strftime([%y%m%d-%H%M%S],time.localtime(time.time()))
headerUnq = str(headuni) + timestamp
headadd =  headadd + 5;
print headerUnq
for recptEmailAdd in emailAddConfigLines:
print(wt happened)
print recptEmailAdd
soc = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
print socket created
soc.bind((clIpAddress,clientSendingPort))
#print soc.recv(9867)
print after binding
soc.connect((injectIPAddress, 25)) # SMTP
print recptEmailAdd
i = i +1
clientSendingPort = clientSendingPort + 1
soc.send(mail from:+fromadd+\n)
print soc.recv(9869)
soc.send(rcpt to:+ recptEmailAdd +\n)
print soc.recv(9869)
soc.send(data\n)
print soc.recv(9869)
print headerUnq
msg = MIMEBase('multipart','alternative')
msg['X-PVIQ'] = headerUnq
msg['Date']=email.Utils.formatdate(localtime=1)
#msg['Return-Path'] = fromadd
msg['Subject'] = 'Our convo zt'+extnIP
msg['From'] = fromadd
msg['To'] = recptEmailAdd
msg.preamble = 'You will not see this in a MIME-aware mail
reader.\n'
msg.epilogue = ''
outer = MIMEText('\nHai Bob '+
   'What are you doing?
\n\nRegards,',_subtype='plain')
msg.attach(outer)
print(narendra u got here)
soc.send(msg.as_string(0))
print(u have sent the data )
soc.send(\n.\n)
print(quit)
print  soc.recv(9869)
clientSendingPort = clientSendingPort + 1
soc.close()
except IOError:
print sys.exc_info()
except:
print 'Exception Found. Unable to process'
***

Can anyone please help me out how to fix the problem.

Thanks,
Narendra

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


Re: Constructing RFC2822 Message

2005-12-05 Thread jepler
On Mon, Dec 05, 2005 at 06:27:44AM -0800, Narendra wrote:
 I was able to do that but my e-mail is ending in bulk when i'm trying
 to senf to hotmail/msn.

Perhaps this is an over-zealous filter on the hotmail/msn side, not a
problem with Python.

I don't know for sure, but some news stories indicate that without the
presence of a special DNS record, microsoft treats messages as spam--
e.g. http://news.zdnet.com/2100-1009-5758365.html

Jeff


pgpiCUTsOPQDx.pgp
Description: PGP signature
-- 
http://mail.python.org/mailman/listinfo/python-list

Re: Constructing RFC2822 Message

2005-12-05 Thread Narendra
Thanks jep for the quick response.But when im sending with different
program written in java i was able to send into inbox.

So i thought problem was with the python code only.

Narendra

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


Re: Constructing RFC2822 Message

2005-12-05 Thread Steve Holden
Narendra wrote:
 Thanks jep for the quick response.But when im sending with different
 program written in java i was able to send into inbox.
 
 So i thought problem was with the python code only.
 
 Narendra
 
Are you sending from a Windows XP client? If so the firewall may be 
getting in your way. (It may already trust Java).

You don't report the actual error, so it's difficult to say waht's going 
wrong.

regards
  Steve
-- 
Steve Holden   +44 150 684 7255  +1 800 494 3119
Holden Web LLC www.holdenweb.com
PyCon TX 2006  www.python.org/pycon/

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


Re: Constructing RFC2822 Message

2005-12-05 Thread Tim Williams (gmail)
On 5 Dec 2005 06:27:44 -0800, Narendra [EMAIL PROTECTED] wrote:
Hi All,This is narendra from india doing my engineering.i need to develop an E-mail client in python,which connects to my MTAon port 25 and sends email from there.I was able to do that but my e-mail is ending in bulk when i'm trying
to senf to hotmail/msn.

Hotmail score spam/junk/ on several criteria. Including
whether the msg has a msg-id (yours doesn't) and whether the
envelope sender and recipient(s) match the header sender and
recipient(s). Have a look at the headers from spam and not
spam in your hotmail account to see what sort of headers each type has
(or hasn't).

Also, you may be better off using smtplib for the sending
portion, the error types will be more informative if there
is a connection or sending issue.

HTH :)
-- Tim Williams
-- 
http://mail.python.org/mailman/listinfo/python-list