Hack Forums
[Python] EMAIL SORTER NEEDED. +EASY TO EDIT+ - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [Python] EMAIL SORTER NEEDED. +EASY TO EDIT+ (/showthread.php?tid=5979556)



EMAIL SORTER NEEDED. +EASY TO EDIT+ - zelus - Jun 13, 2019

Just as the Title said.

Am looking for an email sorter coded in Python.

The emails will be sorted based on their MX records.

There are already appsfor this but the number domain is mostly limited.

So I need what adding domains into it will not turn to rocket science.

If you can do this, just comment on what exactly you can do and maybe price.

I will contact via PM.

Do not ask me for my budget as Some of these cost $20.

Does not mean my budget is $20 though.


RE: EMAIL SORTER NEEDED. +EASY TO EDIT+ - hessu1335 - Jun 15, 2019

Hey, I can do this for you easily and fast, maybe you can add email addresses in a txt file and the script will output sorted mx, is that you want?


RE: EMAIL SORTER NEEDED. +EASY TO EDIT+ - zelus - Jun 16, 2019

(Jun 15, 2019 11:19 PM)hessu1335 Wrote:  Hey, I can do this for you easily and fast, maybe you can add email addresses in a txt file and the script will output sorted mx, is that you want?

Someone has already done it for me. But if you can do it and its different from what i have, i will pay you too.


RE: EMAIL SORTER NEEDED. +EASY TO EDIT+ - hessu1335 - Jun 16, 2019

Code
def main():
   f = open("mails.txt", "r")
   if f.mode == "r":
       content = f.read()
       sorted_list = sorted(content.split(), key=lambda x: x.lower().split('@')[1])
       
       for item in sorted_list:
           print(item)

if __name__ == "__main__":
   main()

This will do the job, use a list of emails in a file "emails.txt" in the same folder as the script, run python3 [name_of_script.py]
Insensitive sort alphabetical


RE: EMAIL SORTER NEEDED. +EASY TO EDIT+ - l0lwtf - Jun 23, 2019

This will do the job as well LOL.

Code
sort -t@ -k2 mails.txt



RE: EMAIL SORTER NEEDED. +EASY TO EDIT+ - whitekremlin - Aug 20, 2019

(Jun 16, 2019 03:07 AM)zelus Wrote:  Someone has already done it for me. But if you can do it and its different from what i have, i will pay you too.

could you link me with the email sorter person pls?