create valid mailbox id on hyphen in localpart

This commit is contained in:
Peter Hormanns 2020-03-27 14:52:02 +01:00
parent 63201377f2
commit 29f13cf0ca

View File

@ -45,12 +45,14 @@ public class MailboxDAO {
}
private String getMailbox(String pac, String localpart) throws IOException, XmlRpcException, MailboxNotFound {
final String mailboxPostfix = localpart.replace('-', '_');
final String mailboxIdentifier = pac + "-" + mailboxPostfix;
final List<Serializable> xmlRpcParamsList = new ArrayList<Serializable>();
xmlRpcParamsList.add(pac);
xmlRpcParamsList.add(ticketBox.getTicket());
final HashMap<String, Serializable> whereParamsMap = new HashMap<String, Serializable>();
xmlRpcParamsList.add(whereParamsMap);
whereParamsMap.put("name", pac + "-" + localpart);
whereParamsMap.put("name", mailboxIdentifier);
final Object[] rpcResult = (Object[])rpcClient.execute("user.search", xmlRpcParamsList);
if (rpcResult.length == 1) {
@SuppressWarnings("unchecked")