Re: Help Me with shell script please

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Actually in sendmail command we can use  -F somename@xxxxxxxxxxxxxx so the
mail will be like it is from somename@xxxxxxxxxxxxxx   username (in the FROM
Field of the receivers mail client).

But how we can use the mail and sendmail together in one script, so that
sendmail command will resolve the FROM Problem, and the mail command will do
the rest part of this TASK ?

Thanks
Rudolf


----- Original Message ----- 
From: "Ben Yau" <byau@xxxxxxxxxxxxxxxx>
To: <redhat-list@xxxxxxxxxx>
Sent: Saturday, January 17, 2004 5:01 AM
Subject: RE: Help Me with shell script please


> >
> > > > 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@xxxxxxxxxx?subject=unsubscribe
> https://www.redhat.com/mailman/listinfo/redhat-list


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

[Index of Archives]     [CentOS]     [Kernel Development]     [PAM]     [Fedora Users]     [Red Hat Development]     [Big List of Linux Books]     [Linux Admin]     [Gimp]     [Asterisk PBX]     [Yosemite News]     [Red Hat Crash Utility]


  Powered by Linux