0

I've set an smtp server with smtpd python module with a ddns and an MX record. Now I want to receive email from account like google, yahoo etc, the email it is sent but it is never received, it seems that the problem is the email never reach the local user. Sending the email with smtplib works.

    import smtpd
import asyncore

class CustomSMTPServer(smtpd.SMTPServer):


def process_message(self, peer, mailfrom, rcpttos, data):
    print ('Receiving message from:', peer)
    print ('Message addressed from:', mailfrom)
    print ('Message addressed to  :', rcpttos)
    print ('Message length        :', len(data))
    print(data)
    return

server = CustomSMTPServer(('0.0.0.0', 25), None)

asyncore.loop()

How to receive email from account like google and others?

blob
  • 101
  • 1
  • what is see from your program you are opening port 1025 instead of 25. – Zareh Kasparian Jun 05 '20 at 14:23
  • mail servers open port 25 as SMTP service to listen for any incoming email. also, make sure your ip is accessible from outside via an online tool like www.ping.eu(port check option). – Zareh Kasparian Jun 05 '20 at 14:24
  • sorry, port 25 is opened but I can't receive email from gmail and others. The ip is accessible because I can email with the python smtplib. – blob Jun 05 '20 at 14:46
  • sending the email is different than recieving. make sure tha port 25 is acessible from world by the online tool i have given the name please. – Zareh Kasparian Jun 05 '20 at 15:00
  • The port is opened and accessible, gmail doesn't send the email it says domain not found, but it is active and it resolved to the correct ip address with nslookup. Email sent from putsmail.com are received. – blob Jun 08 '20 at 08:33

0 Answers0