LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-21-2011, 02:29 AM   #1
pinga123
Member
 
Registered: Sep 2009
Posts: 684
Blog Entries: 2

Rep: Reputation: 36
Not able to send mail.


I m not able to configure sntp server at my linux distribution.

Here are the details.
Defined the mail server here.
Code:
/etc/mail/sendmail.mc

dnl define(`SMART_HOST', `XXX.XX.XX.XXX')dnl
ran this command.

Code:
m4 /etc/mail/sendmail.mc /etc/mail/sendmail.cf
restarted the sendmail service.

tried sending mail using .
Code:
mail -v -s "test" username@domain.com < /tmp/abc
but didn't get any mail.

M i missing something?

However i get the mails When i use telnet to send the mail. .

Here is what i m doing.

telnet to the mailserver on port 25 it get connected .

Code:
ehlo domain.com
mail from : username@domain.com
rcpt to : username2@domain.com
data
test
 
Old 07-21-2011, 04:49 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,737

Rep: Reputation: 1585Reputation: 1585Reputation: 1585Reputation: 1585Reputation: 1585Reputation: 1585Reputation: 1585Reputation: 1585Reputation: 1585Reputation: 1585Reputation: 1585
Hi,

You should check the logs in /var/log/maillog to see what happens. Also read the DSN on the returned mail

Regards
 
Old 07-21-2011, 06:12 AM   #3
pinga123
Member
 
Registered: Sep 2009
Posts: 684
Blog Entries: 2

Original Poster
Rep: Reputation: 36
Quote:
Originally Posted by bathory View Post
Hi,

You should check the logs in /var/log/maillog to see what happens. Also read the DSN on the returned mail

Regards
dsn is 2.0.0 is this what you is expected.


Code:
Jul 21 16:32:39 HOSTNAME sendmail[16628]: p6LArBmh016628: to=root, ctladdr=root (0/0), delay=00:09:28, xdelay=00:00:00, mailer=relay, pri=30738, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (p6LB2dWR017196 Message accepted for delivery)
Jul 21 16:32:39 HOSTNAME sendmail[17197]: p6LB2dWR017196: to=<root@HOSTNAME.domain.com>, ctladdr=<root@HOSTNAME.domain.com> (0/0), delay=00:00:00, xdelay=00:00:00, mailer=local, pri=31275, dsn=2.0.0, stat=Sent
 
Old 07-21-2011, 08:19 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,737

Rep: Reputation: 1585Reputation: 1585Reputation: 1585Reputation: 1585Reputation: 1585Reputation: 1585Reputation: 1585Reputation: 1585Reputation: 1585Reputation: 1585Reputation: 1585
The chunk of maillog you've posted shows no error, that's why you get a dsn=2.0.0. Besides it's local mail. The smarthost is used when you need to send an email to an external domain.
So, you should send an external email, watch the logs and read the returned mail headers (that is what i meant by DSN), or post 'em here.

Regards
 
Old 07-21-2011, 11:48 PM   #5
pinga123
Member
 
Registered: Sep 2009
Posts: 684
Blog Entries: 2

Original Poster
Rep: Reputation: 36
Quote:
Originally Posted by bathory View Post
The chunk of maillog you've posted shows no error, that's why you get a dsn=2.0.0. Besides it's local mail. The smarthost is used when you need to send an email to an external domain.
So, you should send an external email, watch the logs and read the returned mail headers (that is what i meant by DSN), or post 'em here.

Regards
mail eroor
Quote:
Originally Posted by bathory View Post
The chunk of maillog you've posted shows no error, that's why you get a dsn=2.0.0. Besides it's local mail. The smarthost is used when you need to send an email to an external domain.
So, you should send an external email, watch the logs and read the returned mail headers (that is what i meant by DSN), or post 'em here.

Regards
Can you please tell me How you differentiate between local mail and external domain?

We have organizational setup and using a single mail server for all machines in the organization.
Does it categorized into local mail(I mean for internal users only) Noob here?

Posting here complete output after i run following command.


Code:
mail -s "test" username@domain.com < /tmp/abc
Code:
Jul 22 09:12:08 HOSTNAME sendmail[10324]: p6M3g7vh010324: from=root, size=47, class=0, nrcpts=1, msgid=<201107220342.p6M3g7vh010324@HOSTNAME.domain.com>, relay=root@localhost
Jul 22 09:12:08 HOSTNAME sendmail[10325]: p6M3g8nH010325: from=<root@HOSTNAME.domain.com>, size=363, class=0, nrcpts=1, msgid=<201107220342.p6M3g7vh010324@hostname.domain.com>, proto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1]
Jul 22 09:12:08 HOSTNAME sendmail[10324]: p6M3g7vh010324: to=username@domain.com, ctladdr=root (0/0), delay=00:00:01, xdelay=00:00:00, mailer=relay, pri=30047, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (p6M3g8nH010325 Message accepted for delivery)
Jul 22 09:12:15 HOSTNAME sendmail[10327]: p6M3g8nH010325: to=<username@domain.com>, ctladdr=<root@HOSTNAME.domain.com> (0/0), delay=00:00:07, xdelay=00:00:07, mailer=esmtp, pri=120363, relay=relayserver.domain.com. [xx.xx.xx.xx], dsn=5.6.0, stat=Data format error
Jul 22 09:12:15 HOSTNAME sendmail[10327]: p6M3g8nH010325: p6M3gFnH010327: DSN: Data format error
Jul 22 09:12:15 HOSTNAME sendmail[10327]: p6M3gFnH010327: to=<root@HOSTNAME.domain.com>, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=31630, dsn=2.0.0, stat=Sent

