MailEnable as secundairy SMTP server (2 MX records)

For any other discussion relating to MailEnable.
sunpost
Posts: 438
Joined: Wed Sep 04, 2002 3:04 pm

Post by sunpost »

just another option...i use MS SMTP for my smarthost without any problems and do not have to set up the domains.

good luck :!:

Merit
Posts: 29
Joined: Wed Mar 24, 2004 6:42 am

Post by Merit »

That's exactly what it would have come to for me as well. Unfortunately development time is pretty tight around here :wink:

Sounds like you've got a brialliant solutions to not so brilliant secondary mail server support in MailEnable. They just didn't design it for large scale hosting backups I guess. No good.

If you wouldn't mind posting your work that would be absoluely amazing. It would not only be appreciated all around but recognized as a highly valuable tool amoung the forum users.

Chris

jammin
Posts: 30
Joined: Sun Jun 29, 2003 8:06 am

Post by jammin »

OK no problem ... here it is ...

Using this method, the secondary can be either MailEnable Pro or Standard.

You can run the script on either server. Just remember that it is quite dumb ... the secondary server domain file *will* be overwritten. Only use this script if the secondary server is just being used as a backup, and does not contain any real domains or mailboxes.

Just set these variables:

strSourceFileName - the full path to the primary server domain.tab file
strDestinationFileName - the full path to the secondary server domain.tab file (will be overwritten)
strDestinationPostOfficeName - the name of the Post Office on the secondary server that will contain *all* of the backed up domains
strSmartHostAddress - the IP address of the primary server

Code: Select all


Dim objFSO
Dim strSourceDomainFile
Dim strDestinationDomainFile
Dim strDestinationPostOfficeName
Dim strSmartHostAddress

dim strSourceFileName, objSourceFile
dim strDestinationFileName, objDestFile
dim aryDomain
Dim strLine

strSourceFileName = "\\fs1\mail\config\domain.tab"
strDestinationFileName = "\\fs2\mail\config\domain.tab"
strDestinationPostOfficeName = "Backup-PostOffice"
strSmartHostAddress = "192.168.100.1"

set objFSO = CreateObject("Scripting.FileSystemObject")

set objDestFile = objFSO.OpenTextFile(strDestinationFileName, 2, true)
set objSourceFile = objFSO.OpenTextFile(strSourceFileName, 1, false)

do while not objSourceFile.AtEndOfStream
	aryDomain = split(objSourceFile.ReadLine,vbTab)
	strLine = aryDomain(0) & vbTab & "1" & vbTab & "1" & vbTab & strSmartHostAddress  & vbTab & strDestinationPostOfficeName 
	objDestFile.WriteLine strLine
loop

objDestFile.Close
objSourceFile.Close

set objFSO = nothing

Cheers
Jammin

Merit
Posts: 29
Joined: Wed Mar 24, 2004 6:42 am

Post by Merit »

Works like a charm! The perfect piece of code... well done! :D

Mind if I post a link to this thread on the Wb Host Automation (HELM) forums? I'll give you all the credit of course but there are a ton of people who would be interested in this...

Thanks a ton!

Chris

jammin
Posts: 30
Joined: Sun Jun 29, 2003 8:06 am

Post by jammin »

No problem, I am also a Helm user! :)

I should also have mentioned for non scripters that the code needs to be saved into a text file with a "vbs" extension (eg. UpdateSecondary.vbs) and run by double clicking it.

You could also schedule it with the task scheduler.

Cheers
Ben

Marcus2

This is a great thread....

Post by Marcus2 »

Perfect, this is exactly what I have been looking for. I have just set up my first dedicated server as I was fed up using other hosts but I am worried about the server going down and losing incoming emails. This looks to be the perfect solution with some great comments/additions by a number of people.
Thanks to everyone who has added their little bit to this thread, and also obviously to ME for providing ME and the forum in the first place.

martinotis
Posts: 6
Joined: Thu Apr 22, 2004 6:35 pm
Location: Montreal, Québec

martinotis

Post by martinotis »

Hi to all !!

I'm trying to set up MailEnable as a secondary Mail Server for my primary MailEnable Professional. I followed the instruction I found in this topic by doing smarthost for my domain but it's not working. When an email reach the secondary server, it stay there even if the domain is smarthosted.

I wondering why. I created on the secondary server, the same mailbox than on the primary server. Could it be the problem ?

Thanks

Martin

MailEnable
Site Admin
Posts: 4441
Joined: Tue Jun 25, 2002 3:03 am
Location: Melbourne, Victoria Australia

Post by MailEnable »

MailEnable will deliver locally if a mailbox exists for local delivery. This will override smarthosting; unless you use the MEROUTE utility to force smarthosting over local delivery.

See:

http://www.mailenable.com/kb/Content/Ar ... D=me020276
http://www.mailenable.com/utilities/addons
Regards, Andrew

Andy

SMTP

Post by Andy »

What I am trying to do:
Setup a backup mx server with mail enable that simple receives all mail via secondary mx record, then passes it to the live server every 10 minutes and keeps retrying until the live is up and working, with out the need to replicate each domains settings, so just using smart host to point mail to the live servers IP causing me little work.

