Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi Chris,
I have downloaded the mailx utility but when I am trying to send the mail mentioned in the thread http://www.linuxquestions.org/questi...d-line-943861/ I am not able to send the mail.I have installed fedora 16 on a virtual machine and then I am trying to send a mail to my yahoo account from the terminal.
When I run this command mail -s "Test mail" xyz@somewhere.com my bash prompt gets stuck and I have to press ctrl D to get it back.
When I run your other command (uname -n) |mail -s "test email" xyz@somewhere.com it runs but when I check my yahoo account I dont have the mail.I am behind a proxy.But I can access the internet from my guest OS.Is there some setting that I am missing?
Last edited by Ajit Gunge; 05-11-2012 at 05:47 AM.
When I run this command mail -s "Test mail" xyz@somewhere.com my bash prompt gets stuck and I have to press ctrl D to get it back.
That's normal. mail (and mailx) read the body of the email from stdin. Either you type the mail directly and terminate with Ctrl+D or you use echo <text of mail body> | mail -s "Test mail" <email address>
You also need a "mail transfer agent" (MTA) to transfer mail from the local machine to the likes of Yahoo's servers. Popular MTAs are exim, postfix and sendmail.
That's normal. mail (and mailx) read the body of the email from stdin. Either you type the mail directly and terminate with Ctrl+D or you use echo <text of mail body> | mail -s "Test mail" <email address>
You also need a "mail transfer agent" (MTA) to transfer mail from the local machine to the likes of Yahoo's servers. Popular MTAs are exim, postfix and sendmail.
Hi catkin.Thanks for the information.I have downlaoded the sendmail MTA.I run the command mail -s "Test mail" <email address> but I still dotn see the email at my yahoo account.Is there something more that I have to do.
sendmail is powerful and flexible. So it needs a lot of configuring. Depending on exactly what you want to do, you will need "smarthost" and "masquerade" in the configuration.
Thanks catkin for your inputs.I have doubts.I installed the sendmail using the [QUOTE][/yum install sendmail command.QUOTE].Now what I want is to read the readme file for the sendmail but I dontknow where it is install and how to access the readme file.I am following the links mentioned by you.
Right now all I want to do is test if I can send a mail to my yahoo account from command line.I am not sure of which ISP I want to use.I want it at my yahoo account so I guess it is yahoo.The domain name should be yahoo.com I guess.
IDK RHEL or Fedora so don't know what they give you as a starting point for configuring sendmail.
Here's how I set it up on Slackware for a similar setup (but not Yahoo for either the SMTP server to send the mail to or as the masqueraded origin domain). My computer is called CW8 so you will want to change that. In case of multiple attempts, this is version 1 or v1. You may have a /usr/share/sendmail/cf/cf directory but you will not have the sendmail-slackware.mc sample configuration file.
If you want to forward all mail to root to your Yahoo mail, add a line to /etc/mail/aliases, something like
Code:
root:Ajit@yahoo.co.in
and maybe (I do this but it may not be necessary with the alias), /root/.forward with
Code:
Ajit@yahoo.co.in
You will need to put your Yahoo username and password in /etc/mail/authinfo, something like
root@CW8:~# cd /etc/mail \
&& chmod 400 authinfo \
&& makemap hash authinfo < authinfo \
&& newaliases \
&& mv sendmail.cf sendmail.cf.original\
&& cd /usr/share/sendmail/cf/cf \
&& cp -p sendmail-slackware.mc sendmail-slackware.CW8.v1.mc \
&& vi sendmail-slackware.CW8.v1.mc \
&& diff -u sendmail-slackware.mc sendmail-slackware.CW8.v1.mc
/etc/mail/aliases: 16 aliases, longest 22 bytes, 188 bytes total
--- sendmail-slackware.mc 2010-04-24 04:26:15.000000000 +0530
+++ sendmail-slackware.CW8.v1.mc 2012-04-10 21:32:47.597000287 +0530
@@ -1,3 +1,4 @@
+dnl#@ Local changes identified by comment introducer dnl#@
dnl# This is the default sendmail .mc file for Slackware. To generate
dnl# the sendmail.cf file from this (perhaps after making some changes),
dnl# use the m4 files in /usr/share/sendmail/cf like this:
@@ -10,13 +11,15 @@
dnl# cp config.cf /etc/mail/sendmail.cf
dnl#
include(`../m4/cf.m4')
-VERSIONID(`default setup for Slackware Linux')dnl
+dnl#@VERSIONID(`default setup for Slackware Linux')dnl
+VERSIONID(`CW8 version 1')dnl
OSTYPE(`linux')dnl
dnl# These settings help protect against people verifying email addresses
dnl# at your site in order to send you email that you probably don't want:
define(`confPRIVACY_FLAGS', `authwarnings,novrfy,noexpn,restrictqrun')dnl
dnl# Uncomment the line below to send outgoing mail through an external server:
-dnl define(`SMART_HOST',`mailserver.example.com')
+dnl#@ define(`SMART_HOST',`mailserver.example.com')
+dnl define(`SMART_HOST',`<here you put the name of Yahoo's SMTP server>')
dnl# No timeout for ident:
define(`confTO_IDENT', `0')dnl
dnl# Enable the line below to use smrsh to restrict what sendmail can run:
@@ -34,9 +37,18 @@
FEATURE(`redirect')dnl
dnl# Turn this feature on if you don't always have DNS, or enjoy junk mail:
dnl FEATURE(`accept_unresolvable_domains')dnl
-EXPOSED_USER(`root')dnl
+dnl#@ Local additional FEATURES
+FEATURE(authinfo)
+FEATURE(delay_checks)dnl
+FEATURE(masquerade_envelope)dnl
+FEATURE(allmasquerade)dnl
+FEATURE(masquerade_entire_domain)dnl
+dnl#@EXPOSED_USER(`root')dnl
dnl# Also accept mail for localhost.localdomain:
LOCAL_DOMAIN(`localhost.localdomain')dnl
MAILER(local)dnl
MAILER(smtp)dnl
MAILER(procmail)dnl
+dnl#@ Local additions
+MASQUERADE_AS(`<here you put the domain you masqureade as -- yahoo.com?>')dnl
+DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')
root@CW8:/usr/share/sendmail/cf/cf# sh Build sendmail-slackware.CW8.v1.mc
root@CW8:/usr/share/sendmail/cf/cf# cp -p sendmail-slackware.CW8.v1.cf /etc/mail/sendmail.cf
Good luck. The above are ideas to get you started. Maybe Yahoo has special requirements. I've done similar for Gmail and Google mail; they required the SMTP server port to be specified.
Hi Catkin,
Thanks for you response.I am uisng Fedora 16.You said your cmputer is called CW8 mine currently is called localhost.How can I change that.Also it seems that a lot of files that you mentioned are not there in my setup like /etc/mail/alaises,/root/.forward.I am trying to figure out how to do the changes you suggested for fedora following few tutotials online.Will let you know if I succeed.Thanks
HI catkin.
For the hostname changes I am trying to follow the instruction given here but I am stuck at the steps 4-7 as I cannot find the sytem tab under my system to configure the dns.Please let me know what am I missing.I do have the file /etc/alaises.I am trying with the changes you suggested.Will let you know my findings.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.