September 6th, 2013, 04:12 AM
-
Trying to send mail by using 'mailx' and 'sendmail'
Code:
nikos@superhost.gr [~/www/cgi-bin]# cat ~/.mailrc
account gmail {
-S smtp-use-starttls \
-S ssl-verify=ignore \
-S smtp-auth=login \
-S smtp=smtp://smtp.gmail.com:587 \
-S from=Your_email_address@gmail.com \
-S smtp-auth-user=my_personal@gmail.com \
-S smtp-auth-password="my_gmail_pass" \
-S nss-config-dir=/home/nikos/certs/ \
nkouras@ath.forthnet.gr
}
==============================
Code:
os.system( "echo %s | mailx -v gmail -r %s -s %s %s" % (MESSAGE, FROM, SUBJECT, TO) )
================================
Output of my attempt to send mail:
Code:
nikos@superhost.gr [~/www/cgi-bin]# python mail.py
LOG: MAIN
cwd=/home/nikos/public_html/cgi-bin 9 args: send-mail -i -v -r -s 5N3COMBGE8@YEG0WH73G3.com BD1ZJHE1340OB76AYIM81YP51VBYFCR5B2BCH08LKVT06T5I9E gmail nikos.gr33k@gmail.com
LOG: MAIN
<= -s@secure.superhost.gr U=nikos P=local S=1125
Content-type: text/html; charset=utf-8
None b''
<h2><font color=blue>Ευχαριστώ πολύ για το ενδιαφέρον! Θα επικοινωνήσω μαζί σου άμεσα :-)</font></h2>
LOG: MAIN
cwd=/var/spool/exim 4 args: /usr/sbin/exim -v -Mc 1VHr2Y-0004wE-RL
delivering 1VHr2Y-0004wE-RL
nikos@superhost.gr [~/www/cgi-bin]# LOG: MAIN
SMTP connection outbound 1378454714 1VHr2Y-0004wE-RL superhost.gr nikos.gr33k@gmail.com
LOG: MAIN
SMTP connection outbound 1378454714 1VHr2Y-0004wE-RL superhost.gr gmail@secure.superhost.gr
LOG: MAIN
remote host address is the local host: secure.superhost.gr
LOG: MAIN
== gmail@secure.superhost.gr R=lookuphost defer (-1): remote host address is the local host
LOG: MAIN
SMTP connection outbound 1378454715 1VHr2Y-0004wE-RL superhost.gr bd1zjhe1340ob76ayim81yp51vbyfcr5b2bch08lkvt06t5i9e@secure.superhost.gr
LOG: MAIN
remote host address is the local host: secure.superhost.gr
LOG: MAIN
== bd1zjhe1340ob76ayim81yp51vbyfcr5b2bch08lkvt06t5i9e@secure.superhost.gr <BD1ZJHE1340OB76AYIM81YP51VBYFCR5B2BCH08LKVT06T5I9E@secure.superhost.gr> R=lookuphost defer (-1): remote host address is the local host
LOG: MAIN
SMTP connection outbound 1378454715 1VHr2Y-0004wE-RL superhost.gr 5n3combge8@yeg0wh73g3.com
LOG: MAIN
** 5n3combge8@yeg0wh73g3.com <5N3COMBGE8@YEG0WH73G3.com> R=fail_remote_domains: The mail server could not deliver mail to 5n3combge8@yeg0wh73g3.com. The account or domain may not exist, they may be blacklisted, or missing the proper dns entries.
Connecting to gmail-smtp-in.l.google.com [173.194.70.26]:25 ... connected
SMTP<< 220 mx.google.com ESMTP w44si1186161eef.195 - 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:<-s@secure.superhost.gr> SIZE=2165
SMTP<< 250 2.1.0 OK w44si1186161eef.195 - gsmtp
SMTP>> RCPT TO:<nikos.gr33k@gmail.com>
SMTP<< 250 2.1.5 OK w44si1186161eef.195 - gsmtp
SMTP>> DATA
SMTP<< 354 Go ahead w44si1186161eef.195 - gsmtp
SMTP>> writing message and terminating "."
SMTP<< 250 2.0.0 OK 1378454716 w44si1186161eef.195 - gsmtp
SMTP>> QUIT
LOG: MAIN
=> nikos.gr33k@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
** BD1ZJHE1340OB76AYIM81YP51VBYFCR5B2BCH08LKVT06T5I9E@secure.superhost.gr: retry timeout exceeded
LOG: MAIN
** gmail@secure.superhost.gr: retry timeout exceeded
LOG: MAIN
cwd=/var/spool/exim 8 args: /usr/sbin/exim -v -t -oem -oi -f <> -E1VHr2Y-0004wE-RL
LOG: MAIN
<= <> R=1VHr2Y-0004wE-RL U=mailnull P=local S=2374 T="Mail delivery failed: returning message to sender"
LOG: MAIN
Completed
LOG: MAIN
cwd=/var/spool/exim 4 args: /usr/sbin/exim -v -Mc 1VHr2a-0004wK-G7
delivering 1VHr2a-0004wK-G7
LOG: MAIN
remote host address is the local host: secure.superhost.gr
LOG: MAIN
== -s@secure.superhost.gr R=dkim_lookuphost defer (-1): remote host address is the local host
LOG: MAIN
** -s@secure.superhost.gr: retry timeout exceeded
LOG: MAIN
-s@secure.superhost.gr: error ignored
LOG: MAIN
Completed
I have pasted the .mailrc, the snippet of mail.py and the output
Can you help based on that info please?
i can only send mail from local=>local
and not from local=>external
somehtign needs configuration.
Ant he mail has to work from within a python script