feat(bind): add support for SPF per host
This commit is contained in:
1 parent
f4950c6388
commit
fdfce5ca6d
2 files changed
+6
No files matched your search
@@ -84,6 +84,7 @@ class HostAdmin(admin.ModelAdmin):
|
||||
("brand", "model"),
|
||||
"serial_number",
|
||||
("operating_system", "virtual"),
|
||||
"allow_email",
|
||||
)
|
||||
},
|
||||
),
|
||||
|
||||
@@ -116,12 +116,16 @@ class Domain(models.Model):
|
||||
host.hostname,
|
||||
interface.ip4address.address,
|
||||
)
|
||||
|
||||
for ipv6addr in interface.ip6address_set.all():
|
||||
content += "%-20s\tIN\tAAAA\t%s\n" % (
|
||||
host.hostname,
|
||||
ipv6addr.full_address(),
|
||||
)
|
||||
|
||||
if host.allow_email:
|
||||
content += f'{host.hostname}\tTXT\t"v=spf1 mx -all"\n'
|
||||
|
||||
return content
|
||||
|
||||
|
||||
@@ -508,6 +512,7 @@ class Host(models.Model):
|
||||
created_date = models.DateTimeField(auto_now_add=True)
|
||||
host_type = models.ForeignKey(HostType, models.CASCADE) # FIXME: SET_NULL?
|
||||
virtual = models.BooleanField(default=False)
|
||||
allow_email = models.BooleanField(default=False)
|
||||
operating_system = models.ForeignKey(
|
||||
OperatingSystem, models.CASCADE
|
||||
) # FIXME: SET_NULL?
|
||||
|
||||
Reference in new issue
Block a user