[Tutor] python smtplib 'Message denied - From address spoofing attempt detected via SMTP

Joel Goldstick joel.goldstick at gmail.com
Fri Mar 25 14:54:02 EDT 2016


On Fri, Mar 25, 2016 at 2:34 PM, nitin chandra <nitinchandra1 at gmail.com>
wrote:

> Hi All,
>
> I am trying to script a confirmation mail on submission of a form.
>
> Till now the form submission and summery page is working.
>
> BUT the following 'section' is not working.
> -- This is a python(CGI) script
> -- hosted on a shared server on hostgator.in
>
> -- This is giving "250 Spoofing error ....", below copy/pasted error
> log of apache with respect to my website
>
> *************** script ****************
> import smtplib
>
> ######### Sending Registration Confirmation Mail #######
> fromJSSHS = 'no-reply at jsshs.org'
> toJSSHS = [(str(email)), ' ******@chandrainformatics.com']
>
> SubjectJssHs = "Registration confirmation with JSSHS"
>
> TextJsshs = """
> ApplicationID : jssh%s
> FirstNAME     : %s
> LastNAME      : %s
> Gender        : %s
> DoB           : %s
> Age           : %s
> Category      : %s
> Post          : %s
> Phone M       : %s
> Phone LL      : %s
> Email         : %s
> Submission DT : %s
> Submission Time  : %s
>
> Also get your original certificates.
> """ %
> (str(applicationIDlst),str(nameDBlst),str(lnameDBlst),str(genderDBlst),str(dob_DBlst),str(ageDBlst),str(categoryDBlst),str(postDBlst),str(phmDBlst),str(phllDBlst),str(emailDBlst),datetime.datetime.strptime(str(submissionDate_DBlst2),'%Y-%m-%d').strftime('%d/%m/%Y'),str(submissionTime_DBlst))
>
> messageJSSHS = """
> From : %s
> To : %s
> Subject : %s
>
> %s
>
> """ % (fromJSSHS,",".join(toJSSHS), SubjectJssHs, TextJsshs)
>
> server = smtplib.SMTP('mail.jsshs.org', 25)
> server.set_debuglevel(1)
> server.ehlo()
> server.starttls()
> server.ehlo()
> server.login(fromJSSHS, '******')
> server.sendmail(fromJSSHS, toJSSHS, messageJSSHS)
> server.quit()
>
>
> ##### ERROR BELOW ####
>
> [Wed Mar 23 17:14:48 2016] [error] [client 182.68.165.86] Premature
> end of script headers: application.cgi, referer:
> http://jsshs.org/application.html [Wed Mar 23 17:14:48 2016] [error]
> [client 182.68.165.86] File does not exist:
> /home/jsshsbtl/public_html/500.shtml, referer:
> http://jsshs.org/application.html send: 'mail
> FROM:<no-reply at jsshs.org> size=474\r\n' send: "\r\nFrom :
> no-reply at jsshs.org\r\nTo : ['drashokkr007 at yahoo.com',
> 'nitin at chandrainformatics.com']\r\nSubject : Registration confirmation
> with JSSHS\r\n\r\n\r\nApplicationID : jsshs28\r\nFirstNAME :
> mukesh\r\nLastNAME : kumar\r\nGender : male\r\nDoB : 15/09/1982\r\nAge
> : 34\r\nCategory : scst\r\nPost : paramedical\r\nPhone M :
> 9872342266\r\nPhone LL : 01124893479\r\nEmail :
> drashokkr007 at yahoo.com\r\nSubmission DT : 23/03/2016\r\nSubmission
> Time : 05:38PM\r\n\r\n.\r\n" reply: '250 Message denied - From address
> spoofing attempt detected via SMTP ( From address: IP: 111.118.215.222
> AuthenticatedID: no-reply at jsshs.org Protocol: esmtpa)\r\n' reply:
> retcode (250); Msg: Message denied - From address spoofing attempt
> detected via SMTP ( From address: IP: 111.118.215.222 AuthenticatedID:
> no-reply at jsshs.org Protocol: esmtpa) data: (250, 'Message denied -
> From address spoofing attempt detected via SMTP ( From address: IP:
> 111.118.215.222 AuthenticatedID: no-reply at jsshs.org Protocol:
> esmtpa)')
>
>
> Thanks
>
> Nitin
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor
>

According to this page:
http://www.answersthatwork.com/Download_Area/ATW_Library/Networking/Network__3-SMTP_Server_Status_Codes_and_SMTP_Error_Codes.pdf

You have succeeded in sending your message.  Does the message get sent?

-- 
Joel Goldstick
http://joelgoldstick.com/ <http://joelgoldstick.com/stats/birthdays>
http://cc-baseballstats.info/


More information about the Tutor mailing list