| Line 96... |
Line 96... |
| 96 |
document = tclient.getDocument(1, int(mail.source))
|
96 |
document = tclient.getDocument(1, int(mail.source))
|
| 97 |
if document != bin(0):
|
97 |
if document != bin(0):
|
| 98 |
msg.attach(self.get_attachment_part(document, mail.source))
|
98 |
msg.attach(self.get_attachment_part(document, mail.source))
|
| 99 |
|
99 |
|
| 100 |
try:
|
100 |
try:
|
| 101 |
self.setMailServerAndPassword(mail)
|
101 |
|
| 102 |
if 'profitmandi.com' in mail.emailFrom:
|
102 |
if 'profitmandi.com' in mail.emailFrom:
|
| 103 |
self.authenticate("profitmandi","pma20aug")
|
103 |
self.authenticate("profitmandi","pma20aug")
|
| - |
|
104 |
self.setMailServerAndPassword(mail)
|
| 104 |
rs = self.mailServer.sendmail("pma20aug", mail.emailTo + mail.cc + mail.bcc, msg.as_string())
|
105 |
rs = self.mailServer.sendmail("pma20aug", mail.emailTo + mail.cc + mail.bcc, msg.as_string())
|
| 105 |
else:
|
106 |
else:
|
| 106 |
self.authenticate()
|
107 |
self.authenticate()
|
| - |
|
108 |
self.setMailServerAndPassword(mail)
|
| 107 |
rs = self.mailServer.sendmail(self.password, mail.emailTo + mail.cc + mail.bcc + ['backup@saholic.com'], msg.as_string())
|
109 |
rs = self.mailServer.sendmail(self.password, mail.emailTo + mail.cc + mail.bcc + ['backup@saholic.com'], msg.as_string())
|
| 108 |
except smtplib.SMTPServerDisconnected as e:
|
110 |
except smtplib.SMTPServerDisconnected as e:
|
| 109 |
print 'Server Disconnected at', time.time()
|
111 |
print 'Server Disconnected at', time.time()
|
| 110 |
self.authenticate()
|
112 |
self.authenticate()
|
| 111 |
rs = self.mailServer.sendmail(self.password, mail.emailTo + mail.cc + mail.bcc + ['backup@saholic.com'], msg.as_string())
|
113 |
rs = self.mailServer.sendmail(self.password, mail.emailTo + mail.cc + mail.bcc + ['backup@saholic.com'], msg.as_string())
|