Update mailserver.py

Some sender will send emails to capitalized receiver mail.
The counterpart "is_dir" (php) is case sensitive on Unix-systems, so if you check mails for mymail@domain.tld you will not see mails sent to MYMAIL@DOMAIN.TLD.
This change will make sure that only lower-case is used to create a receiver-folder.
This commit is contained in:
EOCommunity 2021-04-04 23:01:02 +02:00 committed by GitHub
parent c8faaf1cff
commit cc3ce6c440
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -89,7 +89,7 @@ class CustomSMTPServer(smtpd.SMTPServer):
filenamebase = str(int(round(time.time() * 1000)))
for em in rcpttos:
for em.lower in rcpttos:
if not os.path.exists("../data/"+em):
os.mkdir( "../data/"+em, 0755 )
@ -133,4 +133,4 @@ if __name__ == '__main__':
server = CustomSMTPServer(('0.0.0.0', port), None) # use your public IP here
print "[i] Ready to receive Emails"
print ""
asyncore.loop()
asyncore.loop()