Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.os.linux.networking > #2248 > unrolled thread

Trying to utilize mailx to send mail via apython script

Started byFerrous Cranus <nikos@superhost.gr>
First post2013-09-05 19:11 +0300
Last post2013-09-09 01:57 +0200
Articles 20 on this page of 45 — 7 participants

Back to article view | Back to comp.os.linux.networking


Contents

  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

Page 2 of 3 — ← Prev page 1 [2] 3  Next page →


#2274

FromFerrous Cranus <nikos@superhost.gr>
Date2013-09-08 18:41 +0300
Message-ID<l0i5rr$out$1@dont-email.me>
In reply to#2272
Στις 8/9/2013 5:42 μμ, ο/η David Brown έγραψε:
> Put another way, do /not/ do this.  If you are sending email, then /you/
> are sending it.  If /your/ server is sending email, then the "from" and
> "sender" addresses should be /your/ server or related email addresses.
> It is basically fraud to say that someone else sent the email, even if
> that someone had filled in the web form for the email.


No it is not.

My web form at http://superhost.gr ask the visitor for his mail address 
and asks him for the subject to.

I want those the visitor used to be seen as FROM and MESSAGE and not my 
gmail addres as sender.

Is there a way to make this work?

-- 
Webhost <http://superhost.gr>

[toc] | [prev] | [next] | [standalone]


#2275

FromWhiskers <catwheezel@operamail.com>
Date2013-09-08 17:56 +0100
Message-ID<slrnl2pb21.1t7.catwheezel@ID-107770.user.individual.net>
In reply to#2274
On 2013-09-08, Ferrous Cranus <nikos@superhost.gr> wrote:
> Στις 8/9/2013 5:42 μμ, ο/η David Brown έγραψε:
>> Put another way, do /not/ do this.  If you are sending email, then /you/
>> are sending it.  If /your/ server is sending email, then the "from" and
>> "sender" addresses should be /your/ server or related email addresses.
>> It is basically fraud to say that someone else sent the email, even if
>> that someone had filled in the web form for the email.
>
>
> No it is not.
>
> My web form at http://superhost.gr ask the visitor for his mail address 
> and asks him for the subject to.
>
> I want those the visitor used to be seen as FROM and MESSAGE and not my 
> gmail addres as sender.
>
> Is there a way to make this work?

If you use the Gmail SMTP server to deliver an email, you cannot stop
Google from adding whatever header information they want.  

Google may well object to your Gmail account being used to send emails
not coming from you, indeed they should reject any such email - and
terminate your Gmail account if it happens more than a few times.  The
only exception may be that Google will let you 'register' particular
email addresses which are not provided by them, so that you can send
messages 'from' those addresses using their server; I don't know if
Google charge extra for that service.  The headers available to the
recipient will show that Gmail have 'relayed' the message, and will show
the public IP number of the internet connection used for initiating the
email, and whatever hostname your system identifies itself with when
logging in to the Gmail server.

If your visitors have email addresses of their own already, why not let
them log in to their own email accounts instead of trying to use your
Gmail account? 

-- 
-- ^^^^^^^^^^
--  Whiskers 
-- ~~~~~~~~~~

[toc] | [prev] | [next] | [standalone]


#2280

FromFerrous Cranus <nikos@superhost.gr>
Date2013-09-09 11:09 +0300
Message-ID<l0jvoi$j9f$1@dont-email.me>
In reply to#2275
Στις 8/9/2013 7:56 μμ, ο/η Whiskers έγραψε:
> The
> only exception may be that Google will let you 'register' particular
> email addresses which are not provided by them, so that you can send
> messages 'from' those addresses using their server; I don't know if
> Google charge extra for that service.

What do you mean by Google letting me 'register' some mail address?
I dont unserstand that sentence.

Will it still add up Sender Header of it own?

-- 
Webhost <http://superhost.gr>

[toc] | [prev] | [next] | [standalone]


#2285

FromWhiskers <catwheezel@operamail.com>
Date2013-09-09 21:31 +0100
Message-ID<slrnl2sc0t.38c.catwheezel@ID-107770.user.individual.net>
In reply to#2280
On 2013-09-09, Ferrous Cranus <nikos@superhost.gr> wrote:
> Στις 8/9/2013 7:56 μμ, ο/η Whiskers έγραψε:
>> The
>> only exception may be that Google will let you 'register' particular
>> email addresses which are not provided by them, so that you can send
>> messages 'from' those addresses using their server; I don't know if
>> Google charge extra for that service.
>
> What do you mean by Google letting me 'register' some mail address?
> I dont unserstand that sentence.

Go to <https://support.google.com/mail/answer/22370?hl=en-GB&ctx=mail>
"Sending mail from a different address".

