Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Python 

[HELP]Python smtplib.

Hey Folks.

I'm trying to write a simple mail spoof tool but I'm stuck in one place.
The code works and can send mail but due to some sort of filter every time i try to pass anything that contains "@" as a 'from' google and yahoo are changing the header to the original email or nothing.

Below is the snippet from my code.

Code
spoof= '[email protected]'
msg = 'From:'+spoof + '\nSubject: ' + subject + '\n' + body
     server.sendmail(user,to,msg)

This is the format of the email. Variable spoof is the spoofed email. If i use a name or anything else that doesn't include @ it works. Also if i pass something like [[email protected]] it will work but then email will show up in this form in the mailbox.
Can anyone point me in the right direction? How to escape these characters or how to trick email provider into displaying it correctly. Maybe some encoding? Any and all help appreciated.

Edit: I'v tried yagmail module already. It is very simple to implement but suffers from the same issue.
[Image: V9Gredc.png]
Immediately, I can recognize that is not how SMTP is supposed to be formatted.

Take 2 seconds to check the RFC:
https://tools.ietf.org/html/rfc5321#section-2.3.8
SRPP Discord Server

I am a professional network/cloud security architect.
My Old Tutorials
(Nov 22, 2016 03:17 PM)Goodies Wrote:  Immediately, I can recognize that is not how SMTP is supposed to be formatted.

Take 2 seconds to check the RFC:
https://tools.ietf.org/html/rfc5321#section-2.3.8

Thanks Goodies!! I would marry you if you were a woman! lol Thanks to your advice i figured it out.
[Image: V9Gredc.png]
(Nov 22, 2016 03:48 PM)Malicious Intent Wrote:  Thanks Goodies!! I would marry you if you were a woman! lol Thanks to your advice i figured it out.

Glad I could help 🤝
SRPP Discord Server

I am a professional network/cloud security architect.
My Old Tutorials


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Python] by Bass_ReevesAug 20, 2023 01:44 AM 9 631 Aug 20, 2023 01:44 AM
Last Post: Lucky4L
[Python] by SenatorTedCruzDec 8, 2019 10:16 PM 0 226 Dec 8, 2019 10:16 PM
Last Post: SenatorTedCruz
[Python] by MorphineJun 29, 2017 03:54 PM 3 279 Jun 29, 2017 03:54 PM
Last Post: arkoydas