LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 11-04-2011, 01:34 AM   #1
Majed17
Member
 
Registered: Jul 2011
Posts: 102

Rep: Reputation: Disabled
sendmail sometimes sending emails and sometimes not


hello, i'm using sendmail to send notification emails.
i'm sending test emails as root but some messages get delivered and some not even though i'm sending to the same sender.
the command i'm using :

Code:
sendmail -v monitoring@mydomain.by
in /var/log/messages
i am getting:

Code:
16:54:47 srvmon-Bellakt sm-mta[17248]: pA3Dsifc017248: to=<monitoring@mydomain.by>, ctladdr=<root@srvmon-Bellakt.otherdomain.com> (0/0), delay=00:00:03, xdelay=00:00:03, mailer=esmtp, pri=30322, relay=mx2.activeby.net. [109.237.213.144], dsn=2.0.0, stat=Sent (OK id=1RLxkj-0002dF-6r)
Nov  3 16:54:47 srvmon-Bellakt sendmail[17237]: pA3DseMv017237: to=monitoring@mydomain.by, ctladdr=root (0/0), delay=00:00:07, xdelay=00:00:03, mailer=relay, pri=30005, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (pA3Dsifc017248 Message accepted for delivery)
when it gets sent
and when it fails to be sent i get:

Code:
Nov  3 17:17:20 srvmon-Bellakt sm-mta[32754]: pA3EHG4E032754: to=<monitoring@mydomain.by>, ctladdr=<root@srvmon-Bellakt.otherdomain.com> (0/0), delay=00:00:04, xdelay=00:00:04, mailer=esmtp, pri=30364, relay=mx2.activeby.net. [109.237.213.144], dsn=5.0.0, stat=Service unavailable
any idea on what can be the cause for this?
perhaps there is a better mail agent to send emails...
 
Old 11-04-2011, 01:42 AM   #2
deep27ak
Senior Member
 
Registered: Aug 2011
Location: Bangalore, India
Distribution: RHEL 7.x, SLES 11 SP2/3/4
Posts: 1,195
Blog Entries: 4

Rep: Reputation: 221Reputation: 221Reputation: 221
from the logs what I can guess is port issue

which port no. are you using to for ESMTP and RELAY in sendmail.mc?

Code:
#vi sendmail.mc

