From c679a19c03c959061165cbb7a5d6d02c190da3eb Mon Sep 17 00:00:00 2001 From: Michael Hierweck Date: Thu, 16 Aug 2012 17:38:00 +0200 Subject: [PATCH 1/2] Use port 225 instead of 25 for smtp transport from mailin servers to hives. --- hsarback/src/de/hsadmin/mods/dom/DomainProcessorFactory.java | 4 ++-- .../de/hsadmin/mods/email/EMailAddressProcessorFactory.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hsarback/src/de/hsadmin/mods/dom/DomainProcessorFactory.java b/hsarback/src/de/hsadmin/mods/dom/DomainProcessorFactory.java index 24c9afe..e2d33b4 100644 --- a/hsarback/src/de/hsadmin/mods/dom/DomainProcessorFactory.java +++ b/hsarback/src/de/hsadmin/mods/dom/DomainProcessorFactory.java @@ -184,8 +184,8 @@ public class DomainProcessorFactory implements EntityProcessorFactory { domName + " anything\n" + "." + domName + " anything\n"), new ShellProcessor("postmap -r -i /etc/postfix-mailin/transport", - domName + " smtp:[" + pac.getName() + ".hostsharing.net]\n" + - "." + domName + " smtp:[" + pac.getName() + ".hostsharing.net]\n") + domName + " smtp:[" + pac.getName() + ".hostsharing.net]:225\n" + + "." + domName + " smtp:[" + pac.getName() + ".hostsharing.net]:225\n") ); } diff --git a/hsarback/src/de/hsadmin/mods/email/EMailAddressProcessorFactory.java b/hsarback/src/de/hsadmin/mods/email/EMailAddressProcessorFactory.java index 4611661..49fbdec 100644 --- a/hsarback/src/de/hsadmin/mods/email/EMailAddressProcessorFactory.java +++ b/hsarback/src/de/hsadmin/mods/email/EMailAddressProcessorFactory.java @@ -85,8 +85,8 @@ public class EMailAddressProcessorFactory implements EntityProcessorFactory { private Processor createMailinSetupProcessor(String domName, String pacName) { return new ShellProcessor("postmap -r -i /etc/postfix-mailin/transport", - domName + " smtp:[" + pacName + ".hostsharing.net]\n" + - "." + domName + " smtp:[" + pacName + ".hostsharing.net]\n"); + domName + " smtp:[" + pacName + ".hostsharing.net]:225\n" + + "." + domName + " smtp:[" + pacName + ".hostsharing.net]:225\n"); } private Processor createMailinDeleteProcessor(String domName) { From 06a487819fd0d58143ce5ca645e8f1e06d01588a Mon Sep 17 00:00:00 2001 From: Michael Hierweck Date: Thu, 16 Aug 2012 17:46:59 +0200 Subject: [PATCH 2/2] Moved /etc/postfix/virtual to /etc/postfix-mailin/virtual. Attention! The static hive configuration needs to be adjusted. --- .../src/de/hsadmin/mods/dom/DomainProcessorFactory.java | 6 +++--- .../hsadmin/mods/email/EMailAddressProcessorFactory.java | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/hsarback/src/de/hsadmin/mods/dom/DomainProcessorFactory.java b/hsarback/src/de/hsadmin/mods/dom/DomainProcessorFactory.java index e2d33b4..9ab6888 100644 --- a/hsarback/src/de/hsadmin/mods/dom/DomainProcessorFactory.java +++ b/hsarback/src/de/hsadmin/mods/dom/DomainProcessorFactory.java @@ -138,9 +138,9 @@ public class DomainProcessorFactory implements EntityProcessorFactory { private ShellProcessor createHiveEMailRemoveProcessor(String domName) { return new ShellProcessor( - "postmap -d '" + domName + "' /etc/postfix/virtual && " + - "for KEY in $(postmap -s /etc/postfix/virtual|grep '@" + domName + "\\s'|cut -f1); " + - "do postmap -d $KEY /etc/postfix/virtual; done" + "postmap -d '" + domName + "' /etc/postfix-mailin/virtual && " + + "for KEY in $(postmap -s /etc/postfix-mailin/virtual|grep '@" + domName + "\\s'|cut -f1); " + + "do postmap -d $KEY /etc/postfix-mailin/virtual; done" ); } diff --git a/hsarback/src/de/hsadmin/mods/email/EMailAddressProcessorFactory.java b/hsarback/src/de/hsadmin/mods/email/EMailAddressProcessorFactory.java index 49fbdec..2dfdc25 100644 --- a/hsarback/src/de/hsadmin/mods/email/EMailAddressProcessorFactory.java +++ b/hsarback/src/de/hsadmin/mods/email/EMailAddressProcessorFactory.java @@ -19,9 +19,9 @@ public class EMailAddressProcessorFactory implements EntityProcessorFactory { // TODO: combine both keys in a single call (optimization) EMailAddress email = (EMailAddress) entity; CompoundProcessor cp = new CompoundProcessor(); - cp.appendProcessor(new ShellProcessor( "postmap -r -i /etc/postfix/virtual", + cp.appendProcessor(new ShellProcessor( "postmap -r -i /etc/postfix-mailin/virtual", email.getFullDomain() + " -" ) ); - cp.appendProcessor(new ShellProcessor( "postmap -r -i /etc/postfix/virtual", + 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); @@ -47,13 +47,13 @@ public class EMailAddressProcessorFactory implements EntityProcessorFactory { CompoundProcessor cp = new CompoundProcessor(); EMailAddress email = (EMailAddress) entity; cp.appendProcessor( - new ShellProcessor( "postmap -d '" + email.getEMailAddress() + "' /etc/postfix/virtual" ) ); + new ShellProcessor( "postmap -d '" + email.getEMailAddress() + "' /etc/postfix-mailin/virtual" ) ); 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/virtual" ) ); + new ShellProcessor( "postmap -d '" + fullDomain + "' /etc/postfix-mailin/virtual" ) ); WaitingTasksProcessor waitingTasksProcessor = new WaitingTasksProcessor(cp); Config config = Config.getInstance(); for (String queueName : config.getProperty("queues.mail").split(",")) {