| | |
| | | CompoundProcessor cp = new CompoundProcessor(); |
| | | cp.appendProcessor(new ShellProcessor( "postmap -r -i /etc/postfix-mailin/virtual", |
| | | email.getFullDomain() + " -" ) ); |
| | | WaitingTasksProcessor waitingTasksProcessor = new WaitingTasksProcessor(cp); |
| | | Config config = Config.getInstance(); |
| | | cp.appendProcessor(new ShellProcessor( "postmap -r -i /etc/postfix-mailin/virtual", |
| | | email.getEMailAddress() + " " + email.getTarget() ) ); |
| | | if (emailAddressCount(em, email) < 2) { |
| | | WaitingTasksProcessor waitingTasksProcessor = new WaitingTasksProcessor(cp); |
| | | String domName = email.getDomain().getName(); |
| | | Config config = Config.getInstance(); |
| | | for (String queueName : config.getProperty("queues.mail").split(",")) { |
| | | waitingTasksProcessor.appendProcessor(queueName, new ShellProcessor( "postmap -r -i /etc/postfix-mailin/relayrecipients", |
| | | email.getEMailAddress() + " anything" ), "Add to relayrecipients" ); |
| | | } |
| | | if (emailAddressCount(em, email) <= 1) { |
| | | String domName = email.getDomain().getName(); |
| | | for (String queueName : config.getProperty("queues.mail").split(",")) { |
| | | waitingTasksProcessor.appendProcessor(queueName, createMailinSetupProcessor(domName, pac), queueName + ".hostsharing.net"); |
| | | } |
| | |
| | | EMailAddress email = (EMailAddress) entity; |
| | | cp.appendProcessor( |
| | | new ShellProcessor( "postmap -d '" + email.getEMailAddress() + "' /etc/postfix-mailin/virtual" ) ); |
| | | Config config = Config.getInstance(); |
| | | WaitingTasksProcessor waitingTasksProcessor = new WaitingTasksProcessor(cp); |
| | | for (String queueName : config.getProperty("queues.mail").split(",")) { |
| | | waitingTasksProcessor.appendProcessor(queueName, |
| | | new ShellProcessor( "postmap -d '" + email.getEMailAddress() + "' /etc/postfix-mailin/relayrecipients" ), "Remove from relayrecipients" ); |
| | | } |
| | | int emailAddressCount = emailAddressCount(em, email); |
| | | if (emailAddressCount == 0) { |
| | | // remove the domain from virtual.db |
| | | String fullDomain = email.getFullDomain(); |
| | | cp.appendProcessor( |
| | | new ShellProcessor( "postmap -d '" + fullDomain + "' /etc/postfix-mailin/virtual" ) ); |
| | | WaitingTasksProcessor waitingTasksProcessor = new WaitingTasksProcessor(cp); |
| | | Config config = Config.getInstance(); |
| | | new ShellProcessor( "postmap -d '" + fullDomain + "' /etc/postfix-mailin/virtual" ) ); |
| | | for (String queueName : config.getProperty("queues.mail").split(",")) { |
| | | waitingTasksProcessor.appendProcessor(queueName, createMailinDeleteProcessor(fullDomain), queueName + ".hostsharing.net"); |
| | | } |