Background:
Hi, I have installed 2003 server, set a static IP on NIC, opened firewall via port redirection via NAT on port 25 (and 110 for luck) to this server. I have installed mail enable standard (free version, current stable release). Everything has gone well and the report shows no problems. I have set my test domains dns entry to have a secondary mx record to this address.

My work flow:
I read a few posts back about using the SMTP connect to on the smarthost enable tab clicking enable and entering the IP address of my data centre mail enabled live server and port 25. I have done this!

A few Questions, value your help!

1) Relay
However I have a question about what I just did as on the properties of the SMTP connector there is a relay tab. Since one of the post mentioned in effect I become visable as an open relay (although I am not really as only pass to a server that is not open relay) I thought I would look at what the tab has set. It shows allow mail relay, allow mail relay for authenticated senders, allow relay for priv. IP ranges all as Y (ticked) but does not have allow relay for local sending addresses, by default. Is this correct? Do I need to tick local as well, I would think not but want to be sure!

2) SMTP properties, SMTP TAB
This has the options local domain name. I am not in a local domain, I am a stand-allow server in work group, what do I put in here?
Also the next option is DNS Address(es) is this my ISP DNS servers which my computers network card know about and use to resolve names?
Last question is about listen on alternative ports. If I was to put 110 in here would it be the case whe a user has problems checking their pop3 via mail.domain.com it would see the mx record and come over to this backup server or is mx records only for pointing email to a destination.

3) How do i know its working if I don't have access to take down the mail server? Do I just change the MX 10 record to be an incorrect IP on a test domain?

Thanks for the help all.

ttracey
Posts: 34
Joined: Mon Jul 22, 2002 5:11 am
Location: Puyallup, WA USA

Post by ttracey »

MailEnable wrote:MailEnable will deliver locally if a mailbox exists for local delivery. This will override smarthosting; unless you use the MEROUTE utility to force smarthosting over local delivery.

See:

http://www.mailenable.com/kb/Content/Ar ... D=me020276
http://www.mailenable.com/utilities/addons
This is exactly the problem that I have with open relaying from my server. If you have all of the security enabled, and have smarthosted specific domains (i.e. aol.com), any mail that shows to one of the smarthosted domains is forwarded - apparently regardless of its origin. Though this is desirable for legitimate purposes, it does open a server to relay, no?

What can be done to eliminate this hole?

Thanks!

raja
Posts: 42
Joined: Mon Oct 13, 2003 10:08 am
Location: Stockholm, Sweden

Post by raja »

Hi,

I would also like to know how to setup smart host without beeing open for relay. Is it possible?

Kind Regards,
raja

mjb-is
Posts: 22
Joined: Wed Jun 08, 2005 6:09 pm

Post by mjb-is »

Thanks for this script. I ahve been trying to figure out how to set up backup MX using ME and I've now got it all running nicely using ME Std 1.9 on the backup mail server.

ilker
Posts: 2
Joined: Sun Jan 19, 2020 6:56 am

Re:

Post by ilker »

is it apply for Gmail?
MDColson wrote:
Fri Oct 10, 2003 2:26 pm
It's actually pretty simple....

Assume this config: MX5 mail.domain.com and MX10 backup.domain.com (IS ALRADY SET UP IN YOUR DNS)

Its really simple... ON BACKUP.DOMAIN.COM >> You create a postoffice (or use an existing one), add a domain (domain.com) in that postoffice, double click on the domain, and check off the box that says act as smarthost, then click the button that says 'add' to add the host to forward the emails to... in this case you would add mail.domain.com... YOURE ALMOST DONE!!! Then go into the smtp properties under servers>localhost>connectors>smtp go to the 'advanced smtp' tab. Then adjust the timeout/retry numbers (for example reading down, my numbers are 20,20,168,1000,1,168,1 - this means my machine will try send the email every hour for an entire week 168hours and so on...) Then you just need to check off the 2 boxes that start with 'do not'... then you're done (this disables the failed attempt notices when it tries to send mail back up to mail.domain.com but it's still down) ...

This mailserver (backup.domain.com) will catch all of the email for domain.com when mail.domain.com goes down, it will try to redeliver it every hour for 7 days, when it goes back up it will forward all the mail back up to mail.domain.com.....

Luciad72
Posts: 1
Joined: Thu Feb 20, 2020 3:28 am

Re:

Post by Luciad72 »

MailEnable wrote:
Wed Feb 19, 2003 9:51 am
I see - Yes. What you would need to do is smarthost the domain to the primary MX within MailEnable (which is serving the secondary MX). It will therefore hold the mail and attempt to deliver it to the primary (which it resolves by host name - not DNS) https://www.comparateur-mutuelle-assurance-sante.com/la-meilleure-mutuelle-sante-senior . Unfortunately, you may need to disable Non Delivery Reports and Delay Notifications on the SMTP connector because the Delay notifications will be sent back to the user indicating that the message is queued - which you may not want. You may also want to adjust the message lifetime to ensure that the messages do not expire.

FYI: We are implementing the ability to disable Delay Notifications for smarthosted domains.
I think it's a good idea to turn off SMTP.

Post Reply