Using mailx to send mail to Gmail?

Hello, I have a couple of servers that are scripted to send cron script output logs to my email address (a Gmail address). Mailx is what I am using, but I didn’t have to configure anything; I installed it, and it just worked with the following command:

mailx -s “SUBJECT” -r FROMMYADDRESS TOMYADDRESS < FILETOCATANDSEND

This occurs every Saturday and Sunday at noon after my backup scripts run.
I noticed yesterday that I did not receive these logs, so I logged into the machine, started ‘mail’ and saw messages like this:


This is the mail system at host media.deagle.lan.

####################################################################

THIS IS A WARNING ONLY. YOU DO NOT NEED TO RESEND YOUR MESSAGE.

####################################################################

Your message could not be delivered for more than 1 hour(s).
It will be retried until it is 5 day(s) old.

For further assistance, please send mail to postmaster.

If you do so, please include this problem report. You can
delete your own text from the attached returned message.

              The mail system

<ron@deagle.us>: host alt1.aspmx.l.google.com[209.85.217.45] said: 421-4.7.0
[67.169.235.81] Our system has detected an unusual amount of 421-4.7.0
unsolicited mail originating from your IP address. To protect our 421-4.7.0
users from spam, mail sent from your IP address has been temporarily
421-4.7.0 blocked. Please visit
Bulk Senders Guidelines - Gmail Help 421 4.7.0 to review our Bulk
Email Senders Guidelines. 5si5781745gxk.17 (in reply to end of DATA
command)

Final-Recipient: rfc822; ron@deagle.us
Action: delayed
Status: 4.7.0
Remote-MTA: dns; alt1.aspmx.l.google.com
Diagnostic-Code: smtp; 421-4.7.0 [67.169.235.81] Our system has detected an
unusual amount of 421-4.7.0 unsolicited mail originating from your IP
address. To protect our 421-4.7.0 users from spam, mail sent from your IP
address has been temporarily 421-4.7.0 blocked. Please visit
Bulk Senders Guidelines - Gmail Help 421 4.7.0 to review our Bulk
Email Senders Guidelines. 5si5781745gxk.17
Will-Retry-Until: Thu, 15 Oct 2009 17:08:26 -0700 (PDT)

I’m not sure how two messages a week qualifies as ‘bulk’, but… I am assuming that this is because I am sending it ‘from’ my gmail address via the smtp server in mailx??

Is it possible to configure mailx to use an external smtp server? As stated earlier, I didn’t have to configure anything initially to get it to work, and have never had to mess with mail/mailx/postfix/sendmail, so it’s a bit Greek to me.

Any assistance would be GREATLY appreciated!! Thanks in advance!

Nevermind, got it working with:

mailx -v -s “SUBJECT” -S smtp-use-starttls -S ssl-verify=ignore -S smtp-auth=login -S smtp:587=smtp.gmail.com -S from=$MAILFR -S smtp-auth-user=$MAILTO -S smtp-auth-password="$SMTPPASS" $MAILTO < $STATUS 2>"$ERR"

Thanks for sharing the answer.

On 08/25/2010 11:06 PM, neon20 180 wrote:
>
> Thanks for sharing the answer.

Another option is to create the following section in ~/.mailrc:


account gmail {
set smtp-use-starttls
set smtp=smtp://smtp.gmail.com:587
set smtp-auth=login
set smtp-auth-user=<your Gmail ID>
set smtp-auth-password=<Your Gmail password>
set from="Your Name <Your return address>"
}

After this is created, the step previously listed as:


mailx -v -s "SUBJECT" -S smtp-use-starttls -S ssl-verify=ignore -S
smtp-auth=login -S smtp=smtp.gmail.com:587 -S from=$MAILFR -S
smtp-auth-user=$MAILTO -S smtp-auth-password="$SMTPPASS" $MAILTO <
$STATUS 2>"$ERR"

can be simplified to


mailx -v -A gmail -s "SUBJECT" $MAILTO < $STATUS 2>"$ERR"

On 08/26/2010 07:06 AM, neon20 180 wrote:
>
> Thanks for sharing the answer.
>
>
And thanks NOT for not quoting.

No idea what you were referring to.

These forum thingies and the way they are used suck.

Vahis

http://waxborg.servepics.com
openSUSE 11.3 (x86_64) 2.6.34-12-default
17:23pm up 15 days 19:33, 3 users, load average: 0.19, 0.05, 0.01

Vahis wrote:
> On 08/26/2010 07:06 AM, neon20 180 wrote:
>> Thanks for sharing the answer.
>>
>>
> And thanks NOT for not quoting.
>
> No idea what you were referring to.
>
> These forum thingies and the way they are used suck.

does your newsreader not thread?


DenverD
CAVEAT: http://is.gd/bpoMD [posted via NNTP w/openSUSE 10.3]

On 08/26/2010 05:30 PM, DenverD wrote:
> Vahis wrote:
>> On 08/26/2010 07:06 AM, neon20 180 wrote:
>>> Thanks for sharing the answer.
>>>
>>>
>> And thanks NOT for not quoting.
>>
>> No idea what you were referring to.
>>
>> These forum thingies and the way they are used suck.
>
> does your newsreader not thread?
>

It normally does, but the post I replied to started a new thread.

Maybe the subject was changed at some stage after the initial posting.

Vahis

http://waxborg.servepics.com
openSUSE 11.3 (x86_64) 2.6.34-12-default
17:48pm up 15 days 19:58, 3 users, load average: 0.05, 0.13, 0.12

Hi Vahis
The original started on 10/11/2009, maybe when you added this group you
didn’t pull all the headers…