,----
| Gmail lets you send messages with another of your email addresses listed
| as the sender instead of your Gmail address. This feature helps you
| manage multiple accounts from the Gmail interface; it works only if you
| already own the email account linked to the alternate address.  [...]
`----

> Will it still add up Sender Header of it own?

I wouldn't be at all surprised.  If you don't want Google to 'stamp'
your mail, don't send it using Google.

-- 
-- ^^^^^^^^^^
--  Whiskers 
-- ~~~~~~~~~~

[toc] | [prev] | [next] | [standalone]


#2284

FromJorgen Grahn <grahn+nntp@snipabacken.se>
Date2013-09-09 19:35 +0000
Message-ID<slrnl2s8n6.2m9.grahn+nntp@frailea.sa.invalid>
In reply to#2267
On Sun, 2013-09-08, Ferrous Cranus wrote:
...
> I want to avoid using GMail's service because it adds up a Sender: 
> header saying that the mail originating from my gmail accoutn while i 
> want to use the FROM field that the visitor used in my html web form to 
> fill in his email

You've mentioned this several times. What's the problem? It seems like
a sane and sensible thing for GMail to do, and also a harmless one.
RFC 2822 indicates Sender: and From: can be seen as "the guy who sent
the message; pressed the button" and "the guy who wrote it and is
responsible for it".

And doesn't that describe what you're aiming for?

   The originator fields of a message consist of the from field, the
   sender field (when applicable), and optionally the reply-to field.
   ...  If the from field contains more than one mailbox specification
   in the mailbox-list, then the sender field ... MUST appear in the
   message.  In either case, an optional reply-to field MAY also be
   included ...

   The originator fields indicate the mailbox(es) of the source of the
   message.  The "From:" field specifies the author(s) of the message,
   that is, the mailbox(es) of the person(s) or system(s) responsible
   for the writing of the message.  The "Sender:" field specifies the
   mailbox of the agent responsible for the actual transmission of the
   message.  For example, if a secretary were to send a message for
   another person, the mailbox of the secretary would appear in the
   "Sender:" field and the mailbox of the actual author would appear in
   the "From:" field. ...

   The originator fields also provide the information required when
   replying to a message.  When the "Reply-To:" field is present, it
   indicates the mailbox(es) to which the author of the message suggests
   that replies be sent.  In the absence of the "Reply-To:" field,
   replies SHOULD by default be sent to the mailbox(es) specified in the
   "From:" field unless otherwise specified by the person composing the
   reply.

This part is also nice:

   In all cases, the "From:" field SHOULD NOT contain any mailbox that
   does not belong to the author(s) of the message.

/Jorgen

-- 
  // Jorgen Grahn <grahn@  Oo  o.   .     .
\X/     snipabacken.se>   O  o   .

[toc] | [prev] | [next] | [standalone]


#2251

FromTodd <Todd@invalid.invalid>
Date2013-09-06 00:22 -0700
Message-ID<l0bvs4$3sr$1@dont-email.me>
In reply to#2248
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





-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
the riddle wrapped in an enigma wrapped
in a couple slices of baloney
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

[toc] | [prev] | [next] | [standalone]


#2252

FromFerrous Cranus <nikos@superhost.gr>
Date2013-09-06 11:09 +0300
Message-ID<l0c2kd$gl1$1@dont-email.me>
In reply to#2251
Στις 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>

[toc] | [prev] | [next] | [standalone]


#2263

FromTodd <Todd@invalid.invalid>
Date2013-09-07 15:39 -0700
Message-ID<l0g9vh$g1k$1@dont-email.me>
In reply to#2252
On 09/06/2013 01:09 AM, Ferrous Cranus wrote:
> Στις 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?


Don't use mailrc until you get it working from a batch file.




-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
the riddle wrapped in an enigma wrapped
in a couple slices of baloney
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

[toc] | [prev] | [next] | [standalone]


#2264

FromTodd <Todd@invalid.invalid>
Date2013-09-07 15:41 -0700
Message-ID<522BAB99.8040705@invalid.invalid>
In reply to#2252
> Please elaborate.
>
>
> --
> Webhost <http://superhost.gr>
>

replying over on comp.os.linux.networking

[toc] | [prev] | [next] | [standalone]


#2265

FromTodd <Todd@invalid.invalid>
Date2013-09-07 16:20 -0700
Message-ID<l0gccn$r86$1@dont-email.me>
In reply to#2251
On 09/06/2013 12:37 AM, Νίκος - Support wrote:> Στις 6/9/2013 10:20 πμ, 
ο/η 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
 >
 > Hello Todd,
 >
 > Do i download them from Google? What
 > their use?
 > i don't user FF i use Chrome instead.
 >

 > Please elaborate.

Certainly!  gmail and zmail (zoho.com) are both huge
pains in the --- to get working from a script.

Hi Νίκος,

The batch script is how to send "From:" a gmail
account with a batch script using mailx.  The
"To:" can be anyone.

I also have a script to do the same thing from a
zoho account (zmail), if anyone wants it.

First let me write the comments in my batch file a little better.
Remember, this BASH script is a only for sending from a script
through gMail.

-------- 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=From_email_address@gmail.com \
-S smtp-auth-user=From_email_address@gmail.com \
-S smtp-auth-password="From_email_password" \
-S nss-config-dir=/home/linuxutil/mailcerts/ \
To_email_address@gmail.com

---------------------------------------------------

 > i want to try your example but i don't know where i'm
 > supposed to find the cert* and key* files.

You will find them in your gMail profile.  Your profile
is in your home directory under
      $HOME/.mozilla/firefox/your_profiles_cypher_name

1) install firefox

2) start firefox and let it automatically create its first
    profile

3) open a terminal/xterm in your home directory

4) search for the certificates with
      find $HOME/.mozilla/firefox -iname \*cert\*.db
    remember to copy all the *.db's over from your profile
    to a separate directory.  Mine are:

          cert7.db  cert8.db  key3.db  secmod.db

    Firefox needs these certificates to do the "s" in https

5) modify "nss-config-dir=/home/linuxutil/mailcerts/" in
    the above script to match the directory you copied the
    certificates to


 > What are the mailcerts anyway?

gMail uses SSL (secure socket layer or the "s" in https) and
need these certificates to authenticate.  So does zmail, but
uses a different sign in method.

 > The code above is supposed to be use in a file called
 > 'MailxTest.gmail'

This is a Bash script.  The first line in the script "#!/bin/bash"
tells you this.

 > not from within a python script i have called 'mail.py' ?

No.  Not to a Python script.  Get it working in Bash first,
them translate it to Python.  YOUR PYTHON SUBROUTINE WILL NEED
THESE CERTIFICATES TOO!  If you can get it working in BASH,
you are 90% of the way there.

 > Also what is the other thing at the end
 > you_other_email_address@gmail.com

My bad.  I should have said it was the gMail "To"
address, which can be anyone.

Good luck, I am dying to know if this helped you or
anyone else.  I am usually the one asking the questions.

-T

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Computers are like air conditioners.
They malfunction when you open windows
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

[toc] | [prev] | [next] | [standalone]


#2266

FromFerrous Cranus <nikos@superhost.gr>
Date2013-09-08 09:54 +0300
Message-ID<l0h6ub$3mb$1@dont-email.me>
In reply to#2265
Στις 8/9/2013 2:20 πμ, ο/η Todd έγραψε:
> On 09/06/2013 12:37 AM, Νίκος - Support wrote:> Στις 6/9/2013 10:20 πμ,
> ο/η 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
>  >
>  > Hello Todd,
>  >
>  > Do i download them from Google? What
>  > their use?
>  > i don't user FF i use Chrome instead.
>  >
>
>  > Please elaborate.
>
> Certainly!  gmail and zmail (zoho.com) are both huge
> pains in the --- to get working from a script.
>
> Hi Νίκος,
>
> The batch script is how to send "From:" a gmail
> account with a batch script using mailx.  The
> "To:" can be anyone.
>
> I also have a script to do the same thing from a
> zoho account (zmail), if anyone wants it.
>
> First let me write the comments in my batch file a little better.
> Remember, this BASH script is a only for sending from a script
> through gMail.
>
> -------- 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=From_email_address@gmail.com \
> -S smtp-auth-user=From_email_address@gmail.com \
> -S smtp-auth-password="From_email_password" \
> -S nss-config-dir=/home/linuxutil/mailcerts/ \
> To_email_address@gmail.com
>
> ---------------------------------------------------
>
>  > i want to try your example but i don't know where i'm
>  > supposed to find the cert* and key* files.
>
> You will find them in your gMail profile.  Your profile
> is in your home directory under
>       $HOME/.mozilla/firefox/your_profiles_cypher_name
>
> 1) install firefox
>
> 2) start firefox and let it automatically create its first
>     profile
>
> 3) open a terminal/xterm in your home directory
>
> 4) search for the certificates with
>       find $HOME/.mozilla/firefox -iname \*cert\*.db
>     remember to copy all the *.db's over from your profile
>     to a separate directory.  Mine are:
>
>           cert7.db  cert8.db  key3.db  secmod.db
>
>     Firefox needs these certificates to do the "s" in https
>
> 5) modify "nss-config-dir=/home/linuxutil/mailcerts/" in
>     the above script to match the directory you copied the
>     certificates to
>
>
>  > What are the mailcerts anyway?
>
> gMail uses SSL (secure socket layer or the "s" in https) and
> need these certificates to authenticate.  So does zmail, but
> uses a different sign in method.
>
>  > The code above is supposed to be use in a file called
>  > 'MailxTest.gmail'
>
> This is a Bash script.  The first line in the script "#!/bin/bash"
> tells you this.
>
>  > not from within a python script i have called 'mail.py' ?
>
> No.  Not to a Python script.  Get it working in Bash first,
> them translate it to Python.  YOUR PYTHON SUBROUTINE WILL NEED
> THESE CERTIFICATES TOO!  If you can get it working in BASH,
> you are 90% of the way there.
>
>  > Also what is the other thing at the end
>  > you_other_email_address@gmail.com
>
> My bad.  I should have said it was the gMail "To"
> address, which can be anyone.
>
> Good luck, I am dying to know if this helped you or
> anyone else.  I am usually the one asking the questions.
>
> -T
>
Hello Todd!

Let me tell you what i did:

i have:

rm ~./mailrc

nikos@superhost.gr [~]# 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=my@gmail.com \
-S smtp-auth-password="my_gmail_pass" \
-S nss-config-dir=/home/nikos/certs/ \
nikos@ath.forthnet.gr

chmod u+x MailXTest.gmail

and finally when i try to run it:

nikos@superhost.gr [~]# MailXTest.gmail
-bash: MailXTest.gmail: command not found

What iam doing?

Apart from that i want to avoid using GMail's service becazue it adds up 
a Sender: header sayign that the mail originating from my gmail accoutn 
while i want to use the FROM field that the visitor used in my html web 
form to fill in his email

Also it would be nice if the hostname would appear too.

Do we need to setup our own mail servr to achieve this?

-- 
Webhost <http://superhost.gr>

[toc] | [prev] | [next] | [standalone]


#2276

FromTodd <Todd@invalid.invalid>
Date2013-09-08 13:15 -0700
Message-ID<l0ilsd$mdg$1@dont-email.me>
In reply to#2266
On 09/07/2013 11:54 PM, Ferrous Cranus wrote:
> Στις 8/9/2013 2:20 πμ, ο/η Todd έγραψε:
>> On 09/06/2013 12:37 AM, Νίκος - Support wrote:> Στις 6/9/2013 10:20 πμ,
>> ο/η 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
>>  >
>>  > Hello Todd,
>>  >
>>  > Do i download them from Google? What
>>  > their use?
>>  > i don't user FF i use Chrome instead.
>>  >
>>
>>  > Please elaborate.
>>
>> Certainly!  gmail and zmail (zoho.com) are both huge
>> pains in the --- to get working from a script.
>>
>> Hi Νίκος,
>>
>> The batch script is how to send "From:" a gmail
>> account with a batch script using mailx.  The
>> "To:" can be anyone.
>>
>> I also have a script to do the same thing from a
>> zoho account (zmail), if anyone wants it.
>>
>> First let me write the comments in my batch file a little better.
>> Remember, this BASH script is a only for sending from a script
>> through gMail.
>>
>> -------- 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=From_email_address@gmail.com \
>> -S smtp-auth-user=From_email_address@gmail.com \
>> -S smtp-auth-password="From_email_password" \
>> -S nss-config-dir=/home/linuxutil/mailcerts/ \
>> To_email_address@gmail.com
>>
>> ---------------------------------------------------
>>
>>  > i want to try your example but i don't know where i'm
>>  > supposed to find the cert* and key* files.
>>
>> You will find them in your gMail profile.  Your profile
>> is in your home directory under
>>       $HOME/.mozilla/firefox/your_profiles_cypher_name
>>
>> 1) install firefox
>>
>> 2) start firefox and let it automatically create its first
>>     profile
>>
>> 3) open a terminal/xterm in your home directory
>>
>> 4) search for the certificates with
>>       find $HOME/.mozilla/firefox -iname \*cert\*.db
>>     remember to copy all the *.db's over from your profile
>>     to a separate directory.  Mine are:
>>
>>           cert7.db  cert8.db  key3.db  secmod.db
>>
>>     Firefox needs these certificates to do the "s" in https
>>
>> 5) modify "nss-config-dir=/home/linuxutil/mailcerts/" in
>>     the above script to match the directory you copied the
>>     certificates to
>>
>>
>>  > What are the mailcerts anyway?
>>
>> gMail uses SSL (secure socket layer or the "s" in https) and
>> need these certificates to authenticate.  So does zmail, but
>> uses a different sign in method.
>>
>>  > The code above is supposed to be use in a file called
>>  > 'MailxTest.gmail'
>>
>> This is a Bash script.  The first line in the script "#!/bin/bash"
>> tells you this.
>>
>>  > not from within a python script i have called 'mail.py' ?
>>
>> No.  Not to a Python script.  Get it working in Bash first,
>> them translate it to Python.  YOUR PYTHON SUBROUTINE WILL NEED
>> THESE CERTIFICATES TOO!  If you can get it working in BASH,
>> you are 90% of the way there.
>>
>>  > Also what is the other thing at the end
>>  > you_other_email_address@gmail.com
>>
>> My bad.  I should have said it was the gMail "To"
>> address, which can be anyone.
>>
>> Good luck, I am dying to know if this helped you or
>> anyone else.  I am usually the one asking the questions.
>>
>> -T
>>
> Hello Todd!
>
> Let me tell you what i did:
>
> i have:
>
> rm ~./mailrc
>
> nikos@superhost.gr [~]# 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=my@gmail.com \
> -S smtp-auth-password="my_gmail_pass" \
> -S nss-config-dir=/home/nikos/certs/ \
> nikos@ath.forthnet.gr
>
> chmod u+x MailXTest.gmail
>
> and finally when i try to run it:
>
> nikos@superhost.gr [~]# MailXTest.gmail
> -bash: MailXTest.gmail: command not found
>
> What iam doing?
>
> Apart from that i want to avoid using GMail's service becazue it adds up
> a Sender: header sayign that the mail originating from my gmail accoutn
> while i want to use the FROM field that the visitor used in my html web
> form to fill in his email
>
> Also it would be nice if the hostname would appear too.
>
> Do we need to setup our own mail servr to achieve this?
>

`dnsdomainname` gives you both your hostname and your domain
name.  Try just running the command by itself from the command
line.

Note sure what you mean by "visitor used".  Is the visitor's
address what you want to use as "From:"?  If so, it needs to
be a gMail account and you need to use his info in
"from=", "smtp-auth-user=", and "smtp-auth-password=".

If "visitor" is not a gMail account, you need to find out
what the SMTP settings are for his account.

Not sure what is going on.  Here is a scatter gun approach.

1) is "mailx" install and at the latest version?  From
    the command line, run the following to see if it
    is there and in your path:
          which mailx

2) try putting "./" in front of the MailXTest.gmail.
       ./MailXTest.gmail

3) "from=" and "smtp-auth-user=" should be the same
    thing (my@gmail.com).

4) try adding tracing to the script.  On line one, add "-x"
       #!/bin/bash -x
    if there is a problem, it will show you where

-T



-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
the riddle wrapped in an enigma wrapped
in a couple slices of baloney
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

[toc] | [prev] | [next] | [standalone]


#2281

FromFerrous Cranus <nikos@superhost.gr>
Date2013-09-09 11:29 +0300
Message-ID<l0k0t0$o8t$1@dont-email.me>
In reply to#2276
Στις 8/9/2013 11:15 μμ, ο/η Todd έγραψε:
> On 09/07/2013 11:54 PM, Ferrous Cranus wrote:
>> Στις 8/9/2013 2:20 πμ, ο/η Todd έγραψε:
>>> On 09/06/2013 12:37 AM, Νίκος - Support wrote:> Στις 6/9/2013 10:20 πμ,
>>> ο/η 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
>>>  >
>>>  > Hello Todd,
>>>  >
>>>  > Do i download them from Google? What
>>>  > their use?
>>>  > i don't user FF i use Chrome instead.
>>>  >
>>>
>>>  > Please elaborate.
>>>
>>> Certainly!  gmail and zmail (zoho.com) are both huge
>>> pains in the --- to get working from a script.
>>>
>>> Hi Νίκος,
>>>
>>> The batch script is how to send "From:" a gmail
>>> account with a batch script using mailx.  The
>>> "To:" can be anyone.
>>>
>>> I also have a script to do the same thing from a
>>> zoho account (zmail), if anyone wants it.
>>>
>>> First let me write the comments in my batch file a little better.
>>> Remember, this BASH script is a only for sending from a script
>>> through gMail.
>>>
>>> -------- 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=From_email_address@gmail.com \
>>> -S smtp-auth-user=From_email_address@gmail.com \
>>> -S smtp-auth-password="From_email_password" \
>>> -S nss-config-dir=/home/linuxutil/mailcerts/ \
>>> To_email_address@gmail.com
>>>
>>> ---------------------------------------------------
>>>
>>>  > i want to try your example but i don't know where i'm
>>>  > supposed to find the cert* and key* files.
>>>
>>> You will find them in your gMail profile.  Your profile
>>> is in your home directory under
>>>       $HOME/.mozilla/firefox/your_profiles_cypher_name
>>>
>>> 1) install firefox
>>>
>>> 2) start firefox and let it automatically create its first
>>>     profile
>>>
>>> 3) open a terminal/xterm in your home directory
>>>
>>> 4) search for the certificates with
>>>       find $HOME/.mozilla/firefox -iname \*cert\*.db
>>>     remember to copy all the *.db's over from your profile
>>>     to a separate directory.  Mine are:
>>>
>>>           cert7.db  cert8.db  key3.db  secmod.db
>>>
>>>     Firefox needs these certificates to do the "s" in https
>>>
>>> 5) modify "nss-config-dir=/home/linuxutil/mailcerts/" in
>>>     the above script to match the directory you copied the
>>>     certificates to
>>>
>>>
>>>  > What are the mailcerts anyway?
>>>
>>> gMail uses SSL (secure socket layer or the "s" in https) and
>>> need these certificates to authenticate.  So does zmail, but
>>> uses a different sign in method.
>>>
>>>  > The code above is supposed to be use in a file called
>>>  > 'MailxTest.gmail'
>>>
>>> This is a Bash script.  The first line in the script "#!/bin/bash"
>>> tells you this.
>>>
>>>  > not from within a python script i have called 'mail.py' ?
>>>
>>> No.  Not to a Python script.  Get it working in Bash first,
>>> them translate it to Python.  YOUR PYTHON SUBROUTINE WILL NEED
>>> THESE CERTIFICATES TOO!  If you can get it working in BASH,
>>> you are 90% of the way there.
>>>
>>>  > Also what is the other thing at the end
>>>  > you_other_email_address@gmail.com
>>>
>>> My bad.  I should have said it was the gMail "To"
>>> address, which can be anyone.
>>>
>>> Good luck, I am dying to know if this helped you or
>>> anyone else.  I am usually the one asking the questions.
>>>
>>> -T
>>>
>> Hello Todd!
>>
>> Let me tell you what i did:
>>
>> i have:
>>
>> rm ~./mailrc
>>
>> nikos@superhost.gr [~]# 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=my@gmail.com \
>> -S smtp-auth-password="my_gmail_pass" \
>> -S nss-config-dir=/home/nikos/certs/ \
>> nikos@ath.forthnet.gr
>>
>> chmod u+x MailXTest.gmail
>>
>> and finally when i try to run it:
>>
>> nikos@superhost.gr [~]# MailXTest.gmail
>> -bash: MailXTest.gmail: command not found
>>
>> What iam doing?
>>
>> Apart from that i want to avoid using GMail's service becazue it adds up
>> a Sender: header sayign that the mail originating from my gmail accoutn
>> while i want to use the FROM field that the visitor used in my html web
>> form to fill in his email
>>
>> Also it would be nice if the hostname would appear too.
>>
>> Do we need to setup our own mail servr to achieve this?
>>
>
> `dnsdomainname` gives you both your hostname and your domain
> name.  Try just running the command by itself from the command
> line.
>
> Note sure what you mean by "visitor used".  Is the visitor's
> address what you want to use as "From:"?  If so, it needs to
> be a gMail account and you need to use his info in
> "from=", "smtp-auth-user=", and "smtp-auth-password=".
>
> If "visitor" is not a gMail account, you need to find out
> what the SMTP settings are for his account.
>
> Not sure what is going on.  Here is a scatter gun approach.
>
> 1) is "mailx" install and at the latest version?  From
>     the command line, run the following to see if it
>     is there and in your path:
>           which mailx
>
> 2) try putting "./" in front of the MailXTest.gmail.
>        ./MailXTest.gmail
>
> 3) "from=" and "smtp-auth-user=" should be the same
>     thing (my@gmail.com).
>
> 4) try adding tracing to the script.  On line one, add "-x"
>        #!/bin/bash -x
>     if there is a problem, it will show you where
>
> -T
>
>
>
nikos@superhost.gr [~]# ./MailXTest.gmail
Send options without primary recipient specified.
Usage: mailx -eiIUdEFntBDNHRV~ -T FILE -u USER -h hops -r address -s 
SUBJECT -a FILE -q FILE -f FILE -A ACCOUNT -b USERS -c USERS -S OPTION users
./MailXTest.gmail: line 4: -S: command not found
nikos@superhost.gr [~]# cat MailXTest.gmail
#!/bin/bash -x
#
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=mygmail@gmail.com \
-S smtp-auth-password="pass" \
-S nss-config-dir=/home/nikos/certs/ \
nikos@ath.forthnet.gr

The visitor of http://superhost.gr tried to send me an email using the 
wb gorm i ahve which asks for his mail address and MESSAGE he wans to 
send me.

i have no way of knowing the smtp settings the visitor uses or even if 
his mail address is real but no matter what, the the FROM field must 
contain the mail address the user types in the web form.


-- 
Webhost <http://superhost.gr>

[toc] | [prev] | [next] | [standalone]


#2283

FromTodd <Todd@invalid.invalid>
Date2013-09-09 11:44 -0700
Message-ID<l0l4um$5pv$1@dont-email.me>
In reply to#2281
On 09/09/2013 01:29 AM, Ferrous Cranus wrote:
> i have no way of knowing the smtp settings the visitor uses or even if
> his mail address is real but no matter what, the the FROM field must
> contain the mail address the user types in the web form.

You should create a special eMail address of your own for
these messages and use that to send with.  "Supposedly"
(note the weasel word), "-S from=" and "-S smtp-auth-user="
can be different.



-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
the riddle wrapped in an enigma wrapped
in a couple slices of baloney
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

[toc] | [prev] | [next] | [standalone]


#2286

FromWhiskers <catwheezel@operamail.com>
Date2013-09-09 22:07 +0100
Message-ID<slrnl2se4m.38c.catwheezel@ID-107770.user.individual.net>
In reply to#2281
On 2013-09-09, Ferrous Cranus <nikos@superhost.gr> wrote:
> Στις 8/9/2013 11:15 μμ, ο/η Todd έγραψε:
>> On 09/07/2013 11:54 PM, Ferrous Cranus wrote:
>>> Στις 8/9/2013 2:20 πμ, ο/η Todd έγραψε:
>>>> On 09/06/2013 12:37 AM, Νίκος - Support wrote:> Στις 6/9/2013 10:20 πμ,
>>>> ο/η Todd έγραψε:
>>>>  >> On 09/05/2013 09:11 AM, Ferrous Cranus wrote:

[...]

> The visitor of http://superhost.gr tried to send me an email using the 
> wb gorm i ahve which asks for his mail address and MESSAGE he wans to 
> send me.
>
> i have no way of knowing the smtp settings the visitor uses or even if 
> his mail address is real but no matter what, the the FROM field must 
> contain the mail address the user types in the web form.

That's fine, but only while the email is on your own system.  If you
want users of your system to be able to send local emails to you and
other local users, each user should have a username of their own which
they use to log in to your system, and the computer they use will have a
hostname; those two things combine to create email addresses that are
valid for use within your own system - "jim_z@localhost" or
"root@upstairs.computer" or "dad@kitchen.sink" or whatever.  This sort
of arrangement is not usually worth the bother, apart from getting
system status and error reports sent to the system administrator by the
various 'daemons' or 'services' you have running.

If you want to allow visitors to access their existing Gmail accounts
from your computer, just set up a limited user called (for example)
guest, with access only to a web browser - possibly in 'kiosk mode' - so
that they can log in using the same login details as they do from
anywhere else.  

Or are you trying to become an email service provider yourself?

-- 
-- ^^^^^^^^^^
--  Whiskers 
-- ~~~~~~~~~~

[toc] | [prev] | [next] | [standalone]


#2288

From"Jonathan N. Little" <lws4art@gmail.com>
Date2013-09-09 17:33 -0400
Message-ID<l0leqn$2oj$1@dont-email.me>
In reply to#2286
Whiskers wrote:
> On 2013-09-09, Ferrous Cranus <nikos@superhost.gr> wrote:
>> Στις 8/9/2013 11:15 μμ, ο/η Todd έγραψε:
>>> On 09/07/2013 11:54 PM, Ferrous Cranus wrote:
>>>> Στις 8/9/2013 2:20 πμ, ο/η Todd έγραψε:
>>>>> On 09/06/2013 12:37 AM, Νίκος - Support wrote:> Στις 6/9/2013 10:20 πμ,
>>>>> ο/η Todd έγραψε:
>>>>>   >> On 09/05/2013 09:11 AM, Ferrous Cranus wrote:
>
> [...]
>
>> The visitor of http://superhost.gr tried to send me an email using the
>> wb gorm i ahve which asks for his mail address and MESSAGE he wans to
>> send me.
>>
>> i have no way of knowing the smtp settings the visitor uses or even if
>> his mail address is real but no matter what, the the FROM field must
>> contain the mail address the user types in the web form.
>
> That's fine, but only while the email is on your own system.  If you
> want users of your system to be able to send local emails to you and
> other local users, each user should have a username of their own which
> they use to log in to your system, and the computer they use will have a
> hostname; those two things combine to create email addresses that are
> valid for use within your own system - "jim_z@localhost" or
> "root@upstairs.computer" or "dad@kitchen.sink" or whatever.  This sort
> of arrangement is not usually worth the bother, apart from getting
> system status and error reports sent to the system administrator by the
> various 'daemons' or 'services' you have running.
>
> If you want to allow visitors to access their existing Gmail accounts
> from your computer, just set up a limited user called (for example)
> guest, with access only to a web browser - possibly in 'kiosk mode' - so
> that they can log in using the same login details as they do from
> anywhere else.
>
> Or are you trying to become an email service provider yourself?
>

It sounds more like the OP is trying to setup form to mail and wishes to 
validate if the visitor's supplied email address in his form is valid. 
Well, there is no real way to do this one shot. If he is using that form 
to create a auto-reply with that user supplied address he better take 
measures to prevent robo comment spam.

-- 
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com

[toc] | [prev] | [next] | [standalone]


#2291

FromWhiskers <catwheezel@operamail.com>
Date2013-09-10 16:38 +0100
Message-ID<slrnl2uf7c.2n5.catwheezel@ID-107770.user.individual.net>
In reply to#2288
On 2013-09-09, Jonathan N. Little <lws4art@gmail.com> wrote:
> Whiskers wrote:
>> On 2013-09-09, Ferrous Cranus <nikos@superhost.gr> wrote:
>>> Στις 8/9/2013 11:15 μμ, ο/η Todd έγραψε:
>>>> On 09/07/2013 11:54 PM, Ferrous Cranus wrote:
>>>>> Στις 8/9/2013 2:20 πμ, ο/η Todd έγραψε:
>>>>>> On 09/06/2013 12:37 AM, Νίκος - Support wrote:> Στις 6/9/2013 10:20 πμ,
>>>>>> ο/η Todd έγραψε:
>>>>>>   >> On 09/05/2013 09:11 AM, Ferrous Cranus wrote:
>>
>> [...]
>>
>>> The visitor of http://superhost.gr tried to send me an email using the
>>> wb gorm i ahve which asks for his mail address and MESSAGE he wans to
>>> send me.
>>>
>>> i have no way of knowing the smtp settings the visitor uses or even if
>>> his mail address is real but no matter what, the the FROM field must
>>> contain the mail address the user types in the web form.
>>
>> That's fine, but only while the email is on your own system.  If you
>> want users of your system to be able to send local emails to you and
>> other local users, each user should have a username of their own which
>> they use to log in to your system, and the computer they use will have a
>> hostname; those two things combine to create email addresses that are
>> valid for use within your own system - "jim_z@localhost" or
>> "root@upstairs.computer" or "dad@kitchen.sink" or whatever.  This sort
>> of arrangement is not usually worth the bother, apart from getting
>> system status and error reports sent to the system administrator by the
>> various 'daemons' or 'services' you have running.
>>
>> If you want to allow visitors to access their existing Gmail accounts
>> from your computer, just set up a limited user called (for example)
>> guest, with access only to a web browser - possibly in 'kiosk mode' - so
>> that they can log in using the same login details as they do from
>> anywhere else.
>>
>> Or are you trying to become an email service provider yourself?
>>
>
> It sounds more like the OP is trying to setup form to mail and wishes to 
> validate if the visitor's supplied email address in his form is valid. 
> Well, there is no real way to do this one shot. If he is using that form 
> to create a auto-reply with that user supplied address he better take 
> measures to prevent robo comment spam.

Might be useful to clarify whether the OP wants the visitor's message to
be sent *to* the OP's Gmail address, eg as feedback from a website, or
wants the visitor to be able to send emails to anyone by *relaying*
through Google's SMTP server using the OP's Google account but with
unspecified or invented 'From' addresses.

The latter should not be permitted by Google or any other email service
provider, of course.

<http://www.nixtutor.com/linux/send-mail-with-gmail-and-ssmtp/>
<https://wiki.archlinux.org/index.php/SSMTP#Forward_to_a_Gmail_Mail_Server>
<http://heirloom.sourceforge.net/mailx.html>

-- 
-- ^^^^^^^^^^
--  Whiskers 
-- ~~~~~~~~~~

[toc] | [prev] | [next] | [standalone]


#2292

FromFerrous Cranus <nikos@superhost.gr>
Date2013-09-10 22:37 +0300
Message-ID<l0nsdn$gvg$1@dont-email.me>
In reply to#2291
Στις 10/9/2013 6:38 μμ, ο/η Whiskers έγραψε:
> On 2013-09-09, Jonathan N. Little <lws4art@gmail.com> wrote:
>> Whiskers wrote:
>>> On 2013-09-09, Ferrous Cranus <nikos@superhost.gr> wrote:
>>>> Στις 8/9/2013 11:15 μμ, ο/η Todd έγραψε:
>>>>> On 09/07/2013 11:54 PM, Ferrous Cranus wrote:
>>>>>> Στις 8/9/2013 2:20 πμ, ο/η Todd έγραψε:
>>>>>>> On 09/06/2013 12:37 AM, Νίκος - Support wrote:> Στις 6/9/2013 10:20 πμ,
>>>>>>> ο/η Todd έγραψε:
>>>>>>>    >> On 09/05/2013 09:11 AM, Ferrous Cranus wrote:
>>>
>>> [...]
>>>
>>>> The visitor of http://superhost.gr tried to send me an email using the
>>>> wb gorm i ahve which asks for his mail address and MESSAGE he wans to
>>>> send me.
>>>>
>>>> i have no way of knowing the smtp settings the visitor uses or even if
>>>> his mail address is real but no matter what, the the FROM field must
>>>> contain the mail address the user types in the web form.
>>>
>>> That's fine, but only while the email is on your own system.  If you
>>> want users of your system to be able to send local emails to you and
>>> other local users, each user should have a username of their own which
>>> they use to log in to your system, and the computer they use will have a
>>> hostname; those two things combine to create email addresses that are
>>> valid for use within your own system - "jim_z@localhost" or
>>> "root@upstairs.computer" or "dad@kitchen.sink" or whatever.  This sort
>>> of arrangement is not usually worth the bother, apart from getting
>>> system status and error reports sent to the system administrator by the
>>> various 'daemons' or 'services' you have running.
>>>
>>> If you want to allow visitors to access their existing Gmail accounts
>>> from your computer, just set up a limited user called (for example)
>>> guest, with access only to a web browser - possibly in 'kiosk mode' - so
>>> that they can log in using the same login details as they do from
>>> anywhere else.
>>>
>>> Or are you trying to become an email service provider yourself?
>>>
>>
>> It sounds more like the OP is trying to setup form to mail and wishes to
>> validate if the visitor's supplied email address in his form is valid.
>> Well, there is no real way to do this one shot. If he is using that form
>> to create a auto-reply with that user supplied address he better take
>> measures to prevent robo comment spam.
>
> Might be useful to clarify whether the OP wants the visitor's message to
> be sent *to* the OP's Gmail address, eg as feedback from a website, or
> wants the visitor to be able to send emails to anyone by *relaying*
> through Google's SMTP server using the OP's Google account but with
> unspecified or invented 'From' addresses.
>
> The latter should not be permitted by Google or any other email service
> provider, of course.
>
> <http://www.nixtutor.com/linux/send-mail-with-gmail-and-ssmtp/>
> <https://wiki.archlinux.org/index.php/SSMTP#Forward_to_a_Gmail_Mail_Server>
> <http://heirloom.sourceforge.net/mailx.html>
>
What i want is for my weboage to notify me for the visitors spcified 
mail address and message and this be done by setting up my won mail 
server because gmail's tend to alter the from address.

-- 
Webhost <http://superhost.gr>

[toc] | [prev] | [next] | [standalone]


#2293

FromDavid Brown <david.brown@removethis.hesbynett.no>
Date2013-09-10 23:04 +0200
Message-ID<yJidnfmk4qnaFLLPnZ2dnUVZ8uydnZ2d@lyse.net>
In reply to#2292
On 10/09/13 21:37, Ferrous Cranus wrote:
> Στις 10/9/2013 6:38 μμ, ο/η Whiskers έγραψε:
>> On 2013-09-09, Jonathan N. Little <lws4art@gmail.com> wrote:
>>> Whiskers wrote:
>>>> On 2013-09-09, Ferrous Cranus <nikos@superhost.gr> wrote:
>>>>> Στις 8/9/2013 11:15 μμ, ο/η Todd έγραψε:
>>>>>> On 09/07/2013 11:54 PM, Ferrous Cranus wrote:
>>>>>>> Στις 8/9/2013 2:20 πμ, ο/η Todd έγραψε:
>>>>>>>> On 09/06/2013 12:37 AM, Νίκος - Support wrote:> Στις 6/9/2013
>>>>>>>> 10:20 πμ,
>>>>>>>> ο/η Todd έγραψε:
>>>>>>>>    >> On 09/05/2013 09:11 AM, Ferrous Cranus wrote:
>>>>
>>>> [...]
>>>>
>>>>> The visitor of http://superhost.gr tried to send me an email using the
>>>>> wb gorm i ahve which asks for his mail address and MESSAGE he wans to
>>>>> send me.
>>>>>
>>>>> i have no way of knowing the smtp settings the visitor uses or even if
>>>>> his mail address is real but no matter what, the the FROM field must
>>>>> contain the mail address the user types in the web form.
>>>>
>>>> That's fine, but only while the email is on your own system.  If you
>>>> want users of your system to be able to send local emails to you and
>>>> other local users, each user should have a username of their own which
>>>> they use to log in to your system, and the computer they use will
>>>> have a
>>>> hostname; those two things combine to create email addresses that are
>>>> valid for use within your own system - "jim_z@localhost" or
>>>> "root@upstairs.computer" or "dad@kitchen.sink" or whatever.  This sort
>>>> of arrangement is not usually worth the bother, apart from getting
>>>> system status and error reports sent to the system administrator by the
>>>> various 'daemons' or 'services' you have running.
>>>>
>>>> If you want to allow visitors to access their existing Gmail accounts
>>>> from your computer, just set up a limited user called (for example)
>>>> guest, with access only to a web browser - possibly in 'kiosk mode'
>>>> - so
>>>> that they can log in using the same login details as they do from
>>>> anywhere else.
>>>>
>>>> Or are you trying to become an email service provider yourself?
>>>>
>>>
>>> It sounds more like the OP is trying to setup form to mail and wishes to
>>> validate if the visitor's supplied email address in his form is valid.
>>> Well, there is no real way to do this one shot. If he is using that form
>>> to create a auto-reply with that user supplied address he better take
>>> measures to prevent robo comment spam.
>>
>> Might be useful to clarify whether the OP wants the visitor's message to
>> be sent *to* the OP's Gmail address, eg as feedback from a website, or
>> wants the visitor to be able to send emails to anyone by *relaying*
>> through Google's SMTP server using the OP's Google account but with
>> unspecified or invented 'From' addresses.
>>
>> The latter should not be permitted by Google or any other email service
>> provider, of course.
>>
>> <http://www.nixtutor.com/linux/send-mail-with-gmail-and-ssmtp/>
>> <https://wiki.archlinux.org/index.php/SSMTP#Forward_to_a_Gmail_Mail_Server>
>>
>> <http://heirloom.sourceforge.net/mailx.html>
>>
> What i want is for my weboage to notify me for the visitors spcified
> mail address and message and this be done by setting up my won mail
> server because gmail's tend to alter the from address.
>

Your own email server will either send via another "real" SMTP server, 
such as gmail's (which will change the Sender and/or From fields), or it 
will try to deliver email directly - in which case half the receiving 
email servers will block it as a spam server (even if you go to all the 
effort of fixed IP's, proper DNS, and proper reverse DNS, you will be 
caught sending with From addresses that should not be coming from your 
machine).

I don't know why this is so difficult for you to comprehend - you cannot 
forge other people's From addresses and expect everything to work!

Just implement the web site in the same way everybody else does - fields 
that the user enters (such as their own address) go as part of the email 
contents, and the whole thing is emailed to a fixed address from a fixed 
address (these can even be the same, such as your gmail address).

This is not rocket science - people have been doing it correctly for a 
long time.  The reason you are having such a hard time is because you 
are desperately trying to misunderstand how email works, and how web 
email forms work.

<http://www.freecontactform.com/html_form.php>
<http://www.templatemonster.com/help/how-create-contact-form-html.html>

(These use php rather than python, but the principle is the same.)

[toc] | [prev] | [next] | [standalone]


#2294

FromWhiskers <catwheezel@operamail.com>
Date2013-09-10 22:05 +0100
Message-ID<slrnl2v2dm.37j.catwheezel@ID-107770.user.individual.net>
In reply to#2292
On 2013-09-10, Ferrous Cranus <nikos@superhost.gr> wrote:
> Στις 10/9/2013 6:38 μμ, ο/η Whiskers έγραψε:
>> On 2013-09-09, Jonathan N. Little <lws4art@gmail.com> wrote:
>>> Whiskers wrote:
>>>> On 2013-09-09, Ferrous Cranus <nikos@superhost.gr> wrote:
>>>>> Στις 8/9/2013 11:15 μμ, ο/η Todd έγραψε:
>>>>>> On 09/07/2013 11:54 PM, Ferrous Cranus wrote:
>>>>>>> Στις 8/9/2013 2:20 πμ, ο/η Todd έγραψε:
>>>>>>>> On 09/06/2013 12:37 AM, Νίκος - Support wrote:> Στις 6/9/2013 10:20 πμ,
>>>>>>>> ο/η Todd έγραψε:

[...]

>>> It sounds more like the OP is trying to setup form to mail and wishes to
>>> validate if the visitor's supplied email address in his form is valid.
>>> Well, there is no real way to do this one shot. If he is using that form
>>> to create a auto-reply with that user supplied address he better take
>>> measures to prevent robo comment spam.
>>
>> Might be useful to clarify whether the OP wants the visitor's message to
>> be sent *to* the OP's Gmail address, eg as feedback from a website, or
>> wants the visitor to be able to send emails to anyone by *relaying*
>> through Google's SMTP server using the OP's Google account but with
>> unspecified or invented 'From' addresses.
>>
>> The latter should not be permitted by Google or any other email service
>> provider, of course.
>>
>> <http://www.nixtutor.com/linux/send-mail-with-gmail-and-ssmtp/>
>> <https://wiki.archlinux.org/index.php/SSMTP#Forward_to_a_Gmail_Mail_Server>
>> <http://heirloom.sourceforge.net/mailx.html>
>>
> What i want is for my weboage to notify me for the visitors spcified 
> mail address and message and this be done by setting up my won mail 
> server because gmail's tend to alter the from address.

Your web page cannot send an email 'From:' the visitor's email address.
It has to send emails 'From' an address which you own and using an SMTP
server associated with that email address.  

If you want to know the visitor's email address, design the form to
include that as part of the 'body' of the email message the web page
sends to you (or perhaps as the 'Reply-To:' header of that message).

<https://ixquick.com/do/search?q=how+to+send+email+from+web+form>

Checking whether or not the visitor has given a real email address, is a
separate matter.

-- 
-- ^^^^^^^^^^
--  Whiskers 
-- ~~~~~~~~~~

[toc] | [prev] | [next] | [standalone]


Page 2 of 3 — ← Prev page 1 [2] 3  Next page →

Back to top | Article view | comp.os.linux.networking


csiph-web