Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
trouble sending mail from the command line [solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
ruach
n00b
n00b


Joined: 28 May 2004
Posts: 67
Location: Utah

PostPosted: Thu Apr 21, 2005 5:53 pm    Post subject: trouble sending mail from the command line [solved] Reply with quote

Greetings,

I am trying to send mail from the command line like this:
Code:

# echo 'test' |mail -s 'testing' user@someaddress

or
Code:

# echo 'test' |ssmtp user@someaddress


Either way it doesn't work. The first command gives the error "sh: line 1: sendmail:/usr/sbin/sendmail: No such file or directory" the second command sends the email, but both the subject and body are blank. I have tried a number of other invocations but none have worked. I need to be able to do this as a oneliner so I can send email from scripts. Does any one know how to get this to work with ssmtp? I really don't want to have to instll qmail or postfix just to send emails.

Thanks
-Matthew
_________________
For much wisdom is much grief and he that increaseth knowledge increaseth sorrow. Eccl 1:18


Last edited by ruach on Thu Apr 21, 2005 7:42 pm; edited 1 time in total
Back to top
View user's profile Send private message
mentok
n00b
n00b


Joined: 02 Nov 2003
Posts: 22
Location: Ontario, Canada

PostPosted: Thu Apr 21, 2005 6:22 pm    Post subject: Reply with quote

I have /usr/sbin/sendmail as a link to /usr/sbin/ssmtp and mail works fine.

Maybe try reemerging ssmtp and see if it creates a link, if not, create it manually.
_________________
Code:
'emerge' is not recognized as an internal or external command,
operable program or batch file.

Click here for hardcore nudity!!!
Back to top
View user's profile Send private message
ruach
n00b
n00b


Joined: 28 May 2004
Posts: 67
Location: Utah

PostPosted: Thu Apr 21, 2005 6:25 pm    Post subject: Reply with quote

I have the link that points sendmail to ssmtp. In fact running to following sends an email.
Code:

# echo 'test' | /usr/sbin/sendmail user@somewhere

The problems is that the email subject and body are blank.
_________________
For much wisdom is much grief and he that increaseth knowledge increaseth sorrow. Eccl 1:18
Back to top
View user's profile Send private message
dashnu
l33t
l33t


Joined: 21 Jul 2004
Posts: 703
Location: Casco Maine

PostPosted: Thu Apr 21, 2005 6:45 pm    Post subject: Reply with quote

emerge mailx

echo 'test' | mail -s "Subject" me@someplace.com
_________________
write quit bang
Back to top
View user's profile Send private message
ruach
n00b
n00b


Joined: 28 May 2004
Posts: 67
Location: Utah

PostPosted: Thu Apr 21, 2005 7:42 pm    Post subject: Reply with quote

Thanks, now it works.
_________________
For much wisdom is much grief and he that increaseth knowledge increaseth sorrow. Eccl 1:18
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum