Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
from smtpd import SMTPServer
import asyncore
class RejectSMTPServer(SMTPServer):
def process_message(self, peer, mailfrom, rcpttos, data):
return '500 Error'
def start_smtpd():
server = RejectSMTPServer(('', 1025), None)
if __name__ == '__main__':

yudai09 commented Jul 27, 2016

This script implements simple SMTP server which always reject emails.
you can run this script like below.
$ nohup python &

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment