CentOS Icon CentOS Logo
CentOS Text
   
  
www.centos.org Forum Index
   CentOS 5 - Server Support
  cron and sendmail

 

 Bottom   Previous Topic   Next Topic
  •  Rate Thread
      Rate this Thread
      Excellent
      Good
      Average
      Bad
      Terrible
Poster Thread
  •  RENOO
      RENOO
Re: cron and sendmail
#12
Newbie
Joined: 2010/8/5
From
Posts: 10
The weekend is over now.

I still playing with mails !! I have notice view things :

I have several users and this machine. One is "Ocean", another is "tux", and the third one is "ren"

"ren" and "tux" can send mail to each other easily with the command from "ren" session

 echo "Hi tux"  | mail -s Subjet ren 


But the user Ocean has trouble and I have read it is because of the capital O.
" User Unknow" appears (mail -v -s )

So the User Unknow error in the previous code comes from the capital O.

Now from ren session

echo "Hello free" | mail -v -s subject rlaxxx@free.fr 
rlaxxx@free.fr... Connecting to [127.0.0.1] via relay...
220 localhost.localdomain ESMTP Sendmail 8.13.8/8.13.8; Tue, 10 Aug 2010 20:02:42 +0200
>>> EHLO localhost.localdomain
250-localhost.localdomain Hello localhost.localdomain [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:<ren@localhost.localdomain> SIZE=50 AUTH=ren@localhost.localdomain
250 2.1.0 <ren@localhost.localdomain>... Sender ok
>>> RCPT To:<rlaxxx@free.fr>
>>> DATA
250 2.1.5 <rlaxxxx@free.fr>... Recipient ok (will queue)
354 Enter mail, end with "." on a line by itself
>>> .
250 2.0.0 o7AI2gbv006479 Message accepted for delivery
rlaborbe@free.fr... Sent (o7AI2gbv006479 Message accepted for delivery)
Closing connection to [127.0.0.1]
>>> QUIT
221 2.0.0 localhost.localdomain closing connection



The mail is queue but not send
mailq
                /var/spool/mqueue (1 request)
-----Q-ID----- --Size-- -----Q-Time----- ------------Sender/Recipient-----------
o7AI2gbv006479       11 Tue Aug 10 20:02 <ren@localhost.localdomain>
                 (host map: lookup (free.fr): deferred)
                                         <rlaxxx@free.fr>
                Total requests: 1




May I ask for help ?
Posted on: 2010/8/10 18:09
Create PDF from Post Print
Top
  •  pschaff
      pschaff
Re: cron and sendmail
#11
Moderator
Joined: 2006/12/13
From Tidewater, Virginia, North America
Posts: 18773
Perhaps it will help someone who is a real mail expert to help you fix the underlying issue. Some of them will probably be checking in tomorrow, after the weekend. We're beyond my limits.
_________________
Phil

Recommended reading: FAQ & Readme first ; Search hint: google "your topic site:centos.org"; Smart Questions
Posted on: 2010/8/8 17:13
Create PDF from Post Print
Top
  •  RENOO
      RENOO
Re: cron and sendmail
#10
Newbie
Joined: 2010/8/5
From
Posts: 10
Thank you once again.

Not I didn't not modify anything in my sendmail configuration before.

Now, as you mentionned, I modified my /etc/mail/sendmail.mc and wrote
dnl define(`SMART_HOST', `smtp.free.fr')dnl 


It seems the command make went well :

[root@rio ~]# make -C /etc/mail
make: Entering directory `/etc/mail'
make: Leaving directory `/etc/mail'



But still when I tried to send a mail :
Ocean@rio:~$ echo hello | mail -s test rlaxxx@yahoo.fr

(I have changed the outgoing adress this time )

[root@rio ~]# mailq
                /var/spool/mqueue (1 request)
-----Q-ID----- --Size-- -----Q-Time----- ------------Sender/Recipient-----------
o78Fo4HS016111        6 Sun Aug  8 17:50 <Ocean@localhost.localdomain>
                 (host map: lookup (yahoo.fr): deferred)
                                         <rlaxxx@yahoo.fr>
                Total requests: 1



the mail do not leave the queue.

I had a look at the following page :


map lookup

I don't understand everything but I can run the following command (see at the end of the page)

sendmail -v -d8.32 -qIo78Fo4HS016111

Running /var/spool/mqueue/o78Fo4HS016111 (sequence 1 of 1)
dns_getcanonname(yahoo.fr, trymx=1)
dns_getcanonname: trying yahoo.fr. (AAAA)
        NO: errno=0, h_errno=4
dns_getcanonname: trying yahoo.fr. (A)
        YES
dns_getcanonname: yahoo.fr
getmxrr(yahoo.fr., droplocalhost=1)
<rlaborbe@yahoo.fr>... Connecting to mx2.mail.eu.yahoo.com. via esmtp...
220 mta1013.mail.ukl.yahoo.com ESMTP YSmtp service ready
>>> EHLO localhost.localdomain
250-mta1013.mail.ukl.yahoo.com
250-8BITMIME
250-SIZE 41943040
250 PIPELINING
>>> MAIL From:<Ocean@localhost.localdomain> SIZE=564
250 sender <ocean@localhost.localdomain> ok
>>> RCPT To:<rlaxxx@yahoo.fr>
>>> DATA
250 recipient <rlaxxx@yahoo.fr> ok
354 go ahead
>>> .
250 ok dirdel
<rlaxxx@yahoo.fr>... Sent (ok dirdel)
Closing connection to mx2.mail.eu.yahoo.com.
>>> QUIT
221 mta1013.mail.ukl.yahoo.com


And the mail arrives at destination. Great !
Does this help ?
Posted on: 2010/8/8 16:10
Create PDF from Post Print
Top
  •  pschaff
      pschaff
Re: cron and sendmail
#9
Moderator
Joined: 2006/12/13
From Tidewater, Virginia, North America
Posts: 18773
Have you modified /etc/mail/sendmail.mc to define your ISP's SMTP server in the line
dnl define(`SMART_HOST', `smtp.your.provider')dnl

and then done
make -C /etc/mail 
?
_________________
Phil

Recommended reading: FAQ & Readme first ; Search hint: google "your topic site:centos.org"; Smart Questions
Posted on: 2010/8/6 20:10
Create PDF from Post Print
Top
  •  RENOO
      RENOO
Re: cron and sendmail
#8
Newbie
Joined: 2010/8/5
From
Posts: 10
Sorry for the quantity of info. But as I don't know what is the probleme...

Yes there is a user called Ocean. It is the main user of the machine, the one running the cron.

But there is not link between Ocean and rlaxxx@free.fr. I don't know how to use aliases.

It is specified in the cron doc that cron send mail to current user or look for variable MAILTO which is set in my case to rlaxxx@free.fr
Following your question :
Quote:
host free.fr
free.fr has address 212.27.48.10
free.fr mail is handled by 10 mx1.free.fr.
free.fr mail is handled by 20 mx2.free.fr.


Suppose I want to send a mail with
echo blabla | mail -s test rlaxxx@free.fr



What is needed to be set up ?

Thank you very much pschaff, I hope I will make it !
Posted on: 2010/8/6 18:58
Create PDF from Post Print
Top
  •  pschaff
      pschaff
Re: cron and sendmail
#7
Moderator
Joined: 2006/12/13
From Tidewater, Virginia, North America
Posts: 18773
Lots of info now, but I still can't spot the problem. Perhaps someone better versed in mail transport issues, than I am, will.

Is there a local user called "Ocean"? There seem to be a lot of complaints about that. If so, is "Ocean" forwarded to "rlaxxx@free.fr" in /etc/aliases, and have you run "newaliases"? What does "host free.fr" return?
_________________
Phil

Recommended reading: FAQ & Readme first ; Search hint: google "your topic site:centos.org"; Smart Questions
Posted on: 2010/8/6 13:47
Create PDF from Post Print
Top
  •  RENOO
      RENOO
Re: cron and sendmail
#6
Newbie
Joined: 2010/8/5
From
Posts: 10
Thanks for your help

Here is the output of my getinfo.sh

== BEGIN uname -rmi ==
2.6.18-194.8.1.el5 x86_64 x86_64
== END   uname -rmi ==

== BEGIN rpm -q centos-release ==
centos-release-5-5.el5.centos
== END   rpm -q centos-release ==

== BEGIN getenforce ==
Permissive
== END   getenforce ==

== BEGIN rpm -q yum rpm python ==
yum-3.2.22-26.el5.centos
rpm-4.4.2.3-18.el5
python-2.4.3-27.el5
== END   rpm -q yum rpm python ==

== BEGIN ls /etc/yum.repos.d ==
CentOS-Base.repo
CentOS-Media.repo
gbvalor.repo
gbvalor.repo~
mirrors-rpmforge
rpmforge.repo
rpmforge-testing.repo
webmin.repo
webmin.repo~
== END   ls /etc/yum.repos.d ==

== BEGIN cat /etc/yum.conf ==
[main]
cachedir=/var/cache/yum
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
distroverpkg=redhat-release
tolerant=1
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1

# Note: yum-RHN-plugin doesn't honor this.
metadata_expire=1h

# Default.
# installonly_limit = 3

# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d
== END   cat /etc/yum.conf ==

== BEGIN yum repolist all ==
Loaded plugins: fastestmirror, priorities
Loading mirror speeds from cached hostfile
 * addons: mirror.in2p3.fr
 * base: mirror.in2p3.fr
 * extras: mirror.in2p3.fr
 * rpmforge: fr2.rpmfind.net
 * updates: mirror.in2p3.fr
repo id            repo name                                     status
addons             CentOS-5 - Addons                             enabled:      0
base               CentOS-5 - Base                               enabled:  3,434
c5-media           CentOS-5 - Media                              disabled
centosplus         CentOS-5 - Plus                               disabled
contrib            CentOS-5 - Contrib                            disabled
extras             CentOS-5 - Extras                             enabled:    298
home_gbvalor       gbvalor's Home Project (CentOS_5)             enabled:     82
rpmforge           Red Hat Enterprise 5 - RPMforge.net - dag     enabled: 10,238
rpmforge-testing   Red Hat Enterprise 5 - RPMforge.net - test    disabled
updates            CentOS-5 - Updates                            enabled:    519
webmin             Webmin Distribution Neutral                   disabled
repolist: 14,571
== END   yum repolist all ==

== BEGIN sed -n -e "/^\[/h; /priority *=/{ G; s/\n/ /; s/ity=/ity = /; p }" /etc/yum.repos.d/*.repo | sort -k3n ==
== END   sed -n -e "/^\[/h; /priority *=/{ G; s/\n/ /; s/ity=/ity = /; p }" /etc/yum.repos.d/*.repo | sort -k3n ==

== BEGIN cat /etc/fstab ==
LABEL=/                 /                       ext3    defaults        1 1
LABEL=/home             /home                   ext4    defaults        1 2
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
/dev/sda6               swap                    swap    defaults        0 0
== END   cat /etc/fstab ==

== BEGIN df -h ==
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda5              30G  4.6G   24G  17% /
/dev/sda7             182G  130G   43G  76% /home
tmpfs                 1.5G     0  1.5G   0% /dev/shm
192.168.0.5:/volume1/Scripts
                      914G  145G  769G  16% /mnt/NFS/Scripts
192.168.0.5:/volume1/Data
                      914G  145G  769G  16% /mnt/NFS/Data
== END   df -h ==

== BEGIN fdisk -l ==

Disk /dev/sda: 250.0 GB, 250000000000 bytes
255 heads, 63 sectors/track, 30394 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1        1912    15358108+   7  HPFS/NTFS
/dev/sda2            1913       30393   228773632+   f  W95 Ext'd (LBA)
/dev/sda5   *        1913        5828    31455238+  83  Linux
/dev/sda6            5829        6350     4192933+  82  Linux swap / Solaris
/dev/sda7            6351       30393   193125366   83  Linux
== END   fdisk -l ==

== BEGIN blkid ==
/dev/sda7: LABEL="/home" UUID="6ea058c1-c8b8-408c-9991-d96ac947f901" TYPE="ext4" 
/dev/sda6: UUID="eb75218a-49a6-4b79-93b7-366ed4232707" TYPE="swap" 
/dev/sda5: LABEL="/" UUID="0dee26be-db97-4ab5-b344-7764c02968fc" TYPE="ext3" 
/dev/sda1: TYPE="ntfs" 
== END   blkid ==

== BEGIN rpm -qa kernel\* | sort ==
kernel-2.6.18-164.el5
kernel-2.6.18-194.3.1.el5
kernel-2.6.18-194.8.1.el5
kernel-headers-2.6.18-194.8.1.el5
== END   rpm -qa kernel\* | sort ==

== BEGIN lspci ==
00:00.0 Host bridge: Intel Corporation 82945G/GZ/P/PL Memory Controller Hub
00:01.0 PCI bridge: Intel Corporation 82945G/GZ/P/PL PCI Express Root Port
00:1b.0 Audio device: Intel Corporation N10/ICH 7 Family High Definition Audio Controller (rev 01)
00:1c.0 PCI bridge: Intel Corporation N10/ICH 7 Family PCI Express Port 1 (rev 01)
00:1c.4 PCI bridge: Intel Corporation 82801GR/GH/GHM (ICH7 Family) PCI Express Port 5 (rev 01)
00:1c.5 PCI bridge: Intel Corporation 82801GR/GH/GHM (ICH7 Family) PCI Express Port 6 (rev 01)
00:1d.0 USB Controller: Intel Corporation N10/ICH7 Family USB UHCI Controller #1 (rev 01)
00:1d.1 USB Controller: Intel Corporation N10/ICH 7 Family USB UHCI Controller #2 (rev 01)
00:1d.2 USB Controller: Intel Corporation N10/ICH 7 Family USB UHCI Controller #3 (rev 01)
00:1d.3 USB Controller: Intel Corporation N10/ICH 7 Family USB UHCI Controller #4 (rev 01)
00:1d.7 USB Controller: Intel Corporation N10/ICH 7 Family USB2 EHCI Controller (rev 01)
00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev e1)
00:1f.0 ISA bridge: Intel Corporation 82801GH (ICH7DH) LPC Interface Bridge (rev 01)
00:1f.1 IDE interface: Intel Corporation 82801G (ICH7 Family) IDE Controller (rev 01)
00:1f.2 SATA controller: Intel Corporation N10/ICH7 Family SATA AHCI Controller (rev 01)
00:1f.3 SMBus: Intel Corporation N10/ICH 7 Family SMBus Controller (rev 01)
01:00.0 VGA compatible controller: nVidia Corporation G72 [GeForce 7300 LE] (rev a1)
04:00.0 Ethernet controller: Intel Corporation 82573L Gigabit Ethernet Controller (rev 01)
05:04.0 Ethernet controller: Atheros Communications Inc. Atheros AR5001X+ Wireless Network Adapter (rev 01)
05:05.0 Multimedia video controller: Internext Compression Inc iTVC16 (CX23416) MPEG-2 Encoder (rev 01)
== END   lspci ==

== BEGIN lspci -n ==
00:00.0 0600: 8086:2770
00:01.0 0604: 8086:2771
00:1b.0 0403: 8086:27d8 (rev 01)
00:1c.0 0604: 8086:27d0 (rev 01)
00:1c.4 0604: 8086:27e0 (rev 01)
00:1c.5 0604: 8086:27e2 (rev 01)
00:1d.0 0c03: 8086:27c8 (rev 01)
00:1d.1 0c03: 8086:27c9 (rev 01)
00:1d.2 0c03: 8086:27ca (rev 01)
00:1d.3 0c03: 8086:27cb (rev 01)
00:1d.7 0c03: 8086:27cc (rev 01)
00:1e.0 0604: 8086:244e (rev e1)
00:1f.0 0601: 8086:27b0 (rev 01)
00:1f.1 0101: 8086:27df (rev 01)
00:1f.2 0106: 8086:27c1 (rev 01)
00:1f.3 0c05: 8086:27da (rev 01)
01:00.0 0300: 10de:01d1 (rev a1)
04:00.0 0200: 8086:109a (rev 01)
05:04.0 0200: 168c:0013 (rev 01)
05:05.0 0400: 4444:0016 (rev 01)
== END   lspci -n ==

== BEGIN ifconfig -a ==
eth0      Link encap:Ethernet  HWaddr 00:13:72:20:00:FC  
          inet addr:192.168.0.1  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::213:72ff:fe20:fc/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3042826 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3662032 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100 
          RX bytes:2016441430 (1.8 GiB)  TX bytes:4166815695 (3.8 GiB)
          Memory:fbee0000-fbf00000 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:288305 errors:0 dropped:0 overruns:0 frame:0
          TX packets:288305 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:37643605 (35.8 MiB)  TX bytes:37643605 (35.8 MiB)

sit0      Link encap:IPv6-in-IPv4  
          NOARP  MTU:1480  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

wlan0     Link encap:Ethernet  HWaddr 00:18:4D:76:3F:F4  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

== END   ifconfig -a ==

== BEGIN route -n ==
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.0.0     0.0.0.0         255.255.255.0   U     1      0        0 eth0
0.0.0.0         192.168.0.254   0.0.0.0         UG    0      0        0 eth0
== END   route -n ==

== BEGIN cat /etc/resolv.conf ==
# Generated by NetworkManager
nameserver 212.27.40.241
nameserver 212.27.40.240
== END   cat /etc/resolv.conf ==

== BEGIN grep net /etc/nsswitch.conf ==
#networks:   nisplus [NOTFOUND=return] files
#netmasks:   nisplus [NOTFOUND=return] files     
netmasks:   files
networks:   files
netgroup:   nisplus
== END   grep net /etc/nsswitch.conf ==

== BEGIN chkconfig --list | grep -i network ==
NetworkManager 	0:off	1:off	2:on	3:on	4:on	5:on	6:off
network        	0:off	1:off	2:on	3:on	4:on	5:off	6:off
== END   chkconfig --list | grep -i network ==





My network connection is working well, I can access the server with ssh and I can ping "www.centos.org" easily.

If "mail" is a mail client, if I run
mail -s test rlaxxx@free.fr
blabla
[ctrl d]

I will not receive the mail in my free.fr mailbox. It will be stuck in the queue.
If I flush the queue ( using webmin ), the mail is corectly sent

When I removed the variable MAILTO=rlaxxx@free.fr, I guess (?) cron output should be sent to the user than did the cron (Ocean).
But, when I am under the Ocean session and I type "mutt" to read my mails, there is no mails.
But If I loggin to root and read my mail (mutt), many mails are here with errors, inclusively the one send by cron ( from Ocean user)

I am posting the mails I get

Date: Fri, 6 Aug 2010 15:21:01 +0200
From: Mail Delivery Subsystem <MAILER-DAEMON@localhost.localdomain>
To: postmaster@localhost.localdomain
Subject: Postmaster notify: see transcript for details
Auto-Submitted: auto-generated (postmaster-notification)

[-- Attachment #1 --]
[-- Type: text/plain, Encoding: 7bit, Size: 0.5K --]

The original message was received at Fri, 6 Aug 2010 15:21:01 +0200
from localhost
with id o76DL1GM004095

   ----- The following addresses had permanent fatal errors -----
Ocean
    (reason: 550 5.1.1 <Ocean@localhost.localdomain>... User unknown)
    (expanded from: Ocean)

   ----- Transcript of session follows -----
... while talking to [127.0.0.1]:
>>> DATA
<<< 550 5.1.1 <Ocean@localhost.localdomain>... User unknown
550 5.1.1 Ocean... User unknown
<<< 503 5.0.0 Need RCPT (recipient)

[-- Attachment #2 --]

[-- Type: message/delivery-status, Encoding: 7bit, Size: 0.3K --]

Reporting-MTA: dns; localhost.localdomain
Arrival-Date: Fri, 6 Aug 2010 15:27:01 +0200

Final-Recipient: RFC822; Ocean@localhost.localdomain
Action: failed
Status: 5.1.1
Remote-MTA: DNS; [127.0.0.1]
Diagnostic-Code: SMTP; 550 5.1.1 <Ocean@localhost.localdomain>... User unknown
Last-Attempt-Date: Fri, 6 Aug 2010 15:27:01 +0200

[-- Attachment #3 --]
[-- Type: message/rfc822, Encoding: 7bit, Size: 2.2K --]

Date: Fri, 6 Aug 2010 15:27:01 +0200
From: Mail Delivery Subsystem <MAILER-DAEMON>
To: Ocean
Subject: Returned mail: see transcript for details
Auto-Submitted: auto-generated (failure)

[-- Attachment #1 --]
[-- Type: text/plain, Encoding: 7bit, Size: 0.5K --]

The original message was received at Fri, 6 Aug 2010 15:27:01 +0200
from Ocean@localhost
   ----- The following addresses had permanent fatal errors -----
Ocean
    (reason: 550 5.1.1 <Ocean@localhost.localdomain>... User unknown)
    (expanded from: Ocean)

   ----- Transcript of session follows -----
... while talking to [127.0.0.1]:
>>> DATA
<<< 550 5.1.1 <Ocean@localhost.localdomain>... User unknown
550 5.1.1 Ocean... User unknown
<<< 503 5.0.0 Need RCPT (recipient)

[-- Attachment #2 --]
[-- Type: message/delivery-status, Encoding: 7bit, Size: 0.3K --]

Reporting-MTA: dns; localhost.localdomain
Arrival-Date: Fri, 6 Aug 2010 15:27:01 +0200

Final-Recipient: RFC822; Ocean@localhost.localdomain
Action: failed
Status: 5.1.1
Remote-MTA: DNS; [127.0.0.1]
Diagnostic-Code: SMTP; 550 5.1.1 <Ocean@localhost.localdomain>... User unknown
Last-Attempt-Date: Fri, 6 Aug 2010 15:27:01 +0200

[-- Attachment #3 --]
[-- Type: message/rfc822, Encoding: 7bit, Size: 0.6K --]

Date: Fri, 6 Aug 2010 15:27:01 +0200
From: root (Cron Daemon)
To: Ocean
Subject: Cron <Ocean@rio> echo Hello
Auto-Submitted: auto-generated
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/home/Ocean>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=Ocean>
X-Cron-Env: <USER=Ocean>

Hello





I'am sorry if I make things more complicated than is. I know, using terminal, how to read mail with mutt, and I know sending mail with "mail".

It seems you are rigth, it looks like a dns problem.

Here is my /etc/hosts file
 more /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1       localhost.localdomain localhost rio
::1             localhost6.localdomain6 localhost6
192.168.0.1     rio
192.168.0.5     marrakech


This machine is called rio and have 192.168.0.1 IP adresse
Posted on: 2010/8/6 13:38
Create PDF from Post Print
Top
  •  pschaff
      pschaff
Re: cron and sendmail
#5
Moderator
Joined: 2006/12/13
From Tidewater, Virginia, North America
Posts: 18773
Would still like to see the getinfo.sh output.

Looks like what you have is not a mail problem but a network or DNS problem. Can you do other things such as browse the internet, "ping www.centos.org", ping other local machines? Have you tried directing the mail to a local user from the cron job? Can a local user send and receive email with a mail client?
_________________
Phil

Recommended reading: FAQ & Readme first ; Search hint: google "your topic site:centos.org"; Smart Questions
Posted on: 2010/8/6 12:37
Create PDF from Post Print
Top
  •  RENOO
      RENOO
Re: cron and sendmail
#4
Newbie
Joined: 2010/8/5
From
Posts: 10
Thank you very much for your answer.

Sorry if I haven't been clear. I'd like my server to be able to send mail automatcally, when performing cron task.
Actually, cron mail output are stocked in the "queue"

]# mailq
                /var/spool/mqueue (5 requests)
-----Q-ID----- --Size-- -----Q-Time----- ------------Sender/Recipient-----------
o767AQ1R030498       21 Fri Aug  6 09:10 <Ocean@localhost.localdomain>
                 (host map: lookup (free.fr): deferred)
                                         <rlaxxx@free.fr>
o766wpcc029884       83 Fri Aug  6 08:58 <Ocean@localhost.localdomain>
                 (host map: lookup (free.fr): deferred)
                                         <rlaxxx@free.fr>
o75HV01q024615    10638 Thu Aug  5 19:31 <Ocean@localhost.localdomain>
                 (host map: lookup (free.fr): deferred)
                                         <rlaxxx@free.fr>
o75F8RuQ019385       73 Thu Aug  5 17:08 <Ocean@localhost.localdomain>
                 (host map: lookup (free.fr): deferred)
                                         <rlaxxx@free.fr>
o75EtZO0018960       83 Thu Aug  5 16:55 <Ocean@localhost.localdomain>
                 (host map: lookup (free.fr): deferred)
                                         <rlaxxx@free.fr>
                Total requests: 5


I had a look to the link you've put. But unforunatly, I don't know where to start.
Given want I need (cron sending mail to MAILTO=rlaxxx@free.fr ) shall I

1- Configure SMTP parameters somewhere on my machine ?
2- Configure sendmail : using m4, using webmin ?
3 - Configure postfix ? ( by the way which MTA am I using now ?snedmail postfix ? Which one do you recommand ?)
4- Do I need to configure domaine name somewhere ?

That's enough, I am lost
Posted on: 2010/8/6 7:23
Create PDF from Post Print
Top
  •  pschaff
      pschaff
Re: cron and sendmail
#3
Moderator
Joined: 2006/12/13
From Tidewater, Virginia, North America
Posts: 18773
Welcome to the CentOS fora. Congratulations - Apparently you have already done the recommend reading.

Unfortunately the forum attachment function is permanently broken. The best way is to just paste it in-line between code tags:
[code]
Your
text
here...
[/code]

It is not clear to me exactly what you are trying to do. If you want to set up a local mail server then the following Wiki article may be helpful:

http://wiki.centos.org/HowTos/postfix

See also the upstream documentation:
http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5/html/Deployment_Guide/ch-email.html
_________________
Phil

Recommended reading: FAQ & Readme first ; Search hint: google "your topic site:centos.org"; Smart Questions
Posted on: 2010/8/5 21:57
Create PDF from Post Print
Top
  •  RENOO
      RENOO
Re: cron and sendmail
#2
Newbie
Joined: 2010/8/5
From
Posts: 10
Strange ! I have attached the getinfo.sh result to my previous post but it does not show up.

How shall I post it ?
Posted on: 2010/8/5 9:33
Create PDF from Post Print
Top
  •  RENOO
      RENOO
cron and sendmail
#1
Newbie
Joined: 2010/8/5
From
Posts: 10
Hello,

My first post here as I recently install CentOS 5.5 on my small server. I am very pleased so far.

Unfortunaltly, I have problems with my mail configuration. I don't know anything about sendmail and dns configuration so I am just looking for something easy to set up.

I use cron to perform automatic task. I set up the variable $MAILTO in cron to my regular mail.
Cron send the mail but it is stuck in the queue.
I have the same problem is I use the command
mail

in terminal.
I can acces the queue using webmin ( I have install this one week ago --> No experience with it )

it says the following error
Quote:
host map: lookup (domain.fr): deferred


If i paste this into google, there is nothing I can understand.

Thank you for you help
Posted on: 2010/8/5 9:30
Create PDF from Post Print
Top
 Top   Previous Topic   Next Topic

 


 You cannot start a new topic.
 You can view topic.
 You cannot reply to posts.
 You cannot edit your posts.
 You cannot delete your posts.
 You cannot add new polls.
 You cannot vote in polls.
 You cannot attach files to posts.
 You cannot post without approval.




"Linux" is a registered trademark of Linus Torvalds. | All other trademarks are property of their respective owners. | All other content is Copyright @ 2004-2009 by the CentOS Project or "each individual contributor (forums, comments, etc.) unless otherwise assigned".| Theme based on a theme by 7dana.com