Jul 22 09:12:38 HOSTNAME sendmail[9815]: p6M3XBIe009815: from=root, size=738, class=0, nrcpts=1, msgid=<201107220333.p6M3XBIe009815@HOSTNAME.domain.com>, relay=root@localhost
Jul 22 09:12:38 HOSTNAME sendmail[10342]: p6M3gcgN010342: from=<root@HOSTNAME.domain.com>, size=1033, class=0, nrcpts=1, msgid=<201107220333.p6M3XBIe009815@hostname.domain.com>, proto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1]
Jul 22 09:12:38 HOSTNAME sendmail[9815]: p6M3XBIe009815: to=root, ctladdr=root (0/0), delay=00:09:27, xdelay=00:00:00, mailer=relay, pri=30738, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (p6M3gcgN010342 Message accepted for delivery)
Jul 22 09:12:38 HOSTNAME sendmail[10343]: p6M3gcgN010342: to=<root@HOSTNAME.domain.com>, ctladdr=<root@HOSTNAME.domain.com> (0/0), delay=00:00:00, xdelay=00:00:00, mailer=local, pri=31275, dsn=2.0.0, stat=Sent
 
Old 07-22-2011, 02:36 AM   #6
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,737

Rep: Reputation: 1585Reputation: 1585Reputation: 1585Reputation: 1585Reputation: 1585Reputation: 1585Reputation: 1585Reputation: 1585Reputation: 1585Reputation: 1585Reputation: 1585
Hi,

Local mail, is the mail to a local user, i.e. a user that exists on the same host running sendmail. And external is the mail to anyone else.
You can check them by looking at the logs for the "mailer=..."

Now regarding the "Data format error", I guess the smarthost does not like your hostname (localhost.localdomain). Edit /etc/hosts and add your FQDN there

Regards
 
Old 07-22-2011, 07:07 AM   #7
pinga123
Member
 
Registered: Sep 2009
Posts: 684
Blog Entries: 2

Original Poster
Rep: Reputation: 36
Quote:
Originally Posted by bathory View Post
Hi,

Local mail, is the mail to a local user, i.e. a user that exists on the same host running sendmail. And external is the mail to anyone else.
You can check them by looking at the logs for the "mailer=..."

Now regarding the "Data format error", I guess the smarthost does not like your hostname (localhost.localdomain). Edit /etc/hosts and add your FQDN there

Regards
I guess even that is not working.

One wild guess .Can switching from sendmail to postfix make it a better choice?
 
Old 07-22-2011, 07:51 AM   #8
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,737

Rep: Reputation: 1585Reputation: 1585Reputation: 1585Reputation: 1585Reputation: 1585Reputation: 1585Reputation: 1585Reputation: 1585Reputation: 1585Reputation: 1585Reputation: 1585
Quote:
Can switching from sendmail to postfix make it a better choice?
If you are not familiar with postfix, it would be difficult too. But, comparing to sendmail it has a more easy to understand configuration.
 
Old 07-24-2011, 10:24 PM   #9
pinga123
Member
 
Registered: Sep 2009
Posts: 684
Blog Entries: 2

Original Poster
Rep: Reputation: 36
Quote:
Originally Posted by bathory View Post
If you are not familiar with postfix, it would be difficult too. But, comparing to sendmail it has a more easy to understand configuration.
How would i send mail in case of postfix(After the configuration is done).

In sendmail i used to fire command like.
Code:
mail -s "SUBJECT" username@domain.com < filetobesent.
Do i need to install additional rpm for postfix as in case of sendmail i had to install sendmail-cf-8.13.8-2.el5.
 
Old 07-25-2011, 01:16 AM   #10
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,737

Rep: Reputation: 1585Reputation: 1585Reputation: 1585Reputation: 1585Reputation: 1585Reputation: 1585Reputation: 1585Reputation: 1585Reputation: 1585Reputation: 1585Reputation: 1585
Hi,

You should take a look here

Regards
 
1 members found this post helpful.
Old 07-25-2011, 11:14 PM   #11
pinga123
Member
 
Registered: Sep 2009
Posts: 684
Blog Entries: 2

Original Poster
Rep: Reputation: 36
I resolve the issue by changing relay server in /etc/mail/sendmail.cf file.
Now i can able to send mail.
But i have to add one extra parameter to attach sender information .
like -- -r sender@domain.com.

Earlier the hostname was used as sender .
Do you guys have any clue over this?
I think there must have been some kind of hardening done on mail server (Wild guess )
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Postfix - I can send mail from my computer; but others can't send to me... djuhl30 Linux - Server 8 10-12-2009 02:34 PM
can mail command be used to send mail onto global mail servers like yahoo etc dale_chip Linux - Newbie 4 08-12-2008 08:33 AM
Postfix : mail cannot send to send outside ( can send/receive locally) bobbinsupport Linux - Networking 3 12-15-2007 10:40 PM
with the linux proxi, backend pop3 mail client can not receive mail and send mail rubin823 Linux - Networking 0 12-21-2006 10:06 PM
Server does'nt send mail until shutdown and LAN can't send or receive. Wolfy Linux - Networking 0 08-02-2004 07:31 PM


All times are GMT -5. The time now is 10:23 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration