Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.os.linux.networking > #2252
| From | Ferrous Cranus <nikos@superhost.gr> |
|---|---|
| Newsgroups | comp.os.linux.networking |
| Subject | Re: Trying to utilize mailx to send mail via apython script |
| Date | 2013-09-06 11:09 +0300 |
| Organization | A noiseless patient Spider |
| Message-ID | <l0c2kd$gl1$1@dont-email.me> (permalink) |
| References | <l0aaf9$2fe$1@dont-email.me> <l0bvs4$3sr$1@dont-email.me> |
Στις 6/9/2013 10:22 πμ, ο/η Todd έγραψε:
>
> On 09/05/2013 09:11 AM, Ferrous Cranus wrote:
> >
> >
> > i as root just installed
> >
> > sendmail and mailx. i have edited the ~/.mailrc to use:
> >
> >
> > nikos@superhost.gr [~/www/cgi-bin]# cat ~/.mailrc
> > account gmail {
> > set smtp-use-starttls
> > set smtp=smtp://smtp.gmail.com:587
> > set smtp-auth=login
> > set smtp-auth-user=may)gmail
> > set smtp-auth-password=my_gmail_pass_not_stupid_enough_to_wite _it_again
> > }e
> >
> >
> >
> > And now i'm trying to:
> >
> >
> > cmd = "echo %s | mailx -A gmail -r %s -s %s %s" % (MESSAGE, FROM,
> > SUBJECT, TO)
> > p=subprocess.Popen( cmd, shell=True, stdout=subprocess.PIPE )
> > output, errors = p.communicate()
> > print( errors, output )
> >
> >
> > Any ideas please why this fails to work?
> > while i remove the '-A gmail' string in the cmd line then i can send
> > fast mail but only to mail containing the @superhost.gr trail.
> >
> > i need to be eble to send to external mails to.
>
> Hi Ferrous,
>
> Your .mailrc syntax is too weird. I place all my parameters
> inside my script.
>
> gMail is a pain in the ... to use with mailx. Here is a test
> script I wrote that should help you. Change the "Your_email_address",
> "Your_other_email_address", and "Your_email_password"
> appropriately
>
> Create a separate mailcert directory, copy your mailcerts
> $ ls
> cert7.db cert8.db key3.db secmod.db
> from your Firefox directory to it, and point your "nss-config-dir"
> at it.
>
> Note that some of my lines scrolled when I pasted.
>
> Good luck,
> -T
>
>
> $ cat MailxTest.gmail
> #!/bin/bash
>
> echo "mailx test" | mailx -v -s `dnsdomainname`" gmail smtp test subject" \
> -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=Your_email_address@gmail.com \
> -S smtp-auth-password="Your_email_password" \
> -S nss-config-dir=/home/linuxutil/mailcerts/ \
> Your_other_email_address@gmail.com
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
}
==============================
cmd = "echo %s | mailx -v gmail -r %s -s %s %s" % ( MESSAGE, FROM,
SUBJECT, TO )
p=subprocess.Popen( cmd, shell=True, stdout=subprocess.PIPE )
output, errors = p.communicate()
print( errors, output )
================================
Output of my attempt to send mail:
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?
--
Webhost <http://superhost.gr>
Back to comp.os.linux.networking | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Trying to utilize mailx to send mail via apython script Ferrous Cranus <nikos@superhost.gr> - 2013-09-05 19:11 +0300
Re: Trying to utilize mailx to send mail via apython script Jorgen Grahn <grahn+nntp@snipabacken.se> - 2013-09-05 18:13 +0000
Re: Trying to utilize mailx to send mail via apython script Ferrous Cranus <nikos@superhost.gr> - 2013-09-06 09:19 +0300
Re: Trying to utilize mailx to send mail via apython script Jorgen Grahn <grahn+nntp@snipabacken.se> - 2013-09-06 08:50 +0000
Re: Trying to utilize mailx to send mail via apython script Ferrous Cranus <nikos@superhost.gr> - 2013-09-06 12:06 +0300
Re: Trying to utilize mailx to send mail via apython script "Jonathan N. Little" <lws4art@gmail.com> - 2013-09-06 14:10 -0400
Re: Trying to utilize mailx to send mail via apython script Ferrous Cranus <nikos@superhost.gr> - 2013-09-07 08:33 +0300
Re: Trying to utilize mailx to send mail via apython script "Jonathan N. Little" <lws4art@gmail.com> - 2013-09-07 08:33 -0400
Re: Trying to utilize mailx to send mail via apython script Ferrous Cranus <nikos@superhost.gr> - 2013-09-07 23:24 +0300
Re: Trying to utilize mailx to send mail via apython script "Jonathan N. Little" <lws4art@gmail.com> - 2013-09-07 16:54 -0400
Re: Trying to utilize mailx to send mail via apython script Ferrous Cranus <nikos@superhost.gr> - 2013-09-08 09:58 +0300
Re: Trying to utilize mailx to send mail via apython script Ferrous Cranus <nikos@superhost.gr> - 2013-09-08 10:57 +0300
Re: Trying to utilize mailx to send mail via apython script "Jonathan N. Little" <lws4art@gmail.com> - 2013-09-08 10:11 -0400
Re: Trying to utilize mailx to send mail via apython script Ferrous Cranus <nikos@superhost.gr> - 2013-09-08 17:16 +0300
Re: Trying to utilize mailx to send mail via apython script Todd <Todd@invalid.invalid> - 2013-09-08 18:23 -0700
Re: Trying to utilize mailx to send mail via apython script Todd <Todd@invalid.invalid> - 2013-09-08 18:35 -0700
Re: Trying to utilize mailx to send mail via apython script "Jonathan N. Little" <lws4art@gmail.com> - 2013-09-09 17:11 -0400
Re: Trying to utilize mailx to send mail via apython script Todd <Todd@invalid.invalid> - 2013-09-09 14:40 -0700
Re: Trying to utilize mailx to send mail via apython script "Jonathan N. Little" <lws4art@gmail.com> - 2013-09-09 18:15 -0400
Re: Trying to utilize mailx to send mail via apython script David Brown <david.brown@removethis.hesbynett.no> - 2013-09-08 16:42 +0200
Re: Trying to utilize mailx to send mail via apython script Ferrous Cranus <nikos@superhost.gr> - 2013-09-08 18:41 +0300
Re: Trying to utilize mailx to send mail via apython script Whiskers <catwheezel@operamail.com> - 2013-09-08 17:56 +0100
Re: Trying to utilize mailx to send mail via apython script Ferrous Cranus <nikos@superhost.gr> - 2013-09-09 11:09 +0300
Re: Trying to utilize mailx to send mail via apython script Whiskers <catwheezel@operamail.com> - 2013-09-09 21:31 +0100
Re: Trying to utilize mailx to send mail via apython script Jorgen Grahn <grahn+nntp@snipabacken.se> - 2013-09-09 19:35 +0000
Re: Trying to utilize mailx to send mail via apython script Todd <Todd@invalid.invalid> - 2013-09-06 00:22 -0700
Re: Trying to utilize mailx to send mail via apython script Ferrous Cranus <nikos@superhost.gr> - 2013-09-06 11:09 +0300
Re: Trying to utilize mailx to send mail via apython script Todd <Todd@invalid.invalid> - 2013-09-07 15:39 -0700
Re: Trying to utilize mailx to send mail via apython script Todd <Todd@invalid.invalid> - 2013-09-07 15:41 -0700
Re: Trying to utilize mailx to send mail via apython script Todd <Todd@invalid.invalid> - 2013-09-07 16:20 -0700
Re: Trying to utilize mailx to send mail via apython script Ferrous Cranus <nikos@superhost.gr> - 2013-09-08 09:54 +0300
Re: Trying to utilize mailx to send mail via apython script Todd <Todd@invalid.invalid> - 2013-09-08 13:15 -0700
Re: Trying to utilize mailx to send mail via apython script Ferrous Cranus <nikos@superhost.gr> - 2013-09-09 11:29 +0300
Re: Trying to utilize mailx to send mail via apython script Todd <Todd@invalid.invalid> - 2013-09-09 11:44 -0700
Re: Trying to utilize mailx to send mail via apython script Whiskers <catwheezel@operamail.com> - 2013-09-09 22:07 +0100
Re: Trying to utilize mailx to send mail via apython script "Jonathan N. Little" <lws4art@gmail.com> - 2013-09-09 17:33 -0400
Re: Trying to utilize mailx to send mail via apython script Whiskers <catwheezel@operamail.com> - 2013-09-10 16:38 +0100
Re: Trying to utilize mailx to send mail via apython script Ferrous Cranus <nikos@superhost.gr> - 2013-09-10 22:37 +0300
Re: Trying to utilize mailx to send mail via apython script David Brown <david.brown@removethis.hesbynett.no> - 2013-09-10 23:04 +0200
Re: Trying to utilize mailx to send mail via apython script Whiskers <catwheezel@operamail.com> - 2013-09-10 22:05 +0100
Re: Trying to utilize mailx to send mail via apython script David Brown <david@westcontrol.removethisbit.com> - 2013-09-06 11:10 +0200
Re: Trying to utilize mailx to send mail via apython script Ferrous Cranus <nikos@superhost.gr> - 2013-09-06 12:17 +0300
Re: Trying to utilize mailx to send mail via apython script David Brown <david.brown@removethis.hesbynett.no> - 2013-09-08 16:34 +0200
Re: Trying to utilize mailx to send mail via apython script Ferrous Cranus <nikos@superhost.gr> - 2013-09-08 18:37 +0300
Re: Trying to utilize mailx to send mail via apython script David Brown <david.brown@removethis.hesbynett.no> - 2013-09-09 01:57 +0200
csiph-web