Alias Domain adding to user account - The domain: xxxxxxxxxxxxxxxx.com is not local

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Alias Domain adding to user account - The domain: xxxxxxxxxxxxxxxx.com is not local

ManicD
OK, we have a domain setup domain.co.uk and we added an alias of domain.com.

Then we added a user account on that domain user@domain.co.uk and tried to add a alias address to that user user@domain.com but when we try to add this we get an error "The domain: domain.com is not local"


Any ideas????

Have tried removing and re-adding the domain alias.
Reply | Threaded
Open this post in threaded view
|

Re: Alias Domain adding to user account - The domain: xxxxxxxxxxxxxxxx.com is not local

ManicD
Ok, poor solution so far

https://github.com/akissa/baruwa2/blob/master/baruwa/forms/accounts.py

class AddressForm(Form):
"""Add alias address"""
address = TextField(_('Email Address'),
[validators.Required(message=REQ_MSG),
validators.Email(message=EMAIL_MSG), check_domain])
enabled = BooleanField(_('Enabled'))


Can be edited to


class AddressForm(Form):
"""Add alias address"""
address = TextField(_('Email Address'),
[validators.Required(message=REQ_MSG),
validators.Email(message=EMAIL_MSG)])
enabled = BooleanField(_('Enabled'))


This removes the CHECK_DOMAIN validation and rely on user competence (dangerous i know) but works.
Reply | Threaded
Open this post in threaded view
|

Re: Alias Domain adding to user account - The domain: xxxxxxxxxxxxxxxx.com is not local

admin-at-extremeshok-dot-com
Rather edit the check domain function to lookup the alias table

Sent from my iPhone

> On 14 Oct 2014, at 12:35 PM, ManicD <[hidden email]> wrote:
>
> Ok, poor solution so far
>
> https://github.com/akissa/baruwa2/blob/master/baruwa/forms/accounts.py
>
> class AddressForm(Form):
> """Add alias address"""
> address = TextField(_('Email Address'),
> [validators.Required(message=REQ_MSG),
> validators.Email(message=EMAIL_MSG)*, check_domain*])
> enabled = BooleanField(_('Enabled'))
>
>
> Can be edited to
>
>
> class AddressForm(Form):
> """Add alias address"""
> address = TextField(_('Email Address'),
> [validators.Required(message=REQ_MSG),
> validators.Email(message=EMAIL_MSG)])
> enabled = BooleanField(_('Enabled'))
>
>
> This removes the CHECK_DOMAIN validation and rely on user competence
> (dangerous i know) but works.
>
>
>
>
> --
> View this message in context: http://baruwa-users-list.963389.n3.nabble.com/Alias-Domain-adding-to-user-account-The-domain-xxxxxxxxxxxxxxxx-com-is-not-local-tp4027467p4027469.html
> Sent from the Baruwa users list mailing list archive at Nabble.com.
>
> _______________________________________________
> http://pledgie.com/campaigns/12056

_______________________________________________
http://pledgie.com/campaigns/12056
Reply | Threaded
Open this post in threaded view
|

Re: Alias Domain adding to user account - The domain: xxxxxxxxxxxxxxxx.com is not local

ManicD
If i knew how i would!!! But couldnt see how.
Reply | Threaded
Open this post in threaded view
|

Re: Alias Domain adding to user account - The domain: xxxxxxxxxxxxxxxx.com is not local

ManicD
The Check Domain function is in teh same file

def check_domain(form, field):
    "check domain"
    domain = field.data.split('@')[1]
    try:
        Session.query(Domain).filter(Domain.name == domain).one()
    except NoResultFound:
        raise validators.ValidationError(
                    _(u'The domain: %(dom)s is not local')
                    % dict(dom=domain)
                )


but i cant see how to edit it to work with the alldomains view from the sql

anyone got any ideas where the change could be made?