Fedora Linux Support Community & Resources Center
  #1  
Old 13th October 2017, 10:03 AM
ebsco Offline
Registered User
 
Join Date: Oct 2017
Location: italy
Posts: 4
linuxubuntufirefox
Unhappy Email sent with mail command find, but no mail ever received

I have tried to send email using mail, subject and content , i sent the email mostly to myself.
I was using VirtualBox with Fedora as guest.
Code:
[MyUserName1@localhost ~]$ mail -s "some mail" MyUserName1
hi there
.
When i chaecked my mail : there was always no mail:
Code:
[MyUserName1@localhost ~]$ mail
no mail for MyUserName1
I replaced MyUserName1 with MyUserName1@localhost, and also with MyUserName1@localhost.localdomain, which is my localdomain in VirtualBox.
in var/mail/MyUserName1, or /var/spool/MyUserName1 , using cat command displayed nothing.

I even used mutt, the message was sent successfully but there is no mail when i checked.
Is there anything i am missing here?!
Reply With Quote
  #2  
Old 13th October 2017, 10:47 AM
ocratato Offline
Registered User
 
Join Date: Oct 2010
Location: Canberra
Posts: 2,650
linuxfirefox
Re: Email sent with mail command find, but no mail ever received

Its my (admittedly vague) understanding that the mail command is just the client side program. You would also need a server, such as sendmail or similar to route mail on the local machine. I don't believe such programs are started by default in many distributions as most people just use their ISP's server.
__________________
Has anyone seriously considered that it might be turtles all the way down?
That's very old fashioned thinking.
The current model is that it's holographic nested virtualities of turtles, all the way down.
Reply With Quote
  #3  
Old 13th October 2017, 12:22 PM
ebsco Offline
Registered User
 
Join Date: Oct 2017
Location: italy
Posts: 4
linuxubuntufirefox
Unhappy Re: Email sent with mail command find, but no mail ever received

Thank for the reply.
In my host Ubuntu, mail works for sending mails to local users out of the box. In using mail command, there is no requirement to anything for it to work rather than installing it, if it is not installed by default.

Going back to Fedora, after installing ,restarting and logging in as root:

Code:
[root@localhost ~]# sendmail -s "Hello letter" MyUserName1@localhost.localdomain
hello there
.
[root@localhost ~]# exit
[MyUserName1 ~]$ mail
no mail for MyUserName1
Notice that i am using sendmail instead.

But here is another try with a message with command mail and the option -v , for verbose, i got this following :
Code:
MyUserName1 ~]$ mail -v -s "Hello letter" MyUserName1
Hello
.
EOT
MyUserName1... Connecting to [127.0.0.1] via relay...
MyUserName1... Deferred: Connection refused by [127.0.0.1]
I wish this helps on identifiying why mail command is not working.
Reply With Quote
  #4  
Old 13th October 2017, 01:03 PM
ocratato Offline
Registered User
 
Join Date: Oct 2010
Location: Canberra
Posts: 2,650
linuxfirefox
Re: Email sent with mail command find, but no mail ever received

Ubuntu probably starts a local email server by default, which is why it works.

The connection refused is a good indication that no mail server is running.
Your sendmail command used sendmail as a client - there still needs to be a server running (basically so that it can move files from one owner to another).

You can check if a server is running with
Code:
ss -l | grep smtp

I am not running Fedora, so I cannot say what the correct mail server is, and hence how to start it.
Can someone else advise ?
__________________
Has anyone seriously considered that it might be turtles all the way down?
That's very old fashioned thinking.
The current model is that it's holographic nested virtualities of turtles, all the way down.

Last edited by ocratato; 13th October 2017 at 01:28 PM.
Reply With Quote
  #5  
Old 13th October 2017, 02:03 PM
ebsco Offline
Registered User
 
Join Date: Oct 2017
Location: italy
Posts: 4
linuxubuntufirefox
Smile Re: Email sent with mail command find, but no mail ever received

Quote:
Originally Posted by ocratato View Post
Ubuntu probably starts a local email server by default, which is why it works.

The connection refused is a good indication that no mail server is running.
Your sendmail command used sendmail as a client - there still needs to be a server running (basically so that it can move files from one owner to another).

You can check if a server is running with
Code:
ss -l | grep smtp

I am not running Fedora, so I cannot say what the correct mail server is, and hence how to start it.
Can someone else advise ?
You are definitely right!
I got nothing no output from running your command , and yes, fedora sendmail seems to use SMTP (Simple Mail Transfer Protocol), I got some help from this fedora guide.
Sendmail sendmail-cf configuration package need to be installed, i have to :
Code:
~]# dnf install sendmail-cf
generate new comfiguration:
Code:
~]# make all -C /etc/mail/
Also this has to be done:
Code:
~]# cd /etc/mail/
~]# make all
An d then restart service:
Code:
~]# systemctl restart sendmail
Sending mail now work perfectly.

I am surprised at the amount of detail and simplicity the Fedoraproject's guides are written , i am not used to that at all!!!
Reply With Quote
  #6  
Old 13th October 2017, 02:07 PM
HaydnH's Avatar
HaydnH Offline
Registered User
 
Join Date: Feb 2005
Location: London, UK
Posts: 509
windows_7chrome
Re: Email sent with mail command find, but no mail ever received

There's too many things to write in a brief post here, please reference the admin guide which will tell you how to install sendmail, sendmail-cf and configure it all:

https://docs-old.fedoraproject.org/e...-sendmail.html
Reply With Quote
  #7  
Old 13th October 2017, 02:14 PM
ebsco Offline
Registered User
 
Join Date: Oct 2017
Location: italy
Posts: 4
linuxubuntufirefox
Re: Email sent with mail command find, but no mail ever received

Quote:
Originally Posted by HaydnH View Post
There's too many things to write in a brief post here, please reference the admin guide which will tell you how to install sendmail, sendmail-cf and configure it all:

https://docs-old.fedoraproject.org/e...-sendmail.html
That kind of detail in that documentation is indeed staggering to me!
Thank you for your replay!
Reply With Quote
Reply

Tags
command , email , mail , received

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sendmail -- sending mail with the mail command -- doesn't work :-( carolinevdh Servers & Networking 1 13th August 2009 07:18 PM
Qmail Not Processing received mail jdh239 Servers & Networking 3 14th September 2006 03:06 AM


Current GMT-time: 10:17 (Saturday, 21-10-2017)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat