Hi,
I'm using Virtualmin 4.03 Pro and CentOS 6.4.
I've setup a secondary mail server and I've defined the MX record in the template's BIND section so I checked No in the Add DNS MX records for secondary mail servers? option. But when I create a new virtual server a line with the MX record and priority 10 is still added to the end of the BIND zone file. If I forget to delete it the mail is bounced in the secondary mail server with the error "mail for domain loops back to myself". What can I do?
By the way, I've got a problem too with the Validate MX records for domains with email? My primary MX mail server isn't the Virtualmin server so I selected No, but then the warning "This domain has email enabled, but none of the MX records..." appears. If I select Yes, then the warning goes away. Any idea?
Thanks in advance.
-Robert
Comments
Submitted by JamieCameron on Tue, 11/05/2013 - 12:17 Comment #1
Was the MX that was added for the Virtualmin system itself, or one of the secondary MXs?
Submitted by RobertoPastor on Tue, 11/05/2013 - 15:08 Pro Licensee Comment #2
It added the secondary MX record.
Submitted by JamieCameron on Tue, 11/05/2013 - 19:13 Comment #3
Can you check that in the file /etc/webmin/virtual-server/config, the line secmx_nodns=1 appears?
That is supposed to disable creation of MX entries for secondary DNS servers.
Submitted by RobertoPastor on Fri, 11/08/2013 - 15:14 Pro Licensee Comment #4
Sorry for the delay.
I checked the file and that line appears as you mentioned.
Submitted by JamieCameron on Fri, 11/08/2013 - 15:36 Comment #5
Thanks. Could you create a new test domain and then post the complete BIND zone file here? I'd like to see the exact ordering of the records.
Submitted by RobertoPastor on Fri, 11/08/2013 - 16:01 Pro Licensee Comment #6
I created testdomain.com and this is the BIND zone. As you can see I had to change the MX priorities in the template from 10,20 and 30 to 1,2 and 3 to avoid the MX loopback.
$TTL 2d
@ IN SOA dns1.tsc.es. hostmaster.tsc.es. (
2013110802
12h
1h
4W
3h )
;
; Name servers
;
IN NS dns1.tsc.es.
IN NS dns2.tsc.es.
IN NS pegaso.canal-alicante.com.
;
IN MX 1 antlia.tsc.es.
IN MX 2 perseo.tsc.es.
IN MX 3 hydra.tsc.es.
;
; SPF Records
;
IN TXT "v=spf1 mx -all"
IN SPF "v=spf1 mx -all"
;
; zone records
;
;
@ IN A 195.57.58.70
www IN A 195.57.58.70
mail IN A 195.57.58.70
ftp IN A 195.57.58.70
smtp IN A 195.57.58.70
pop3 IN A 195.57.58.70
imap IN A 195.57.58.70
admin IN A 195.57.58.70
webmail IN A 195.57.58.70
testdomain.com. IN MX 10 perseo.tsc.es.
autoconfig.testdomain.com. IN A 195.57.58.70
Submitted by JamieCameron on Fri, 11/08/2013 - 17:15 Comment #7
Ok, it looks like those MX records aren't in the format that Virtualmin creates. Do you have any custom records set at System Settings -> Server Templates -> Default Settings -> BIND DNS Domain ?
Submitted by RobertoPastor on Sat, 11/09/2013 - 14:59 Pro Licensee Comment #8
Well, yes. I read the BIND DNS book long time ago so I set the records in my Default Template like they were shown in that book.
$TTL 2d
@ IN SOA dns1.tsc.es. hostmaster.tsc.es. (
${CURRENT_YEAR}${CURRENT_MONTH}${CURRENT_DAY}01 ; serial YYYYMMDDnn
12h ; refresh = 12 hours
1h ; retry = 1 hour
4W ; expire = 4 weeks
3h ; minimum = 3 hours
)
;
; Name servers
;
IN NS dns1.tsc.es.
IN NS dns2.tsc.es.
IN NS pegaso.canal-alicante.com.
;
IN MX 1 antlia.tsc.es.
IN MX 2 perseo.tsc.es.
IN MX 3 hydra.tsc.es.
;
; SPF Records
;
IN TXT "v=spf1 mx -all"
IN SPF "v=spf1 mx -all"
;
; zone records
;
;
@ IN A 195.57.58.70
www IN A 195.57.58.70
mail IN A 195.57.58.70
ftp IN A 195.57.58.70
smtp IN A 195.57.58.70
pop3 IN A 195.57.58.70
imap IN A 195.57.58.70
admin IN A 195.57.58.70
webmail IN A 195.57.58.70
Submitted by JamieCameron on Sat, 11/09/2013 - 17:06 Comment #9
Ok, so that's where the MX records are coming from.
You should just leave that field empty, and Virtualmin will create the correct records for your domain, including the MXs that are appropriate.
Submitted by RobertoPastor on Sun, 11/10/2013 - 12:14 Pro Licensee Comment #10
Thanks for your answer, but I can't leave it empty because I'm using a frontend machine to filter all the email that comes in and out of our servers. The primary MX relays all the email to the Virtualmin host in the backend. If I let Virtualmin create all the records it will add itself as the first MX bypassing the filtering host.
It was all working very well untiI I decided to add a secondary mail server. I configured it in "Addresses and Networking" | "Secondary Mail Servers" then I added the new MX record in the BIND DNS default template. The problem came out when I set up the "Add DNS MX records for secondary mail servers?" option to No. I think It doesn't work as expected because even though I selected "No" it still adds automatically the secondary MX record in the dns zone when I create a new domain.
Sorry if I didn't explained it clearly in my previous posts.
Submitted by JamieCameron on Sun, 11/10/2013 - 15:57 Comment #11
Ok, now I understand better .. your template actually seems fine then.
I am mystifies as to where that priority 10 MX record is coming from, as it should be blocked if
secmx_nodns=1
is set. Is there any chance I could login to your system myself to see what is going wrong here?Submitted by RobertoPastor on Mon, 11/11/2013 - 07:04 Pro Licensee Comment #12
Of course.
I activated the "Remote Login Privileges" and it send to you the keys, but I forgot to write a comment about what thread it was referred to. You'll see in the message that the server is hydra.tsc.es.
Submitted by JamieCameron on Mon, 11/11/2013 - 18:02 Comment #13
Thanks for the login. I just created a test domain on your system with the command :
virtualmin create-domain --domain jamietest.com --dir --unix --dns --pass smeg
and the only MX records that were added were the ones from the template.
Submitted by RobertoPastor on Tue, 11/12/2013 - 03:11 Pro Licensee Comment #14
You're right. I made another test and If you add the --mail option when creating the domain then it adds the line with the secondary MX record. Try:
virtualmin create-domain --domain jamietest.com --dir --unix --dns --mail --pass smeg
Submitted by JamieCameron on Tue, 11/12/2013 - 13:37 Comment #15
Ok, I see the cause of this bug now - it will be fixed in the next Virtualmin release.
Submitted by RobertoPastor on Wed, 11/13/2013 - 03:06 Pro Licensee Comment #16
Thanks
Submitted by Issues on Wed, 11/27/2013 - 03:11 Comment #17
Automatically closed -- issue fixed for 2 weeks with no activity.