<NME> models.py
<BEF> """Relay domain related models."""

from django.db import models


class RecipientAccess(models.Model):
    """An recipient level access table."""

    pattern = models.CharField(unique=True, max_length=254)
    action = models.CharField(max_length=40)
        """
        csvwriter.writerow(
            ["relaydomain", self.domain.name, self.target_host,
             self.service.name, self.domain.enabled, self.verify_recipients]
        )
        for dalias in self.domain.domainalias_set.all():
            dalias.to_csv(csvwriter)
        :param user: user importing the relay domain
        :param str row: relay domain definition
        """
        if len(row) != 6:
            raise BadRequest(_("Invalid line"))
        self.domain = admin_models.Domain(
            name=row[1].strip(), type="relaydomain", quota=0,
            enabled=(row[4].strip() in ["True", "1", "yes", "y"])
        )
        self.domain.save(creator=user)
        self.target_host = row[2].strip()
        self.service, created = Service.objects.get_or_create(
            name=row[3].strip())
        self.verify_recipients = (row[5].strip() in ["True", "1", "yes", "y"])
        self.save(creator=user)



<MSG> Include target port in import/export.

<DFF> @@ -106,7 +106,8 @@ class RelayDomain(admin_models.AdminObject):
         """
         csvwriter.writerow(
             ["relaydomain", self.domain.name, self.target_host,
-             self.service.name, self.domain.enabled, self.verify_recipients]
+             self.target_port, self.service.name, self.domain.enabled,
+             self.verify_recipients]
         )
         for dalias in self.domain.domainalias_set.all():
             dalias.to_csv(csvwriter)
@@ -117,17 +118,18 @@ class RelayDomain(admin_models.AdminObject):
         :param user: user importing the relay domain
         :param str row: relay domain definition
         """
-        if len(row) != 6:
+        if len(row) != 7:
             raise BadRequest(_("Invalid line"))
         self.domain = admin_models.Domain(
             name=row[1].strip(), type="relaydomain", quota=0,
-            enabled=(row[4].strip() in ["True", "1", "yes", "y"])
+            enabled=(row[5].strip() in ["True", "1", "yes", "y"])
         )
         self.domain.save(creator=user)
         self.target_host = row[2].strip()
+        self.target_port = row[3].strip()
         self.service, created = Service.objects.get_or_create(
-            name=row[3].strip())
-        self.verify_recipients = (row[5].strip() in ["True", "1", "yes", "y"])
+            name=row[4].strip())
+        self.verify_recipients = (row[6].strip() in ["True", "1", "yes", "y"])
         self.save(creator=user)
 
 

Include target port in import/export.