Tryign to send mail via a python script by using the local MTA

Joost Molenaar j.j.molenaar at gmail.com
Sun Sep 15 14:59:52 EDT 2013


Since the From address is random, it most likely doesn't exist, which
could be reason for Google's smtp server to reject the message or to
deliver it to spam.

Also, the reverse DNS for 84.200.17.58 does not resolve to
secure.superhost.gr, which could also be reason to reject the message.

On Sun, Sep 15, 2013 at 5:54 PM, Ferrous Cranus <nikos.gr33k at gmail.com> wrote:
> try:
>         # prepare mail data
>         FROM = random_char(10) + '@' + random_char(10) + '.com'
>         TO = "nikos.gr33k at gmail.com"
>
>         SUBJECT = random_char( 50 )
>         MESSAGE = random_char( 500 )
>
>   os.system( "echo %s | mailx -v -r %s -s %s %s" % (MESSAGE, FROM, SUBJECT, TO) )
>
> print( "<h2><font color=blue>%sη αποστολή προς %s επετεύχθη!</font></h2>" % (times, TO) )
>         except Exception as e:
>                 print( "sendmail => ", date, repr( sys.exc_info() ) )
>
> sys.exit(0)
>
> ========================================
> ========================================
>
> I'am still trying to send successfulyl a mail through my local host by using the local MTA, trying to avoid using GMail's SMTP server but the mail never gets send
>
> this is the error message:
>
> [code]
> nikos at superhost.gr [~/www/cgi-bin]# python mail.py
> LOG: MAIN
>   cwd=/home/nikos/public_html/cgi-bin 6 args: send-mail -i -v -r ZYN1KGSCT9 at JRV0CEI7TX.com nikos.gr33k at gmail.com
> LOG: MAIN
>   <= ZYN1KGSCT9 at JRV0CEI7TX.com U=nikos P=local S=1052 id=5235d7f5.bzP0TUy4ZQEOp7Dh%ZYN1KGSCT9 at JRV0CEI7TX.com T="QOU0ULMZBF7RGG7B260YERPPXXLTVQ9WKJ93ZXYABQNNA0XB9I"
> Content-type: text/html; charset=utf-8
>
> <h2><font color=blue>0η αποστολή προς nikos.gr33k at gmail.com επετεύχθη!</font></h2>
> LOG: MAIN
>   cwd=/var/spool/exim 4 args: /usr/sbin/exim -v -Mc 1VLEdZ-0001Xg-6b
> delivering 1VLEdZ-0001Xg-6b
> nikos at superhost.gr [~/www/cgi-bin]# LOG: MAIN
>   SMTP connection outbound 1379260405 1VLEdZ-0001Xg-6b superhost.gr nikos.gr33k at gmail.com
> Connecting to gmail-smtp-in.l.google.com [173.194.70.26]:25 ... connected
>   SMTP<< 220 mx.google.com ESMTP e49si15825947eep.141 - gsmtp
>   SMTP>> EHLO secure.superhost.gr
>   SMTP<< 250-mx.google.com at your service, [84.200.17.58]
>          250-SIZE 35882577
>          250-8BITMIME
>          250-STARTTLS
>          250-ENHANCEDSTATUSCODES
>          250 CHUNKING
>   SMTP>> STARTTLS
>   SMTP<< 220 2.0.0 Ready to start TLS
>   SMTP>> EHLO secure.superhost.gr
>   SMTP<< 250-mx.google.com at your service, [84.200.17.58]
>          250-SIZE 35882577
>          250-8BITMIME
>          250-ENHANCEDSTATUSCODES
>          250 CHUNKING
>   SMTP>> MAIL FROM:<ZYN1KGSCT9 at JRV0CEI7TX.com> SIZE=2090
>   SMTP<< 250 2.1.0 OK e49si15825947eep.141 - gsmtp
>   SMTP>> RCPT TO:<nikos.gr33k at gmail.com>
>   SMTP<< 250 2.1.5 OK e49si15825947eep.141 - gsmtp
>   SMTP>> DATA
>   SMTP<< 354  Go ahead e49si15825947eep.141 - gsmtp
>   SMTP>> writing message and terminating "."
>   SMTP<< 250 2.0.0 OK 1379260407 e49si15825947eep.141 - gsmtp
>   SMTP>> QUIT
> LOG: MAIN
>   => nikos.gr33k at gmail.com R=lookuphost T=remote_smtp H=gmail-smtp-in.l.google.com [173.194.70.26] X=TLSv1:RC4-SHA:128
> LOG: MAIN
>   Completed
> [/code]
>
>
> Since all looks okey why the mail never gets delivered?
> --
> https://mail.python.org/mailman/listinfo/python-list



More information about the Python-list mailing list