doc/api/source/vmm_relocated.rst
changeset 578 20141b967c0b
parent 220 8b8d632f0ef3
equal deleted inserted replaced
577:4f9079dd4b65 578:20141b967c0b
       
     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:`get_info` to get the
       
    24   destination address of the relocated user. To set or update the destination
       
    25   of the relocated user use :meth:`set_destination`. 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:`pyPgSQL.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.errors.RelocatedError: if the relocated user
       
    38       doesn't exist.
       
    39 
       
    40     Deletes the relocated user from the database.
       
    41 
       
    42 
       
    43   .. method:: get_info()
       
    44 
       
    45     :rtype: :class:`VirtualMailManager.EmailAddress.EmailAddress`
       
    46     :raise VirtualMailManager.errors.RelocatedError: if the relocated user
       
    47       doesn't exist.
       
    48 
       
    49     Returns the destination e-mail address of the relocated user.
       
    50 
       
    51 
       
    52   .. method:: set_destination(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.errors.RelocatedError: if the *destination*
       
    58       address is already saved or is the same as the relocated user's address.
       
    59 
       
    60     Sets or updates the *destination* address of the relocated user.