doc/source/vmm_relocated.rst
author Pascal Volk <neverseen@users.sourceforge.net>
Wed, 24 Feb 2010 05:04:30 +0000
branchv0.6.x
changeset 213 1a9fee6b93bc
parent 212 77ac6f572855
child 215 33f727efa7c4
permissions -rw-r--r--
VMM:/{Alias,EmailAddress,Relocated}: use assertions for argument checks.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
212
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
     1
:mod:`VirtualMailManager.Relocated` --- Handling of relocated users
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
     2
===================================================================
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
     3
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
     4
.. module:: VirtualMailManager.Relocated
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
     5
  :synopsis: Handling of relocated users
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
     6
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
     7
.. moduleauthor:: Pascal Volk <neverseen@users.sourceforge.net>
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
     8
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
     9
.. toctree::
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    10
   :maxdepth: 2
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    11
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    12
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    13
This module provides the :class:`Relocated` class. The data are read
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    14
from/stored in the ``relocated`` table. An optional lookup table, used
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    15
by Postfix for the "``user has moved to new_location``" reject/bounce message.
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    16
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    17
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    18
Relocated
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    19
---------
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    20
.. class:: Relocated(dbh, address)
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    21
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    22
  Creates a new *Relocated* instance. If the relocated user with the given
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    23
  *address* is already stored in the database use :meth:`getInfo` to get the
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    24
  destination address of the relocated user. To set or update the destination
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    25
  of the relocated user use :meth:`setDestination`. Use :meth:`delete` in
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    26
  order to delete the relocated user from the database.
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    27
  
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    28
  :param dbh: a database connection
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    29
  :type dbh: :class:`PgSQL.Connection`
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    30
  :param address: the e-mail address of the relocated user.
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    31
  :type address: :class:`VirtualMailManager.EmailAddress.EmailAddress`
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    32
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    33
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    34
  .. method:: delete()
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    35
  
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    36
    :rtype: :obj:`None`
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    37
    :raise VirtualMailManager.Exceptions.VMMRelocatedException: if the
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    38
      relocated user doesn't exist.
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    39
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    40
    Deletes the relocated user from the database.
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    41
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    42
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    43
  .. method:: getInfo()
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    44
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    45
    :rtype: :class:`VirtualMailManager.EmailAddress.EmailAddress`
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    46
    :raise VirtualMailManager.Exceptions.VMMRelocatedException: if the
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    47
      relocated user doesn't exist.
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    48
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    49
    Returns the destination e-mail address of the relocated user.
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    50
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    51
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    52
  .. method:: setDestination(destination)
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    53
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    54
    :param destination: the new address where the relocated user has moved to
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    55
    :type destination: :class:`VirtualMailManager.EmailAddress.EmailAddress`
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    56
    :rtype: :obj:`None`
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    57
    :raise VirtualMailManager.Exceptions.VMMRelocatedException: if the
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    58
      *destination* address is already saved or is the same as the relocated
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    59
      user's address.
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    60
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    61
    Sets or updates the *destination* address of the relocated user.