Cheers Malcolm °¿° (Linux Counter #276890)
openSUSE 11.3 (x86_64) Kernel 2.6.34-12-default
up 5 days 17:05, 2 users, load average: 0.10, 0.05, 0.00
GPU GeForce 8600 GTS Silent - Driver Version: 256.44

Vahis wrote:
> Maybe the subject was changed at some stage after the initial posting.

your header tells me you use some version of Thunderbird (as i do)
and, i think T-Bird threads based on message numbers, rather than
the older method of subject lines…

any way, here is what was touted as “the answer”:


Nevermind, got it working with:

mailx -v -s "SUBJECT" -S smtp-use-starttls -S ssl-verify=ignore -S
smtp-auth=login -S smtp=smtp.gmail.com:587 -S from=$MAILFR -S
smtp-auth-user=$MAILTO -S smtp-auth-password="$SMTPPASS" $MAILTO <
$STATUS 2>"$ERR"

so said ‘vwgtiturbo’ in message ID:
<vwgtiturbo.3zymoq@no-mx.forums.opensuse.org>
last December 10…

which you could also find by clicking on the “View this thread:
http://forums.opensuse.org/showthread.php?t=423310” link at the bottom
of any posting made via the web interface…

btw: welcome to the web forums via nntp (with a background in ml and
newsnet it will take some getting used to, for sure!)


DenverD
CAVEAT: http://is.gd/bpoMD [posted via NNTP w/openSUSE 10.3]

On 08/26/2010 05:59 PM, malcolmlewis wrote:
>

> Hi Vahis
> The original started on 10/11/2009, maybe when you added this group you
> didn’t pull all the headers…

OK. Old thread.
But quoting is needed especially if someone is picking up ancient threads.

Vahis

http://waxborg.servepics.com
openSUSE 11.3 (x86_64) 2.6.34-12-default
18:17pm up 15 days 20:27, 3 users, load average: 0.00, 0.00, 0.00

Vahis wrote:
> OK. Old thread.
> But quoting is needed especially if someone is picking up ancient threads.

the forum is primarily an http thing…
the number of nntp users is a very small percentage…

unlike those of the ml/nntp culture the http folks find no reason to
quote since all posts of the thread are served together…

for example, look at this thread in the web setting:
http://forums.opensuse.org/showthread.php?t=423310

so, i don’t expect you can, alone, change them to full quote as you
might be used to…


DenverD
CAVEAT: http://is.gd/bpoMD [posted via NNTP w/openSUSE 10.3]

On 2010-08-26 19:27, DenverD wrote:
> Vahis wrote:
>> OK. Old thread.
>> But quoting is needed especially if someone is picking up ancient threads.
>
> the forum is primarily an http thing…
> the number of nntp users is a very small percentage…

It might help if both subgroups are aware of (some of) the idiosyncrasies of the other subgroup :slight_smile:


Cheers / Saludos,

Carlos E. R.
(from 11.2 x86_64 “Emerald” GM (Elessar))

Carlos E. R. wrote:
> It might help if both subgroups are aware of (some of) the
> idiosyncrasies of the other subgroup :slight_smile:

i agree…which is why i use a little time (when i see the need) to
try to ‘educate’ either/both groups…

that is, i don’t expect the members of either group to be ‘born’
knowing what the other does (but apparently some ML members seem to
think all the http folks should know to quote everything–and the hhtp
folks think the ML folks shouldn’t…so, there ya go!)


DenverD
CAVEAT: http://is.gd/bpoMD [posted via NNTP w/openSUSE 10.3]

On 2010-08-29 10:36, DenverD wrote:
> Carlos E. R. wrote:
>> It might help if both subgroups are aware of (some of) the
>> idiosyncrasies of the other subgroup :slight_smile:
>
> i agree…which is why i use a little time (when i see the need) to
> try to ‘educate’ either/both groups…

Yep.

> that is, i don’t expect the members of either group to be ‘born’
> knowing what the other does (but apparently some ML members seem to
> think all the http folks should know to quote everything–and the hhtp
> folks think the ML folks shouldn’t…so, there ya go!)

I don’t think anybody should full-quote! That’s an error and another fight, in the ML :wink:

Quoting should be minimal, just a paragraph to let the reader know what exactly you are replying to.

Here, I have problems sometimes knowing what somebody is talking about, as the “previous post” for
him is perhaps a dozen posts above, but he hit the reply button into another unrelated post in the
same thread (somebody, perhaps you, explained this another day). In a threaded nntp reader this
causes a lot of confusion. If there is a bit of quoting, it is easier to get the meaning, if not, it
is more difficult.

It needs getting used to it, a little time :slight_smile:
(I mean, my time. My understanding of why posts are that way here).


Cheers / Saludos,

Carlos E. R.
(from 11.2 x86_64 “Emerald” GM (Elessar))

Hy guys,
Please someone can help me to resolve this problem :

**[root@SUP-L-BO41-DS41 ~]# mailx -s “SUBJECT” abc@gmail.com
Unknown command: “account”
**
Note that i work on mail’s sending to gmail and under Redhat linux distribution

Thank you.

On 2013-10-01 16:36, bouchra10 wrote:
>
> Hy guys,
> Please someone can help me to resolve this problem :

Your problem is not the same one as the OP, so you should post into a
new thread.

> *[root@SUP-L-BO41-DS41 ~]# mailx -s “SUBJECT” abc@gmail.com
> Unknown command: “account”
> *
> Note that i work on mail’s sending to gmail and under Redhat linux
> distribution

Well, we can not help if you are using Redhat. This is an openSUSE Linux
forum.


Cheers / Saludos,

Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)