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