Results 1 to 4 of 4

Thread: quick ques

  1. #1
    Join Date
    Nov 2001
    Location
    Canada
    Posts
    1,963

    quick ques

    I have a file called ken.txt
    inside ken.txt is just a paragraph
    just words
    sentences
    anyway

    if you do

    cat ken.txt | mail [email protected]

    it will email me everything in ken.txt
    but it shows as
    from: [email protected]'shostname in my inbox

    so my servers hostname is
    rockstar.mydomain.com

    so it says [email protected]

    All i want to do is figure out how to make it so i can email [email protected] the contents of ken.txt via the command line, but make it say from email address: [email protected]
    you konw? so when i check my inbox it says its from [email protected]

    so when i hit reply i'll be replying back to [email protected]

    Does anyone know how to do this from command line?

    you might think 'man mail' -- but that doesn't give me any info on hwo to do it, maybe i' missing something

    even tried

    adduser bob
    cat ken.txt | mail -u bob [email protected]

    then it says

    [email protected] which is not good
    need it to say mydomain.com

    Anyone have any idea?

  2. #2
    Join Date
    Nov 2001
    Location
    Canada
    Posts
    1,963
    n/m got it

  3. #3
    Join Date
    Jul 2001
    Location
    Indianapolis, IN
    Posts
    537
    try..

    cat file_name.txt | /usr/sbin/sendmail -O NoRecipientAction=add-to -f [email protected] [email protected]
    neil MCITP, VCP

  4. #4
    Join Date
    Nov 2000
    Location
    Moran, Ks
    Posts
    186
    If you want to specify multiple header fields, it could be done like this...

    echo "From: [email protected]
    To: My Name <[email protected]>
    Bcc: [email protected]
    Subject: This is a test" \
    | cat - /home/myacct/file.txt \
    | /usr/sbin/sendmail -oi -t

    Of course, if you were going to do this often, you would probably want to create a text file with the appropriate headers in it, then just cat the two files to sendmail.

Posting Permissions

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