FedoraForum.org - Fedora Support Forums and Community
Results 1 to 7 of 7
  1. #1
    Join Date
    Oct 2017
    Location
    italy
    Posts
    4

    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?!

  2. #2
    Join Date
    Oct 2010
    Location
    Canberra
    Posts
    2,708

    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.

  3. #3
    Join Date
    Oct 2017
    Location
    italy
    Posts
    4

    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.

  4. #4
    Join Date
    Oct 2010
    Location
    Canberra
    Posts
    2,708

    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 ?
    Last edited by ocratato; 13th October 2017 at 01:28 PM.

  5. #5
    Join Date
    Oct 2017
    Location
    italy
    Posts
    4

    Smile Re: Email sent with mail command find, but no mail ever received

    Quote Originally Posted by ocratato
    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!!!

  6. #6
    Join Date
    Feb 2005
    Location
    London, UK
    Posts
    565

    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

  7. #7
    Join Date
    Oct 2017
    Location
    italy
    Posts
    4

    Re: Email sent with mail command find, but no mail ever received

    Quote Originally Posted by HaydnH
    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!

Similar Threads

  1. Sendmail -- sending mail with the mail command -- doesn't work :-(
    By carolinevdh in forum Servers & Networking
    Replies: 1
    Last Post: 13th August 2009, 07:18 PM
  2. Qmail Not Processing received mail
    By jdh239 in forum Servers & Networking
    Replies: 3
    Last Post: 14th September 2006, 03:06 AM

Tags for this Thread

Posting Permissions

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