RE: Help Me with shell script please

From: Ben Yau (byau_at_cardcommerce.com)
Date: 01/17/04

  • Next message: Jason Dixon: "RE: Help Me with shell script please"
    To: <redhat-list@redhat.com>
    Date: Fri, 16 Jan 2004 18:01:42 -0800
    
    

    >
    > > > perl -e 'open(LIST, "address.txt"); while (<LIST>) { open(MAIL,
    > > > "|mail -s \"subject goes here\" $_"); print MAIL "message goes
    > > > here"; close(MAIL); } close(LIST);'
    > >
    > > How does the above give you more refined control of the "From" line?
    >
    > It doesn't, that's what I said. Use Mail::Internet if you want to forge
    > the From header. If this is your desire, you're probably a spammer and
    > my level of support drops off right here. :)

    In your last email you wrote:
    "If you need more refined control over the From (say, for spamming... gak!),
    you
    could use Mail::Internet."

    So in my email response I wrote:
    How does the above give you more refined control of the "From" line?"

    Now you're saying "it doesn't, that's what I said."

    I guess my response to you would have to be
    "no, that's not what you said. You said 'if you need more refined control
    over the From (say, for spamming... gak!), you could use Mail::Internet."

    Perhaps the reason I'm asking you for clarification is because when someone
    usually mentions a module of some sort, the example they post usually
    includes something that utilizes that module and supports their claim .

    That's also why the first line of my email said
    "I'm curious"

    Because to my untrained eye (untrained in mail::internet) your perl script
    did not represent any "refined control" and I was wondering where that was
    coming from. I'll explain that in more detail in the next section because
    that's where it's more relevant

    > > sure there's more to it than that.
    >
    > I'm not sure I'd call it a wrapper any more than I'd call ANY perl
    > script that accesses the shell a wrapper. It opens a filehandle to the
    > mail process and prints accordingly.

    Jason, read my email again more carefully. I said it was a "wrapper around
    the mail command". The "around the mail command" is the important part of
    my email, not the "wrapper part". Look at your perl script again.

    perl -e 'open(LIST, "address.txt"); while (<LIST>) { open(MAIL, "|mail -s
    \"subject goes here\" $_"); print MAIL "message goes here"; close(MAIL); }
    close(LIST);'

    You mention a perl module Mail::Internet, and yet you don't specify anything
    from it as far as I can tell. No unfamiliar perl
    commands/functions/subroutines here. Where does Mail::Internet come in?
    Where would the "refined control" come in? To me it looks like you're just
    using the "mail" command. Are you? You see Jason I'm very curious becuase
    as far a I can see

    1) your example above looks like a regular perl script, which to me doesn't
    have much of an advantage over running it from the command line, and to my
    untrained eye definitely wouldn't give you refined control over headers.
    In fact, it is less desirable because you're just addig a wrapper to 'mail'.
    Why not just run 'mail' directly from bash instead of running it from perl
    which will run it from bash?

    and

    2) since I give everyone the benefit of the doubt, and since I'm not
    familiar with Mail::Internet, I was assuming I was missing something, which
    is why I was asking for clarification and which is also why I said in the
    email you responded to:
    (and i quote)
    "Your perl command seems ot(sic) just be a wrapper around the mail command.
    I'm
    sure there's more to it than that. "
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    >
    > > Does the Mail::Internet mod itself know
    > > how to grab your real name from /etc/passwd ?
    >
    > No, Mail::Internet is more fine-grained. You provide the mail headers
    > you wish to sculpt your message with.
    >

    Yes, I figured that. I was asking you in what ways ? I mean we could all
    manipulate the headers using sendmail (at least the Date, From, To, Cc, Bcc,
    Subject, and any fake header we want to make up on our own).

    > > That would be very helpful.
    >
    > Uh-oh, spammer alert going off.
    >

    Is that how you treat everyone who wants a clarification from you?

    Don't get me wrong please Jason. You're definitely bright, and I can see
    where you are coming from. I side with you on that. It's just that if you
    also want to encourage people to learn more about computers, linux, and
    other topics, especially topics that you yourself bring up in a mailing list
    forum, don't you agree that we should also be a bit more polite?

    > > In the past I have just used sendmail in my script to have
    > better control of
    > > the headers. Does the perl module have similar control ?
    >
    > Obviously, yes.

    Yes.

    > > Looks like when I have time I should check out the Mail::Internet
    > > documentation eh?
    >
    > If you're comfortable with Perl, yes.

    I'll go ahead and do that.

    If you wouldn't mind posting a summary of some things that Mail::Internet
    can do or perhaps even better an example project of how you were able to
    utilize Mail::Internet to its fullest (no need to go into detail ... ), I'm
    sure it will inspire a lot of the curious readers out there like myself to
    not just check Mail::Internet out but possibly even poke around cpan's site
    for other modules they have which might be able to ease our sysadmin lives a
    lot more.

    anyway, have a good weekend

    Ben Yau

    -- 
    redhat-list mailing list
    unsubscribe mailto:redhat-list-request@redhat.com?subject=unsubscribe
    https://www.redhat.com/mailman/listinfo/redhat-list
    

  • Next message: Jason Dixon: "RE: Help Me with shell script please"

    Relevant Pages

    • Re: Help Me with shell script please
      ... Actually in sendmail command we can use -F somename@somedomain.com so the ... >> script that accesses the shell a wrapper. ... No unfamiliar perl ...
      (RedHat)
    • Re: Wait for background processes to complete
      ... To be able to execute commands in the background and wait for their ... The documentation I am referring to is http://perldoc.perl.org/. ... You can run a command in the background with: ... There is a general problem with perl documentation: ...
      (comp.lang.perl.misc)
    • Re: Perl For Amateur Computer Programmers
      ... >professional computer programmers could use with the same ease as Basic. ... >Perl For Amateur Computer Programmers ... Also, taking into account that you're appealing to "scientists", it ... Also, as a side note, you seem to use the noun "command" in a naive ...
      (comp.lang.perl.misc)
    • Obtaining complete Unix command line that evoked script as string
      ... If there is a more appropriate list for this, let me know; the other perl lists I've seen seem to specialised for this. ... Note this is not just the arguments of the call to the script, but everything including pipes and redirects, etc., e.g. ... Ideally the perl interpreter would grab the complete command line as its evoked and I'd access this via a variable. ...
      (perl.beginners)
    • Thanks for the comments Jan. 25, 2006
      ... "shadow" operating system which is running behind Windows. ... Perl can then collect data from that program and do ... that by sending longer strings etc. to the Windows clipboard and then having ... SendKeysuse a Ctrl V command to paste the information to the text editor ...
      (comp.lang.perl.misc)