Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: Using mailx to send mail to Gmail?

  1. #1

    Default 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!

  2. #2

    Default Re: Using mailx to send mail to Gmail?

    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"

  3. #3

    Default Re: Using mailx to send mail to Gmail?

    Thanks for sharing the answer.

  4. #4
    Join Date
    Jun 2008
    Location
    Kansas City Area, Missouri, USA
    Posts
    7,236

    Default Re: Using mailx to send mail to Gmail?

    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:

    Code:
    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:

    Code:
    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

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

  5. #5
    Vahis NNTP User

    Default Re: Using mailx to send mail to Gmail?

    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

  6. #6
    Join Date
    Jun 2008
    Location
    Earth - Denmark
    Posts
    10,730

    Default Re: Using mailx to send mail to Gmail?

    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]

  7. #7
    Vahis NNTP User

    Default Re: Using mailx to send mail to Gmail?

    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

  8. #8
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    32,343
    Blog Entries
    15

    Default Re: Using mailx to send mail to Gmail?

    Quote Originally Posted by Vahis
    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
    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


  9. #9
    Join Date
    Jun 2008
    Location
    Earth - Denmark
    Posts
    10,730

    Default Re: Using mailx to send mail to Gmail?

    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":

    Code:
    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]

  10. #10
    Vahis NNTP User

    Default Re: Using mailx to send mail to Gmail?

    On 08/26/2010 05:59 PM, malcolmlewis wrote:
    >
    Quote Originally Posted by Vahis
    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.
    Quote Originally Posted by Vahis
    <snip>
    >

    > 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

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •