LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 02-03-2010, 04:28 AM   #1
shamly
LQ Newbie
 
Registered: Feb 2010
Location: Sri Lanka
Distribution: CentOS
Posts: 7

Rep: Reputation: 0
Sendmail mail loops back to me (MX problem?)


Hello,

I know that this is a re-post. I am posting here is because none of the solutions posted earlier solved my problem (unfortunately .. ).

Below i have listed my zone files and a description of them as well.

shamly.local.zone file

PHP Code:
$TTL 604800
Information about "forward" domain microsys-asia.info
$ORIGIN shamly
.local.
IN SOA ns1.shamly.localwebmaster.shamly.local. (
2004042601 serial
86400 
refresh
7200 
retry
1209600 
expiry
604800 
) ; minimum

Define name servers for this domain
                     IN  NS  ns1
.shamly.local.
                     
IN  MX  10  mail.shamly.local.  ; short form
shamly
.local.        IN  A   192.168.1.103
ns1
.shamly.local.    IN  A   192.168.1.109

Define name to address mapping for this domain
www
.shamly.local.    IN  A   192.168.1.103
mail
.shamly.local.   IN  A   192.168.1.199
*.shamly.local.      IN  A   192.168.1.103

Loopback domain
localhost IN A 127.0.0.1 
The main domain is shamly.local which is in 192.168.1.103.
The mail server is in another machine 192.168.1.199.

Below is the reverse lookup zone file.

reverse.shamly.local.zone

PHP Code:
Information about "inverse" domain 1.168.192.in-addr.arpa.
IN SOA ns1.shamly.localwebmaster.shamly.local. (
2004042601 serial (dadams)
86400 refresh
7200 
retry
1209600 
expiry
604800 
) ; minimum

Define name servers for this domain
                            IN  NS  ns1
.shamly.local.
shamly.local.               IN  A   192.168.1.103
199.1.168.192
.in-addr.arpaIN  A   mail.shamly.local.
mail.shamly.local.          IN  A   192.168.1.199

Define name to address mapping for this domain
5 IN PTR ns1
.shamly.local
I tried adding my mail server domain (mail.shamly.local) in /etc/mail/local-host-names, but then i got the error that the receiver cannot be found. I was trying to send a mail to another user account within the same mail server.

The thing is i can send mail to out side mail boxes (e.g. gmail), but not to users within my own domain.

If anyone can help, i'd greatly appreciate it.


Thanks
 
Old 02-03-2010, 05:52 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Welcome to LQ,

You didn't post the offending email address, so I guess it was something like user@shamly.local. If that's the case, you should add shamly.local also in /etc/mail/local-host-names

Regarding your dns settings, there are a couple of errors in the reverse zone:
Quote:
shamly.local. IN A 192.168.1.103
A records are not needed
Quote:
199.1.168.192.in-addr.arpa. IN A mail.shamly.local.
should be
Code:
199.1.168.192.in-addr.arpa. IN  PTR   mail.shamly.local.
Quote:
5 IN PTR ns1.shamly.local.
According to the forward zone ns1 ip is 192.168.1.109, so the correct is
Code:
109 IN PTR ns1.shamly.local.
Regards
 
Old 02-03-2010, 11:16 PM   #3
shamly
LQ Newbie
 
Registered: Feb 2010
Location: Sri Lanka
Distribution: CentOS
Posts: 7

Original Poster
Rep: Reputation: 0
Thanks bathory. I will try this and let you know the outcome.

Regards
 
Old 02-04-2010, 11:42 PM   #4
shamly
LQ Newbie
 
Registered: Feb 2010
Location: Sri Lanka
Distribution: CentOS
Posts: 7

Original Poster
Rep: Reputation: 0
Hi,

The solution did not fix my problem .
I am trying to send the mail from my account `shamly1` to my other dummy account `shafraz`. `www.shamly.local` works fine by the way, only the mail MX record that seems to give me problems.

I have added the modified zone files as well as the output from maillog below ...

Please Help ..


shamly.local.zone file

Code:
$TTL 604800
; Information about "forward" domain microsys-asia.info
$ORIGIN shamly.local.
@ IN SOA ns1.shamly.local. webmaster.shamly.local. (
2004042601 ; serial
86400 ; refresh
7200 ; retry
1209600 ; expiry
604800 ) ; minimum

; Define name servers for this domain
                        IN  NS  ns1.shamly.local.
                        IN  MX  10  mail.shamly.local.
;shamly.local.        IN  A   192.168.1.103
ns1.shamly.local.    IN  A   192.168.1.109

; Define name to address mapping for this domain
www.shamly.local.    IN  A   192.168.1.103
mail.shamly.local.   IN  A   192.168.1.199
*.shamly.local.      IN  A   192.168.1.103

; Loopback domain
localhost IN A 127.0.0.1

reverse.shamly.local.zone

Code:
; Information about "inverse" domain 1.168.192.in-addr.arpa.
@ IN SOA ns1.shamly.local. webmaster.shamly.local. (
2004042601 ; serial (d. adams)
86400 ; refresh
7200 ; retry
1209600 ; expiry
604800 ) ; minimum

; Define name servers for this domain
                            IN  NS ns1.shamly.local.
199.1.168.192.in-addr.arpa. IN  PTR   mail.shamly.local.


; Define name to address mapping for this domain
109 IN PTR ns1.shamly.local.

maillog output

Code:
Feb  3 03:52:20 localhost sendmail[14794]: o12MMKPh014794: from=<shamly1@mail.shamly.local>, size=418, class=0, nrcpts=1, msgid=<4B6BAE34.8070307@mail.shamly.local>, proto=ESMTP, daemon=MTA, relay=[192.168.1.201]
Feb  3 03:52:20 localhost sendmail[14796]: o12MMKPh014794: SYSERR(root): mail.shamly.local. config error: mail loops back to me (MX problem?)
Feb  3 03:52:20 localhost sendmail[14797]: o12MMKYe014797: mail.shamly.local [192.168.1.199] did not issue MAIL/EXPN/VRFY/ETRN during connection to MTA
Feb  3 03:52:20 localhost sendmail[14796]: o12MMKPh014794: to=<shafraz@mail.shamly.local>, delay=00:00:00, xdelay=00:00:00, mailer=esmtp, pri=120418, relay=mail.shamly.local. [192.168.1.199], dsn=5.3.5, stat=Local configuration error
Feb  3 03:52:20 localhost sendmail[14796]: o12MMKPh014794: to=shamly1, ctladdr=root (8/0), delay=00:00:00, mailer=local, pri=120418, dsn=5.1.1, stat=User unknown
Feb  3 03:52:20 localhost sendmail[14796]: o12MMKPh014794: o12MMKPh014796: DSN: User unknown
Feb  3 03:52:20 localhost sendmail[14796]: o12MMKPh014796: to=<shamly1@mail.shamly.local>, delay=00:00:00, xdelay=00:00:00, mailer=esmtp, pri=31637, relay=mail.shamly.local., dsn=5.3.5, stat=Local configuration error
Feb  3 03:52:20 localhost sendmail[14796]: o12MMKPh014796: to=shamly1, ctladdr=root (8/0), delay=00:00:00, mailer=local, pri=31637, dsn=5.1.1, stat=User unknown
Feb  3 03:52:20 localhost sendmail[14796]: o12MMKPh014796: to=shamly1, ctladdr=root (8/0), delay=00:00:00, mailer=local, pri=31637, dsn=5.1.1, stat=User unknown
Feb  3 03:52:20 localhost sendmail[14796]: o12MMKPh014796: o12MMKPi014796: return to sender: User unknown
Feb  3 03:52:20 localhost sendmail[14796]: o12MMKPi014796: to=shamly1, ctladdr=root (8/0), delay=00:00:00, mailer=local, pri=2661, dsn=5.1.1, stat=User unknown
Feb  3 03:52:20 localhost sendmail[14796]: o12MMKPh014796: Losing ./qfo12MMKPh014796: savemail panic
Feb  3 03:52:20 localhost sendmail[14796]: o12MMKPh014796: SYSERR(root): savemail: cannot save rejected email anywhere

Thanks
 
Old 02-05-2010, 12:46 AM   #5
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi,

You should increase the serial number
Quote:
2004042601 ; serial
in both zones and restart named, so it can understand the changes.

From maillog it looks like there are more than one errors. How did you install sendmail, because it looks like it's misconfigured.
Anyway:
1. You use shamly1@mail.shamly.local and it tries to be delivered at 192.168.1.201 ??? while it should be local. I guess this is configured perviously in dns and was not changed.
Also better use shamly1@shamly.local and add shamly.local in /etc/mail/local-host-names. Of course you need to restart sendmail. To test your config without the need to send mails, you can use:
Code:
sendmail -bv shamly1@shamly.local
2.About "user unknown": Is the user shamly1 a real (system) user, or what? What's in /etc/mail/virtusertable?

3.
Quote:
Losing ./qfo12MMKPh014796: savemail panic
SYSERR(root): savemail: cannot save rejected email anywhere
Looks like a permissions problem, that's why I've asked you how did you install sendmail. Usually /var/spool/mail must be owned by root:mail and permissions should be 770 or 775:
Code:
# ls -ld /var/spool/mail/
drwxrwxr-x 2 root mail 4096 Dec  3 14:37 /var/spool/mail/
 
Old 02-05-2010, 04:21 AM   #6
shamly
LQ Newbie
 
Registered: Feb 2010
Location: Sri Lanka
Distribution: CentOS
Posts: 7

Original Poster
Rep: Reputation: 0
Hi bathory,


1. 192.168.1.201 is my windows machine IP. I was sending mail from my Thunderbird client.


2. I have installed "dovecot (tar.gz)" as my mail server for POP3 and IMAP. Dovecot is in the same machine as sendmail (192.168.1.199). 192.168.1.103 is the IP in which the name server (named) exists.

The users are created in a db file (configured in dovecot.conf) and not as a system user. I can access my mailbox using Thunderbird. Is that whats causing the problem u think for sendmail?. Oh and /etc/mail/virtusertable is empty


3. /var/spool/mail permissions are as follows in my linux box
# ls -ld /var/spool/mail/
drwxrwxr-x 4 root mail 4096 Feb 2 17:57 /var/spool/mail/


4. I did not install sendmail. I used the default setup that comes with red hat linux and modified the configuration.

I added shamly.local in /etc/mail/local-host-names
increased the serial number from 2004042601 to 2004042611 on both files but i still get the same error

I can send you the complete set of files used for dovecot, named and sendmail if it will help.


Thanks

Last edited by shamly; 02-05-2010 at 04:23 AM.
 
Old 02-05-2010, 05:50 AM   #7
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
1. My fault. Didn't notice that 192.168.1.201 was at the "From:..." line

2. If the users exist in a file known to dovecot, but are not system users, sendmail does not know how to handle mail to them. That's why you get "user unknown". Take a look here to see what modifications you have to do in sendmail.mc, in order to use dovecot to deliver mail. I cannot help you more on this, as I've never used dovecot.

3. Doesn't matter. Te problem is explained from the previous point.

4. As said above you have to reconfigure sendmail

No need any config files. Just run the following and post the output:
Code:
dig mx shamly.local 
sendmail -bv shafraz@mail.shamly.local
 
Old 02-07-2010, 09:48 PM   #8
shamly
LQ Newbie
 
Registered: Feb 2010
Location: Sri Lanka
Distribution: CentOS
Posts: 7

Original Poster
Rep: Reputation: 0
Hi,

I have not changed any settings when i ran the dig and sendmail commands. Below is the output from `dig`

; <<>> DiG 9.2.4 <<>> mx shamly.local
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 41382
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 2

;; QUESTION SECTION:
;shamly.local. IN MX

;; ANSWER SECTION:
shamly.local. 604800 IN MX 10 mail.shamly.local.

;; AUTHORITY SECTION:
shamly.local. 604800 IN NS ns1.shamly.local.

;; ADDITIONAL SECTION:
mail.shamly.local. 604800 IN A 192.168.1.199
ns1.shamly.local. 604800 IN A 192.168.1.109

;; Query time: 46 msec
;; SERVER: 192.168.1.109#53(192.168.1.109)
;; WHEN: Wed Feb 3 09:59:20 2010
;; MSG SIZE rcvd: 104


and below is the output from `sendmail -bv shafraz@mail.shamly.local`

shafraz@mail.shamly.local... deliverable: mailer esmtp, host mail.shamly.local., user shafraz@mail.shamly.local
 
Old 02-08-2010, 12:29 AM   #9
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
shafraz@mail.shamly.local... deliverable: mailer esmtp, host mail.shamly.local., user shafraz@mail.shamly.local
So, your sendmail still thinks that mail.shamly.local is not local. That's why you get the loopback error. You need to add mail.shamly.local and all other domains that must use your mailserver in /etc/mail/local-host-names and restart sendmail.
 
Old 02-08-2010, 11:28 PM   #10
shamly
LQ Newbie
 
Registered: Feb 2010
Location: Sri Lanka
Distribution: CentOS
Posts: 7

Original Poster
Rep: Reputation: 0
Hi bathory,

I have managed to get the mail system working .. . I made quite a few changes to the configuration of sendmail as well as dovecot and trying to back trace what I had done. I will let you know what modifications I had made. Gimme a bit of time.

Thanks a lot for all the help you have given me. It has helped me a lot.

Shamly

Last edited by shamly; 02-08-2010 at 11:29 PM.
 
Old 07-03-2011, 02:04 AM   #11
nawal
LQ Newbie
 
Registered: Dec 2010
Posts: 5

Rep: Reputation: 0
Unhappy

you promised to post the modifications that you made long time ago...
where is it?
 
  


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 config error: mail loops back to me (MX problem?) /jhannus Slackware 6 06-21-2011 05:44 AM
config error: mail loops back to me (MX problem?) linuxboy69 Linux - Networking 11 05-04-2011 02:52 PM
Help me! squirrelmail config error: mail loops back to me (MX problem? sasserworm Linux - Server 2 03-05-2009 11:30 AM
postfix virtual hosting problem - mail for domain.com loops back to myself ddaas Linux - Server 4 12-28-2008 08:50 PM
sendmail mail loops back but with a weird mail.barnhallrfc.com MX host masionas Linux - Server 2 12-09-2008 07:10 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 03:37 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