define(`RELAY_MAILER_ARGS', `TCP $h 587')dnl
define(`ESMTP_MAILER_ARGS', `TCP $h 587')dnl
 
Old 11-04-2011, 01:49 AM   #3
Majed17
Member
 
Registered: Jul 2011
Posts: 102

Original Poster
Rep: Reputation: Disabled
here is my sendmail.mc configuration:
Code:
divert(-1)
divert(0)dnl
include(`/usr/share/sendmail-cf/m4/cf.m4')dnl
VERSIONID(`$Id: sendmail.mc,v 1.2 2004/12/07 01:59:31 g2boojum Exp $')dnl
OSTYPE(linux)dnl
DOMAIN(generic)dnl
FEATURE(`smrsh',`/usr/sbin/smrsh')dnl
FEATURE(`local_lmtp',`/usr/sbin/mail.local')dnl
MASQUERADE_AS(otherdomain.com)dnl
FEATURE(masquerade_envelope)dnl
FEATURE(masquerade_entire_domain)dnl
MASQUERADE_DOMAIN(otherdomain.com)dnl
MAILER(local)dnl
MAILER(smtp)dnl
netstat -nl shows:

Code:
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 0.0.0.0:587             0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:110             0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:21              0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:443             0.0.0.0:*               LISTEN
tcp6       0      0 :::22                   :::*                    LISTEN
udp      320      0 0.0.0.0:52684           0.0.0.0:*
udp        0      0 172.16.1.40:123         0.0.0.0:*
udp        0      0 127.0.0.1:123           0.0.0.0:*
udp        0      0 0.0.0.0:123             0.0.0.0:*
raw        0      0 0.0.0.0:1               0.0.0.0:*               7
raw        0    960 0.0.0.0:1               0.0.0.0:*               7
raw        0      0 0.0.0.0:1               0.0.0.0:*               7
Active UNIX domain sockets (only servers)
Proto RefCnt Flags       Type       State         I-Node   Path
unix  2      [ ACC ]     STREAM     LISTENING     5436183  /var/run/proftpd/proftpd.sock
unix  2      [ ACC ]     STREAM     LISTENING     5436188  /var/run/proftpd/proftpd.sock
unix  2      [ ACC ]     STREAM     LISTENING     10489008 /var/run/cgisock.22701
unix  2      [ ACC ]     STREAM     LISTENING     5507     /var/run/syslog-ng.ctl
unix  2      [ ACC ]     STREAM     LISTENING     5504     /dev/log
 
Old 11-04-2011, 02:17 AM   #4
deep27ak
Senior Member
 
Registered: Aug 2011
Location: Bangalore, India
Distribution: RHEL 7.x, SLES 11 SP2/3/4
Posts: 1,195
Blog Entries: 4

Rep: Reputation: 221Reputation: 221Reputation: 221
I don't see any smtp server in sendmail.mc

Is that your complete file?
 
Old 11-04-2011, 02:20 AM   #5
Majed17
Member
 
Registered: Jul 2011
Posts: 102

Original Poster
Rep: Reputation: Disabled
yes that is the complete file, i thought senmdmail is a mail server and doesn't need a relay. i read in the internet that a smart host can be set up to relay to the smtp server but the boss doesn't want the messages relayed to the smtp server in case the server fails.

Last edited by Majed17; 11-04-2011 at 02:21 AM.
 
Old 11-04-2011, 02:29 AM   #6
deep27ak
Senior Member
 
Registered: Aug 2011
Location: Bangalore, India
Distribution: RHEL 7.x, SLES 11 SP2/3/4
Posts: 1,195
Blog Entries: 4

Rep: Reputation: 221Reputation: 221Reputation: 221
but when mail sending is failed it is getting RELAYED by 109.237.213.144

what is this ip?
 
Old 11-04-2011, 02:35 AM   #7
Majed17
Member
 
Registered: Jul 2011
Posts: 102

Original Poster
Rep: Reputation: Disabled
this ip is of mx2.activeby.net which can be seen in a
Code:
nslookup 109.237.213.144
this is our email host service provider for the domain profiland. i have a susspicion that some messages are filtered as spam and some are passed, is it possible?
 
Old 11-04-2011, 03:12 AM   #8
Majed17
Member
 
Registered: Jul 2011
Posts: 102

Original Poster
Rep: Reputation: Disabled
what is weird is that if i send mail to the local domain bellakt.com the mail always gets delivered probably because it is forwarded to the internal ip address of the exchange server. but if i send mail to the domain profiland throught the relay mx2 it sometimes gets delivered and sometimes not. the boss just informed me that he is going to ask that bellakt.com (which is domain of the linux machine) to be added to the white list. hopefully this will help.
 
Old 11-04-2011, 04:06 AM   #9
deep27ak
Senior Member
 
Registered: Aug 2011
Location: Bangalore, India
Distribution: RHEL 7.x, SLES 11 SP2/3/4
Posts: 1,195
Blog Entries: 4

Rep: Reputation: 221Reputation: 221Reputation: 221
by asking what is this ip I meant is this your server which you are using to sendmails?

I don't think it has got anything related with spam
Quote:
Originally Posted by Majed17 View Post
what is weird is that if i send mail to the local domain bellakt.com the mail always gets delivered probably because it is forwarded to the internal ip address of the exchange server. but if i send mail to the domain profiland throught the relay mx2 it sometimes gets delivered and sometimes not. the boss just informed me that he is going to ask that bellakt.com (which is domain of the linux machine) to be added to the white list. hopefully this will help.
and yup that might be the issue because the sendmail is using mx2.activeby.net as a relay server for sending mails for which the mail is not getting delivered

and when your server is taking localhost as relay everything goes fine

you can try this but this will again act as a relay server(which you don't want I guess)

Code:
#vi /etc/mail/access
Connect:109.237.213.144          RELAY
Code:
#makemap -r hash access.db < access

#service sendmail restart
 
1 members found this post helpful.
Old 11-04-2011, 06:16 AM   #10
Majed17
Member
 
Registered: Jul 2011
Posts: 102

Original Poster
Rep: Reputation: Disabled
i did the relay and now but still not all mail is reaching profiland.by.
i test 4 test emails and only 2 arrived
Code:
Nov  4 14:03:44 srvmon-Bellakt sm-mta[19040]: pA4B3eA1019040: to=<monitoring@mydomain.by>, ctladdr=<root@srvmon-Bellakt.Bellakt.com> (0/0), delay=00:00:04, xdelay=00:00:04, mailer=esmtp, pri=30331, relay=mx2.activeby.net. [109.237.213.144], dsn=5.0.0, stat=Service unavailable
but now messages to bellakt.com are not arriving at all with the following error.

Code:
Nov  4 13:54:04 srvmon-Bellakt sm-mta[12706]: pA4As1uS012704: to=<admin50@localdomain.com>, ctladdr=<nagios@srvmon-Bellakt.Bellakt.com> (102/1002), delay=00:00:03, xdelay=00:00:03, mailer=esmtp, pri=120575, relay=mail.bellakt.com. [172.16.1.100], dsn=4.0.0, stat=Deferred: mail.bellakt.com.: No route to host
i suspect this is because nslookup at the linux machine for mail.bellakt.com is 172.16.1.100
while from a computer not in the domain it is : 178.124.149.43

mydomain=profiland
otherdomian=bellakt

Last edited by Majed17; 11-04-2011 at 06:18 AM.
 
Old 11-04-2011, 07:03 AM   #11
Majed17
Member
 
Registered: Jul 2011
Posts: 102

Original Poster
Rep: Reputation: Disabled
it seems it was a problem with the exchange server and it was down. now the message i'm getting:
Code:
Nov  4 14:53:20 srvmon-Bellakt sm-mta[21536]: pA4BrKEo021534: to=<admin50@localdomain.com>, ctladdr=<nagios@srvmon-Bellakt.Bellakt.com> (102/1002), delay=00:00:00, xdelay=00:00:00, mailer=esmtp, pri=120595, relay=mail.bellakt.com. [172.16.1.100], dsn=2.0.0, stat=Sent (<201111041153.pA4BrKsE021533@srvmon-Bellakt.Bellakt.com> Queued mail for delivery)
but i'm still unable to login to check mail.
but anyway the problem is not solved. some emails are still not getting delivered and bellakt.com (the local domain) was added to the white list. any more ideas for this weird problem?
 
Old 11-04-2011, 07:15 AM   #12
deep27ak
Senior Member
 
Registered: Aug 2011
Location: Bangalore, India
Distribution: RHEL 7.x, SLES 11 SP2/3/4
Posts: 1,195
Blog Entries: 4

Rep: Reputation: 221Reputation: 221Reputation: 221
In the mean while I was checking your sendmail.mc as your last post did confused me

because as I said you to make changes in access file
but your sendmail.mc is not configured to listen access.db


Code:
FEATURE(`access_db', `hash -T<TMPF> -o /etc/mail/access.db')dnl
this line is missing from your sendmail.mc

Now returning to your issue

Code:
mx2.activeby.net. [109.237.213.144]------->>is your mail server?
Code:
which machine are you using to send mails?
on which machine
Code:
mydomain=profiland
otherdomian=bellakt
are configured?

kindly provide me wit all details at once so that I can understand the whole thing...as everytime I have to scroll the page to view the info
 
1 members found this post helpful.
Old 11-04-2011, 07:27 AM   #13
Majed17
Member
 
Registered: Jul 2011
Posts: 102

Original Poster
Rep: Reputation: Disabled
frankly i don't understand how sendmail is working, it seems it is an smtp server by itself?
sendmail is running on srvmon-Bellakt.Bellakt.com gentoo machine. profiland is the domain i'm trying to send the messages to and the are also emails on bellakt.com which i send emails too. (mainly through the nagios program, but my test emails are from root)

Quote:
mx2.activeby.net. [109.237.213.144]------->>is your mail server?
it is not my mail server. it is the server that profiland is on and so when root sends emails to profiland it passes through this mx2.

Quote:
which machine are you using to send mails?
from srvmon-Bellakt.Bellakt.com

i disscused the situation with my boss and he says if we relay to mx2 then messages other than to profiland will not be delivered because there is authentication on the server otherwise it would be used by spammers to relay spam. so i'm gonna wait for your answer before adding the new feature:
Code:
FEATURE(`access_db', `hash -T<TMPF> -o /etc/mail/access.db')dnl
 
Old 11-04-2011, 07:47 AM   #14
deep27ak
Senior Member
 
Registered: Aug 2011
Location: Bangalore, India
Distribution: RHEL 7.x, SLES 11 SP2/3/4
Posts: 1,195
Blog Entries: 4

Rep: Reputation: 221Reputation: 221Reputation: 221
So from all this what I got to know is when you are sending mail to your
Code:
bellakt.com
where sendmail is configured---everything works fine

but while sending to another domain
Code:
profiland
the problem comes

As far as your sendmail.mc is concerned I don't see any configuration stuff so even I am surprised to see your sendmail is working fine.


What I can say is to properly configure the sendmail using a proper smtp and relay server

Code:
You can always use spamassassin feature in sendmail to stop spams
 
Old 11-04-2011, 08:01 AM   #15
Majed17
Member
 
Registered: Jul 2011
Posts: 102

Original Poster
Rep: Reputation: Disabled
yes you are correct. you understood it to the letter it seems
i just checked the exchange server on bellakt and all the mail on bellakt arrived after the exchange server is up and running again.
but the problem is when sending to profiland or hotmail for that matter
some emails arrive and some get status unavailable.. i'm reading on the internet and some say this is a dns problem others say the server sending the emails has to be from a real domain which is true (bellakt.com is a real domain) yet others say that the mail server (mx2) is rejecting the emails.
when i configured send mail i was expecting to supply some smtp address and pop3 but it started working simply after installing it so i thought it is an smtp server by itslef.
today the work day is over so i'm going to try adding the feature you meantioned later but i think it will cause problems for sending emails to the bellakt local domain.
monday will be holiday here (they still celebrate the october revolution of 1917 over here) so i'll be back on tuesday and hopefully you'll still be fine by then
 
  


Reply



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
Sendmail: sending emails to Yahoo problem mikeressan Linux - Server 5 04-11-2011 08:54 PM
sendmail is sending unnecessary multiple copies of emails from php form swg1cor14 Linux - Server 1 01-07-2010 08:25 AM
problem of sending out emails through sendmail -- error code 421 kkeith Linux - Newbie 1 06-30-2006 04:59 AM
sending/recieving emails with sendmail xushi Slackware 2 02-25-2004 04:44 PM
Sendmail not sending emails, errorlog hydro Linux - Software 8 06-20-2003 05:48 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:07 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
Open Source Consulting | Domain Registration