Professional Web Applications Themes

unable to send mail from UNIX - Linux / Unix Administration

Hi, I own mac OSX. I am learing scripting language using bash. I tried to send a sample mail to my yahoo and gmail account using mail and mailx, but I could not. Here is the command that I used. mailx -s "Subject" "com" < output.txt Do I have to configure these programs before I can send emails? thanks for the help Papu...

  1. #1

    Default unable to send mail from UNIX

    Hi,
    I own mac OSX. I am learing scripting language using bash. I tried to
    send a sample mail to my yahoo and gmail account using mail and mailx,
    but I could not.

    Here is the command that I used.
    mailx -s "Subject" "com" < output.txt

    Do I have to configure these programs before I can send emails?

    thanks for the help

    Papu

    prachar@gmail.com Guest

  2. #2

    Default Re: unable to send mail from UNIX

    On 24 Nov 2005 12:02:39 -0800, com wrote: 

    Your mail client, mailx will automagically send the mail to your Mail
    Transport Agent (MTA). Your MTA needs to be configured to know what
    the relayhost is to pass on mail which is not to be delivered to someone
    on your current node.

    Sorry I do not know MAC.
    Possible MTAs qmail, postfix, sendmail, exim
    Bit Guest

  3. #3

    Default Re: unable to send mail from UNIX

    In article <home.invalid>,
    Bit Twister <com> wrote:
     
    >
    > Your mail client, mailx will automagically send the mail to your Mail
    > Transport Agent (MTA). Your MTA needs to be configured to know what
    > the relayhost is to pass on mail which is not to be delivered to someone
    > on your current node.
    >
    > Sorry I do not know MAC.
    > Possible MTAs qmail, postfix, sendmail, exim[/ref]

    I have MacOS X 10.3 which uses postfix. 10.2 used sendmail as
    installed. sendmail required permissions be repaired on /var in order
    to work right. postfix just seems to work with the default settings.
    It uses configuration info from somewhere other than
    /etc/postfix/main.cf (read this file if you want to change anything) and
    forwards it to the host in the MX record of the domain it's addressed
    to. Most domains won't allow this and only accept email from known
    hosts. My guess is your MacOS X box would need a static IP address and
    DNS entry to run a mail server. Many of the major ISP's won't allow
    that--ymmv.

    --
    DeeDee, don't press that button! DeeDee! NO! Dee...



    Michael Guest

  4. #4

    Default Re: unable to send mail from UNIX

    In article <dca.giganews.com>,
    Michael Vilain <net> wrote: [/ref][/ref]

    [ snip ]
     

    I don't know about postfix, but sendmail can be configured to ....
    I'm not sure about the proper terminology, something along the
    lines of "to send outgoing mail via your ISP's mail server" -- the
    configuration you want when you connect to the 'Net via an ISP and not
    necessarily with a static IP address. Look in /etc/mail/sendmail.cf,
    in particular the comments about SMART_HOST (which is what you need to
    set) and the comments at the top (how to make the change take effect).

    My guess is that postfix has this capability as well.

    You may have to make additional changes in order for the return
    address on your messages to be something sensible (e.g., com).
    Some of these can be made at the level of the MUA (mail user agent --
    "mailx" in your example).

    Someone else can provide details; I just wanted to comment that you
    probably do *not* need a static IPA in order to send and receive mail.
    My experience is only with Linux, not Mac OS X, but I suspect that
    sendmail is (more or less) sendmail ....

    --
    | B. L. Massingill
    | ObDisclaimer: I don't speak for my employers; they return the favor.
    blmblm@myrealbox.com Guest

  5. #5

    Default Re: unable to send mail from UNIX

    ok great!

    I went to the sendmail.org website looking for instruction, but didnt
    find anything helpful. Some of the websites do have instructions on how
    to use sendmail but I was totally confused by them.

    I have suse 9.1 linux and I would like it if you can give me
    instruction on how to configure sendmail on it.

    The reason why I began to work on this is my external ip address keeps
    changing once in three hours and I would like to know what it is by
    sending email to my mail account. I have a script that can get the ip
    address. If only I can email it.

    The next task would be to figure out how to run a script by sending an
    email with some "instuctions"

    Papu

    papu Guest

  6. #6

    Default Re: unable to send mail from UNIX

    On 24 Nov 2005 16:04:15 -0800, papu wrote: 

    Most ISP do not want you running any servers. I have my
    firewall blocking all inbound attempts so not to violate the
    Acceptable Use Policy.


    Postfix is real easy to set up on a box which is getting dhcp ip from
    my ISP. here are my LAN and WAN settings.


    http://groups.google.com/advanced_group_search
    home.invalid in the message id box
    Bit Guest

  7. #7

    Default Re: unable to send mail from UNIX

    In article <googlegroups.com>,
    papu <com> wrote: 

    First an aside:

    Next time please leave in enough context for us to know who you're
    replying to. Not everyone reads news from Google's interface, and
    some newsreaders don't make it obvious (without some extra trouble)
    which post you're replying to. With the extra trouble, it seems
    that it's mine ....

    (Google's interface doesn't make it obvious how to quote from the
    post to which you're replying, but it's possible. I think it's
    something about "Show Options" ....)
     

    Sendmail is a big complicated program, and I am far from an expert on
    it. What I can tell you is what I did on a Fedora Core 4 system. It
    may or may not be helpful in your situation.

    In /etc/mail/sendmail.mc, I followed the instructions about
    uncommenting and changing the line containing "SMART_HOST". I also
    added my username to /etc/mail/trusted-users. I then followed the
    instructions in /etc/mail/sendmail.mc for regenerating the sendmail
    configuration files, and (probably -- hard to remember) restarted
    sendmail.

    I also made some changes in my mail-reading program's configuration
    files, so mail would appear to come from com rather than
    from localdomain. I can tell you what to change for
    mutt, but that doesn't help if you use another program. (It was
    after I made this change that I discovered that I probably needed to
    add something to that trusted-users file, because otherwise sendmail
    complains.)

    Hope this helps.
     

    You might want to read up, or ask, about whether there's a potential
    security risk in setting up something whereby incoming e-mail triggers
    the running of scripts. I vaguely remember hearing something ....

    --
    | B. L. Massingill
    | ObDisclaimer: I don't speak for my employers; they return the favor.
    blmblm@myrealbox.com Guest

  8. #8

    Default Re: unable to send mail from UNIX

    In article <home.invalid>,
    Bit Twister <com> wrote: 
    >
    >Most ISP do not want you running any servers. I have my
    >firewall blocking all inbound attempts so not to violate the
    >Acceptable Use Policy.
    >[/ref]

    Um, does setting up sendmail so that outgoing mail goes to the ISP's
    mail server (which is what I think the OP wants) constitute "running
    a server"? I wouldn't have thought so. How is this different from
    running any other MTA? Or maybe I don't understand what the OP wants.
     


    --
    | B. L. Massingill
    | ObDisclaimer: I don't speak for my employers; they return the favor.
    blmblm@myrealbox.com Guest

  9. #9

    Default Re: unable to send mail from UNIX

    On 25 Nov 2005 00:56:21 GMT, com wrote:
     

    Generally speaking and ignoring a firewall response, anything responding
    to inbound connection could be considered a server from the ISP's point of view.

    I just mentioned it so the OP would consider blocking inbound
    connections and would not be running an open relay for some
    cracker/spammer.
     

    Any MTA will work for what the OP asked for.

    I thought recent Suse distributions had postfix as default MTA.
    If no postfix docs installed, they can be found here
    http://www.postfix.org/doentation.html

    Now he might run into trouble sending to other Domains even through
    his ISP mail server.

    Lots of postmasters have set their filters to verify that the From
    addresses is a valid email address. I have to change home.invalid
    to com via my MTA (postfix).

    Bit Guest

  10. #10

    Default Re: unable to send mail from UNIX

    In article <googlegroups.com>,
    com writes: 

    You would probably get better results by posting your question on
    comp.mail.sendmail.

    Basically, however, you want to add lines like the following to your sendmail.mc
    file:

    MASQUERADE_AS(`yourISP.com')
    MASQUERADE_DOMAIN(`your-internal.domain.home')
    FEATURE(allmasquerade)
    FEATURE(masquerade_entire_domain)
    FEATURE(masquerade_envelope)
    define(*`confDOMAIN_NAME',`your-internal..domain.home')
    define(RELAY_HOST, smtp:mail.yourISP.net)
    define(SMART_HOST, smtp:mail.yourISP.net)
    define(RELAY_MAILER, TCP)

    The above lines ARE NOT guaranteed to work on your system - they do on mine,
    with appropriate changes where indicated. The Sendmail FAQ and the on-line
    doentation for whatever version of Sendmail you have installed should
    explain the above .mc file entries.

    HTH,
    Bob Melson




    --
    Robert G. Melson | Rio Grande MicroSolutions | El Paso, Texas
    -----
    "One of the greatest delusions in the world is the hope that the evils in this world are to be cured by legislation." Thomas Reed
    -----

    Robert Guest

  11. #11

    Default Re: unable to send mail from UNIX

    On Thu, 24 Nov 2005 14:17:59 -0600, Bit Twister <com> wrote: [/ref]
     [/ref]

    Maybe. What does mailq say? Where's your mail going? We can play
    port-25 games if we need to. Also, Yahoo doesn't accept SMTP traffic
    from many clients, you may have to ask for that to work.
     

    Or, as I suspect, his relayhost doesn't relay for him, because most
    people don't use it, and most of the time it's a spam conduit.
     

    MAC is something entirely different. Mac OSX is FreeBSD with an Apple
    GUI, for the purposes of any Unix question.
     

    It's got sendmail, and works fine out of the box. I'd bet a drink of
    your choice that it's Yahoo, which we can verify by connecting to 25
    manually and seeing the "relaying denied" message.

    Dave Hinz

    Dave Guest

  12. #12

    Default Re: unable to send mail from UNIX

    On 24 Nov 2005 16:04:15 -0800, papu <com> wrote: 

    I nominate this for "understatement of the year award".
    Dave Guest

  13. #13

    Default Re: unable to send mail from UNIX

    Begin <net>
    On 2005-11-25, Dave Hinz <net> wrote: 

    Please don't perpetuate this myth. It causes newbies with questions
    about macosx in cubfm that people there don't know how to answer.

    Altough apple took (amongst others) FreeBSD code and based darwin on
    it, but only loosely, and that isn't quite the same as what you say.
    For example, apple itself then says it also used the mach kernel, which
    simply is not used at all in FreeBSD. That is perhaps the most striking
    core example I can give, but it certainly isn't the only difference.
    (Netinfo part of the gui? I think not. And so on.)

    I'm not unhappy about apple that they took a stable codebase to build
    their OS on, I think it is sound engineering. But I do wish people would
    be less shallow and simplistic in their assumptions about it. If you
    don't believe me, I encourage you to take the FreeBSD handbook[1] and
    a macintosh running macosx, and figure out how much of what is in the
    handbook actually practically applies to macosx. I'd love to hear your
    findings.


    [1] http://www.freebsd.org/doc/handbook
    Or for kicks do the same with the updated daemon book.

    --
    j p d (at) d s b (dot) t u d e l f t (dot) n l .
    This message was originally posted on Usenet in plain text.
    Any other representation, additions, or changes do not have my
    consent and may be a violation of international copyright law.
    jpd Guest

  14. #14

    Default Re: unable to send mail from UNIX

    On 25 Nov 2005 13:57:17 GMT, jpd <not.spam.it.invalid> wrote: 
    >
    > Please don't perpetuate this myth. It causes newbies with questions
    > about macosx in cubfm that people there don't know how to answer.[/ref]

    What, specifically, do you disagree with, _in this context_? And "myth"
    implies it's wrong. Now you're going to tell me how some esoteric
    whatever is subtly different, which, as I said, isn't relevant.
     

    Any distro can add to, or change, what it's distributed with. Doesn't
    change the basic fact that I'm sitting at a FreeBSD box at the moment,
    with an Apple GUI.

    Tell me, does Sendmail know or care what it's on? For this question,
    then, does it matter if it's a Mach kernel, a wazzit kernel, or a
    floobydust kernel? No. This is an MTA question, not a kernel
    architecture question. FOR THE CONTECT OF THE QUESTION, my description
    is accurate enough.
     

    My findings are that you're a pompous, condescending person, jumping in
    with a non-helpful answer on a point unrelated to the question making a
    distinction that doesn't matter at all in this context.

    We've _had_ the "This OS isn't Unix-ish enough to merit inclusion here"
    troll, and he went away. Another one isn't welcome.


    Dave Guest

  15. #15

    Default Re: unable to send mail from UNIX

    Begin <net>
    On 2005-11-25, Dave Hinz <net> wrote: 
    >>
    >> Please don't perpetuate this myth. It causes newbies with questions
    >> about macosx in cubfm that people there don't know how to answer.[/ref]
    >
    > What, specifically, do you disagree with, _in this context_?[/ref]

    The context you gave is ``for the purposes of any Unix question''. That
    is at least what I see a couple of lines up. You can tell me that I'm
    wrong but then I would beg of you to show me, for I don't see how.

    To answer your question: I think it is accurately summed up in my
    request right above your question, namely that people who don't know any
    better than to equate macosx with FreeBSD --because even apple only ever
    said the former is ``based on'' the latter, not ``equates plus gui'', as
    well as on a couple of other collections of code free and proprietary--,
    tend to ask questions in cubfm that are met by at best loose handwaving
    and at worst a worse than useless answer.

     

    It's not irrelevant in the context you yourself gave. My experience in
    cubfm shows that and indeed most, if not all, questions there that are
    from people using macosx don't get more than handwaving as an answer.

    The esoteric whatever was simply one example out of too many to mention,
    to illustrate my point. I do think that even with only the two esoteric
    whatevers mentioned, I showed you wrong in the context you yourself
    gave. If you disagree, I invite you to demonstrate how I am mistaken,
    here or in email, as you prefer.


    [snip] 

    If what you saying were true, then NetBSD, OpenBSD, BSD/OS, and even
    juniper's junos would all also count as being some sort of FreeBSD.

    Except that the distribution model as used in the linux world, of
    one kernel, a lot of utilities of various flavours, and a lot of
    distribution-specific glue, does not apply in the *BSD world, despite
    the IMAO rather misguided attempts by for example debian to try and
    apply their glue to various BSDs anyway.

     

    I disagree. And I already explained why. But by all means, leave your
    fingers in your ears, if you insist.

     

    By that reasoning, does it then make any sense at all to pick two random
    unix flavours and equating them, instead of saying that sendmail does
    not care (mostly) what unix[tm]-like OS it runs on?

    If it did make sense, then why do we not have just one unix group,
    named comp.unix? Why then do we even bother with a separate group for
    sendmail? Surely sendmail doesn't care and it'll fit right in with the
    rest of the comp.unix discussion, it has been on most unices for so
    long nobody knows it is a separate and replaceable subsystem, anyway.

     

    Then don't break out of the context of the original question by expandig
    it to ``any Unix question''. You did that, not I.


    [snip] 

    I can't really be bothered by your opinions of my person, except maybe
    that here you don't get extra points for ad hominem attacks.

     

    Actually, I did no such thing. I made a request.

     

    I did not mean to say or imply that macosx cannot be discussed in
    comp.unix.admin. I expressed this by referring to the newsgroup
    comp.unix.bsd.freebsd.misc, but admittedly by mentioning it as
    ``cubfm''. If that was too opaque a reference for you, then I offer
    you my apologies for confusing you.


    --
    j p d (at) d s b (dot) t u d e l f t (dot) n l .
    This message was originally posted on Usenet in plain text.
    Any other representation, additions, or changes do not have my
    consent and may be a violation of international copyright law.
    jpd Guest

  16. #16

    Default Re: unable to send mail from UNIX

    com wrote: 

    You'd probably get a lot better response if you'd also include
    error/log file messages related to the attempt.

    base60 Guest

  17. #17

    Default Re: unable to send mail from UNIX

    In article <home.invalid>,
    Bit Twister <com> wrote: 
    >
    >Generally speaking and ignoring a firewall response, anything responding
    >to inbound connection could be considered a server from the ISP's point of view.
    >
    >I just mentioned it so the OP would consider blocking inbound
    >connections and would not be running an open relay for some
    >cracker/spammer.[/ref]

    Ah. Okay. I was focusing on outgoing mail, which seemed to be the
    OP's most pressing question.
     
    >
    >Any MTA will work for what the OP asked for.
    >[/ref]

    [ snip ]

    --
    | B. L. Massingill
    | ObDisclaimer: I don't speak for my employers; they return the favor.
    blmblm@myrealbox.com Guest

  18. #18

    Default Re: unable to send mail from UNIX

    On 25 Nov 2005 18:07:55 GMT, jpd <not.spam.it.invalid> wrote: [/ref][/ref]
     [/ref][/ref]
     [/ref]
     

    Yeah, OK, so if you're a "memorize how to do things per OS varient",
    then that might not work for you. If you're a "understand how things
    work" kind of person, then I'd say my assessment is right on.
     

    Yeah, like I said. For the purposes of the guy's question, it doesn't
    matter what esoteric subtlety it is you're going on and on about. His
    upstream is blocking relaying. Hell, even a 'doze box would fail to
    send mail when your upstream won't allow relaying, right?
     [/ref]
     

    Sorry, what's this "cubfm" to which you refer? Let's see..crossposts?
    Nope, not crossposted to anywhere else. Presumably a place, maybe a
    froup name. Can't be sussed to google for it.
     

    It's just another Unix. He asked about email in a Unix group. it's a
    general Unix question. Has nothing to do with the fact that he's on
    Apple hardware, or what kernel he's running, or in this case even which
    MTA he's using. A _helpful_ response would be to talk the guy through
    connecting to port 25 at his upstream and the dialog there, to verify
    that that's what's happening. I haven't noticed a helpful message from
    you yet, maybe that's elsewhere in the thread. Somehow I don't think
    so.
     

    I have no interest in having a conversation with you on this or any
    other topic.
     
    >
    > If what you saying were true, then NetBSD, OpenBSD, BSD/OS, and even
    > juniper's junos would all also count as being some sort of FreeBSD.[/ref]

    Don't presume to speak for me; you're clearly not qualified to do so.
     [/ref]
     

    It's not that I don't _hear_ you, it's that I don't _agree with_ you.
    That's one of those subtle differences again, I suppose. But if talking
    louder makes you happy, by all means do go on and on and on.
     [/ref]
     

    You (intentionally) miss my point.
     

    Sendmail neither knows nor cares what flavor of Unix it's installed on.
    You seem to be agreeing with me or something.
     [/ref]
     

    So, you _are_ a memorizer instead of an understander. Thanks for
    clearing that up. That, or you're playing word games, or both. Hard to
    care.
     [/ref]
     

    My, condescending and arrogant too. Buh-bye.

    <plonk>
    Dave Guest

  19. #19

    Default Re: unable to send mail from UNIX

    Hi base60,

    I didn't get any error message.

    mailx -s "sub" "com"
    how are you.
    ..
    EOT

    the first three lines I typed, EOT was the response.

    Papu

    papu Guest

  20. #20

    Default Re: unable to send mail from UNIX

    Dave Hinz wrote:
    <snip> 

    <grin>

    I was just thinking about him the other day ....
    Timothy Guest

Page 1 of 3 123 LastLast

Similar Threads

  1. Geting Mail Messages From IMAP to UNIX mail file ???
    By Ninjaboy in forum PHP Development
    Replies: 0
    Last Post: October 24th, 01:30 AM
  2. send mail from unix n rtf format
    By manoj.kushwaha in forum Linux / Unix Administration
    Replies: 4
    Last Post: September 8th, 06:03 PM
  3. Replies: 4
    Last Post: November 17th, 09:53 AM
  4. Unable to send mail
    By Steve in forum Windows XP/2000/ME
    Replies: 4
    Last Post: July 26th, 03:22 PM
  5. Unable to send e-mail from Outlook
    By Ellen in forum Windows Networking
    Replies: 4
    Last Post: July 25th, 01:33 AM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139