Rebuilding /etc/virtual/domains - is the provided script wrong?

websafe

Verified User
Joined
Jun 15, 2010
Messages
103
Location
Opole, PL
My /etc/virtual/domains file was nulled. I used https://help.directadmin.com/item.php?id=113 to rebuild. But is the script provided on https://help.directadmin.com/item.php?id=113 really a correct solution?

As I understand the /etc/virtual/domains should contain all domains with the "Local Mail Server" checkbox checked:

Local Mail Server
[ X ]​
Use this server to handle my emails.
If not, change the MX record and uncheck this option

But the script will simply put *all* domains back in /etc/virtual/domains - not just these with "Local Mail Server" enabled - and that's not really what we want, right?

I'm not sure if this "checkbox" setting is stored somewhere else in /usr/local/directadmin/data/users/domains/... Is it?
 
Last edited:
As I understand the /etc/virtual/domains should contain all domains with the "Local Mail Server" checkbox checked:
Correct. But this is an old script.

Seems it indeed needs some updating to not include those domains when external mailserver is used (local mailserver unchecked).
 
@Richard G IMHO the new script does exactly the same, all found domains are added to /etc/virtual/domains, not just these with local mailserver checked.

And by the way, where does DirectAdmin store this checked/unchecked local mailserver for a specific domain? IMHO it's the /etc/virtual/domains file and nowhere else... The domain is removed from /etc/virtual/domains when local mailserver is unchecked and domain is added to /etc/virtual/domains, when it's checked.

So there's propably no way of rebulding /etc/virtual/domains as it was, the only way is restoring from a backup.

The same goes for /etc/virtual/domain.tld/filter.conf which sometimes gets nulled (when / is full). Also no way to rebuild. Only restoring from backup.

Or am I wrong?
 
The domain is removed from /etc/virtual/domains when local mailserver is unchecked and domain is added to /etc/virtual/domains, when it's checked.
If there is indeed no other place where this is verified, then indeed the restore can really be improved.

You might consider to fill in a feature request for this improvement.
 
Back
Top