Examples of JamesUser


Examples of org.apache.james.services.JamesUser

    }

    public boolean setPassword(String username,
                               String password)
            throws RemoteException {
        JamesUser user = (JamesUser)users.getUserByName(username);
        if (user == null) {
            getLogger().error("No such user " + username + " found!");
            throw new RemoteException("No such user " + username + " found!");
        }
        if (user.setPassword(password)) {
            users.updateUser(user);
            getLogger().info("Password for user " + username + " reset.");
            return true;
        }
        getLogger().error("Error resetting password for user " + username);
View Full Code Here

Examples of org.apache.james.services.JamesUser


    public boolean setAlias(String username,
                            String alias)
            throws RemoteException {
        JamesUser user = (JamesUser)users.getUserByName(username);
        if (user == null) {
            getLogger().error("No such user " + username + " found!");
            throw new RemoteException("No such user " + username + " found!");
        }
        JamesUser aliasUser = (JamesUser)users.getUserByName(alias);
        if (aliasUser == null) {
            getLogger().error("Alias unknown to server - create that user " + alias + " first!");
            throw new RemoteException("Alias unknown to server - create that user " + alias + " first!");
        }
        if (user.setAlias(alias)) {
View Full Code Here

Examples of org.apache.james.services.JamesUser

    }


    public boolean unsetAlias(String username)
            throws RemoteException {
        JamesUser user = (JamesUser)users.getUserByName(username);
        if (user == null) {
            getLogger().error("No such user " + username + " found!");
            throw new RemoteException("No such user " + username + " found!");
        }
        if (user.getAliasing()) {
            user.setAliasing(false);
            users.updateUser(user);
            getLogger().info("Alias for user " + username + " unset.");
            return true;
        }
        getLogger().info("Aliasing not active for user " + username);
View Full Code Here

Examples of org.apache.james.services.JamesUser

        return false;
    }

    public String checkAlias(String username)
            throws RemoteException {
        JamesUser user = (JamesUser)users.getUserByName(username);
        if (user == null) {
            getLogger().error("No such user " + username + " found!");
            throw new RemoteException("No such user " + username + " found!");
        }
        if (user.getAliasing()) {
            String alias = user.getAlias();
            getLogger().info("Alias is set to " + alias + " for user " + username);
            return alias;
        }
        getLogger().info("No alias is set for this user " + username);
        return null;
View Full Code Here

Examples of org.apache.james.services.JamesUser


    public boolean setForward(String username,
                              String forward)
            throws RemoteException {
        JamesUser user = (JamesUser)users.getUserByName(username);
        if (user == null) {
            getLogger().error("No such user " + username + " found!");
            throw new RemoteException("No such user " + username + " found!");
        }
        MailAddress forwardAddress;
        try {
            forwardAddress = new MailAddress(forward);
        } catch (ParseException pe) {
            getLogger().error("Parse exception with that email address: " + pe.getMessage());
            throw new RemoteException("Parse exception with that email address: " + pe.getMessage());
        }
        if (user.setForwardingDestination(forwardAddress)) {
            user.setForwarding(true);
            users.updateUser(user);
            getLogger().info("Forwarding destination for " + username + " set to: " + forwardAddress.toString());
            return true;
        }
        getLogger().error("Error setting forward for user " + username);
View Full Code Here

Examples of org.apache.james.services.JamesUser

        return false;
    }

    public boolean unsetForward(String username)
            throws RemoteException {
        JamesUser user = (JamesUser)users.getUserByName(username);
        if (user == null) {
            getLogger().error("No such user " + username + " found!");
            throw new RemoteException("No such user " + username + " found!");
        }
        if (user.getForwarding()) {
            user.setForwarding(false);
            users.updateUser(user);
            getLogger().info("Forward for user " + username + " unset.");
            return true;
        }
        getLogger().info("Forwarding not active for user " + username);
View Full Code Here

Examples of org.apache.james.services.JamesUser

        return false;
    }

    public String checkForward(String username)
            throws RemoteException {
        JamesUser user = (JamesUser)users.getUserByName(username);
        if (user == null) {
            getLogger().error("No such user " + username + " found!");
            throw new RemoteException("No such user " + username + " found!");
        }
        if (user.getForwarding()) {
            String forward = user.getForwardingDestination().toString();
            getLogger().info("Forward is set to " + forward + " for user " + username);
            return forward;
        }
        getLogger().info("No forward set for user " + username);
        return null;
View Full Code Here

Examples of org.apache.james.services.JamesUser

            }
        }
        else {
            username = recipient.getUser();
        }
        JamesUser user;
        if ( enableAliases || enableForwarding ) {
            user = ( JamesUser ) localusers.getUserByName( username );
            if ( enableAliases && user.getAliasing() ) {
                username = user.getAlias();
            }
            // Forwarding takes precedence over local aliases
            if ( enableForwarding && user.getForwarding() ) {
                MailAddress forwardTo = user.getForwardingDestination();
                if ( forwardTo == null ) {
                    StringBuffer errorBuffer =
                            new StringBuffer( 128 )
                            .append( "Forwarding was enabled for " )
                            .append( username )
View Full Code Here

Examples of org.apache.james.services.JamesUser

    }

    public boolean setPassword(String username,
                               String password)
            throws RemoteException {
        JamesUser user = (JamesUser)users.getUserByName(username);
        if (user == null) {
            getLogger().error("No such user " + username + " found!");
            throw new RemoteException("No such user " + username + " found!");
        }
        if (user.setPassword(password)) {
            users.updateUser(user);
            getLogger().info("Password for user " + username + " reset.");
            return true;
        }
        getLogger().error("Error resetting password for user " + username);
View Full Code Here

Examples of org.apache.james.services.JamesUser


    public boolean setAlias(String username,
                            String alias)
            throws RemoteException {
        JamesUser user = (JamesUser)users.getUserByName(username);
        if (user == null) {
            getLogger().error("No such user " + username + " found!");
            throw new RemoteException("No such user " + username + " found!");
        }
        JamesUser aliasUser = (JamesUser)users.getUserByName(alias);
        if (aliasUser == null) {
            getLogger().error("Alias unknown to server - create that user " + alias + " first!");
            throw new RemoteException("Alias unknown to server - create that user " + alias + " first!");
        }
        if (user.setAlias(alias)) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.