LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   sendmail not working. (https://www.linuxquestions.org/questions/linux-newbie-8/sendmail-not-working-809318/)

knockout_artist 05-21-2010 10:38 AM

sendmail not working.
 
Hi,

OS = debian

I have my laptop and desktop on same subnet.

From my laptop(FC11) I can send email from command line

Code:

echo  $HOSTNAME | mail -s test my@email.com
But from debian I can't.

I copied same sendmail.cf on both machines.

On debian it sort of hangs for a long time.

I there any way to diagnose the issue?

Thanks

rweaver 05-21-2010 11:02 AM

on both machines try- 'echo $hostname | /usr/sbin/sendmail -v my@email.com' and compare the output and post it here, also what do your logs on the debian machine say and is sendmail actually currently running?

knockout_artist 05-21-2010 12:04 PM

This one works(FC)
Code:


@allegator ~]$ echo $HOSTNAME | /usr/sbin/sendmail -v my@email.com
WARNING: local host name (allegator) is not qualified; see cf/README: WHO AM I?
my@email.com... Connecting to [127.0.0.1] via relay...
220 allegator ESMTP Sendmail 8.14.3/8.13.8; Fri, 21 May 2010 12:56:40 -0400
>>> EHLO allegator
250-allegator Hello localhost [127.0.0.1], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-AUTH DIGEST-MD5 CRAM-MD5
250-DELIVERBY
250 HELP
>>> MAIL From:<champ@allegator> SIZE=10 AUTH=champ@allegator
250 2.1.0 <mp@allegator>... Sender ok
>>> RCPT To:<my@email.com>
>>> DATA
250 2.1.5 <my@email.com>... Recipient ok
354 Enter mail, end with "." on a line by itself
>>> .
250 2.0.0 o4LGuedB006474 Message accepted for delivery
my@email.com... Sent (o4LGuedB006474 Message accepted for delivery)
Closing connection to [127.0.0.1]
>>> QUIT
221 2.0.0 allegator closing connection
allegator ~]$

Broken one(Deb)::

Code:

test:~# echo $HOSTNAME | /usr/sbin/sendmail -v my@email.com


WARNING: local host name (test) is not qualified; see cf/README: WHO AM I?
my@email.com... Connecting to [127.0.0.1] via relay...
220 test ESMTP Sendmail 8.14.3/8.13.8; Fri, 21 May 2010 12:58:05 -0400
>>> EHLO test
250-test Hello localhost [127.0.0.1], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-DELIVERBY
250 HELP
>>> MAIL From:<root@test> SIZE=5
250 2.1.0 <root@test>... Sender ok
>>> RCPT To:<my@email.com>
>>> DATA
250 2.1.5 <my@email.com>... Recipient ok
354 Enter mail, end with "." on a line by itself
>>> .
421 4.3.0 collect: Cannot write ./dfo4LGw5VB008636 (bfcommit, uid=0, gid=107): Permission denied
>>> QUIT
my@email.com... Deferred: 421 4.3.0 collect: Cannot write ./dfo4LGw5VB008636 (bfcommit, uid=0, gid=107): Permission denied
Closing connection to [127.0.0.1]
test:~#


rweaver 05-21-2010 12:14 PM

The problem is on the deferred line, the sendmail daemon doesn't have correct permissions to write to a directory that it needs.

Check /tmp, /var/tmp, /var/spool/mqueue, and /var/mail. Sendmail needs to be able to write to those locations (and it sounds silly but make sure /var or / isn't full)

knockout_artist 05-21-2010 12:18 PM

Code:


test:~# ls  -ld  /var/spool/mqueue
drwxr-s--- 2 smmta smmsp 4096 2010-05-19 06:37 /var/spool/mqueue
test:~# ls  -ld  /var/mail
drwxrwsrwt 2 root mail 4096 2010-05-16 06:25 /var/mail
test:~# ls  -ld  /var/tmp
drwxrwxrwt 2 root root 4096 2010-05-19 06:30 /var/tmp
test:~# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/hda1              18G  4.3G  13G  26% /
tmpfs                756M    0  756M  0% /lib/init/rw
udev                  10M  704K  9.4M  7% /dev
tmpfs                756M    0  756M  0% /dev/shm


Every thing is mounted under / , so there is still space there.

Thanks.

rweaver 05-21-2010 12:44 PM

What do you get when you 'cat /etc/group | grep 107'? and what are perms on /tmp?

knockout_artist 05-21-2010 12:45 PM

Code:

chmod 1777 /var/spool/mqueue
This fixed the problem.

But its still extremely slow compare to FC machine.

rweaver 05-21-2010 12:54 PM

Slowness in sendmail I've found 9/10 times is related to dns. Check your resolv.conf settings and make sure your dns servers resolve both your local machine name and the names of machines connecting.

knockout_artist 06-03-2010 10:03 AM

Yes. dns had to be corrected.

Its working like a charm now, thanks your your helpl.

rweaver 06-03-2010 10:37 AM

Excellent, no problem, glad it's working for you!


All times are GMT -5. The time now is 02:31 AM.