Created
July 27, 2016 10:41
-
-
Save yudai09/36e9d9344eb69b0cfac05cd26ee33acf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(('127.0.0.1', 1025), None) | |
asyncore.loop() | |
if __name__ == '__main__': | |
start_smtpd() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This script implements simple SMTP server which always reject emails.
you can run this script like below.
$ nohup python reject_smtpd.py &