예제 #1
0
파일: spf_auth.py 프로젝트: bcoe/smtproutes
 def auth(self, message_data=None, peer_ip=None, message=None):
     mailfrom = Contact.create_contacts_from_message_field('from', message)[0]
     host = re.match('[^@]*@(.*)', mailfrom.email).group(1)
     result_status = spf.check(i=peer_ip, s=mailfrom.email, h=host)[0]
     if 'pass' in result_status:
         return True
     return False
예제 #2
0
 def auth(self, message_data=None, peer_ip=None, message=None):
     mailfrom = Contact.create_contacts_from_message_field('from',
                                                           message)[0]
     host = re.match('[^@]*@(.*)', mailfrom.email).group(1)
     result_status = spf.check(i=peer_ip, s=mailfrom.email, h=host)[0]
     if 'pass' in result_status:
         return True
     return False
 def test_create_contacts_from_message_field_successfully_creates_contact_object(
         self):
     contacts = Contact.create_contacts_from_message_field(
         'to', self.message)
     self.assertEqual(contacts[0].email, '*****@*****.**')
예제 #4
0
 def test_create_contacts_from_message_field_successfully_creates_contact_object(self):
     contacts = Contact.create_contacts_from_message_field('to', self.message)
     self.assertEqual(contacts[0].email, '*****@*****.**')
예제 #5
0
 def test_create_contacts_from_message_field_successfully_creates_contact_object(
         self):
     contacts = Contact.create_contacts_from_message_field(
         'to', self.message)
     self.assertEqual(contacts[0].email, '*****@*****.**')
     self.assertEqual(contacts[0].name, 'ben coe')
예제 #6
0
 def test_create_contacts_from_message_field_successfully_creates_contact_object(self):
     contacts = Contact.create_contacts_from_message_field('to', self.message)
     self.assertEqual(contacts[0].email, '*****@*****.**')
     self.assertEqual(contacts[0].name, 'ben coe')