LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   i cannot send mails to "localhost" (http://www.linuxquestions.org/questions/slackware-14/i-cannot-send-mails-to-localhost-889403/)

swatnio 07-01-2011 11:20 AM

i cannot send mails to "localhost"
 
the solution at the end

Hello everybody!

I am trying this with Slackware 12.0.

I am trying to send mails to a user on my own machine... for example
$ mail root #root or other user, it's the same
(write subject and body)
and it looks like the mail has been sent, by then I write
mail
and i've got no new mail..
y tried
mail root@localhost
mail root@slackware #slackware is how my machine is called (`hostname` told me :P)
mail root@127.0.0.1
and none of them worked...

so, the first question is... what am i doing wrong? i thought i could send mails that way..

after hours trying to solve this, i thought i needed an smtp sever... so i started up sendmail :)
but using mail didn't worked... i connected with netcat to port 25 and sendmail answered.. I send a mail with netcat, and sendmail said it was all ok.. but i didn't recived anything...
then i realized that the mails where in queue... /var/spool/mqueue
here is what sendmail tells me (i remove all the mails in mqueue and i only post 1 here)
Code:

$ sendmail -q -v
WARNING: local host name (slackware) is not qualified; see cf/README: WHO AM I?

Running /var/spool/mqueue/p61FPoll003674 (sequence 1 of 1)
slackware: Name server timeout
<root@slackware>... Transient parse error -- message queued for future delivery
slackware: Name server timeout
slackware: Name server timeout
<root@slackware>... Transient parse error -- message queued for future delivery

slackware is at my /etc/hosts (to 127.0.0.1)

any idea?

Thanks :)

THIS WAS THE SOLUTION
I put in my /etc/hosts file this:

Code:

127.0.0.1        slackware.localhost        slackware
Thanks Irtward for the reply!

lrtward 07-01-2011 12:21 PM

A couple of things:
  1. It looks like you have your hostname set to be "slackware" and you need an FQDN, like "slackware.mydomain.com".
  2. You have 127.0.0.1 assigned to "slackware" and you need a FQDN plus localhost definitions. Something like:
    Code:

    127.0.0.1              localhost.localdomain localhost
    127.0.0.1              slackware.mydomain.com slackware


lyle_s 07-01-2011 03:53 PM

Do you have procmail installed?

I'm not sure about slackware 12.0, but for more recent versions, "Procmail is required by sendmail to deliver the local mail."

Lyle.

swatnio 07-01-2011 05:35 PM

Quote:

Originally Posted by lrtward (Post 4401563)
A couple of things:
  1. It looks like you have your hostname set to be "slackware" and you need an FQDN, like "slackware.mydomain.com".
  2. You have 127.0.0.1 assigned to "slackware" and you need a FQDN plus localhost definitions. Something like:
    Code:

    127.0.0.1              localhost.localdomain localhost
    127.0.0.1              slackware.mydomain.com slackware


Hi! Thanks! that solved the problem, i put

127.0.0.1 slackware.localhost slackware

in my /etc/hosts file and now it works :)

Quote:

Do you have procmail installed?

I'm not sure about slackware 12.0, but for more recent versions, "Procmail is required by sendmail to deliver the local mail."

Lyle.
Yes I have it, and sendmail is configured to use procmail :), at /usr/share/sendmail/cf/cf, Patrik left some configurations files to use :)


Thanks again both!

See you


All times are GMT -5. The time now is 06:36 AM.