diff options
Diffstat (limited to 'src/org/noreply/fancydress/type3')
-rw-r--r-- | src/org/noreply/fancydress/type3/Payload.java | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/src/org/noreply/fancydress/type3/Payload.java b/src/org/noreply/fancydress/type3/Payload.java index 0294537..30464ca 100644 --- a/src/org/noreply/fancydress/type3/Payload.java +++ b/src/org/noreply/fancydress/type3/Payload.java @@ -2,8 +2,10 @@ package org.noreply.fancydress.type3; import java.io.*; +import java.util.*; import java.util.zip.*; import org.noreply.fancydress.crypto.*; +import org.noreply.fancydress.status.*; import org.noreply.fancydress.directory.*; import org.noreply.fancydress.misc.Util; import org.noreply.fancydress.type3.routing.*; @@ -80,7 +82,31 @@ public class Payload { } public Server[] filterExithops(Server[] s) { - return s; + /* FIXME: needs to be updated once we support fragmentation and stuff */ + /* FIXME: needFrom needs to be done */ + RoutingDestination r = route[0]; + ArrayList list = new ArrayList(); + for (int i=0; i<s.length; i++) { + ServerDescriptor sd; + try { + sd = s[i].getDescriptor(); + } catch (Mix3NoServerDescriptorException e) { + continue; + } + if (r instanceof RoutingSMTP) { + if (sd.getDeliverySMTPSection() == null) + continue; + list.add(s[i]); + } else if (r instanceof RoutingMBOX) { + if (sd.getDeliveryMBOXSection() == null) + continue; + list.add(s[i]); + } else if (r instanceof RoutingDROP) { + list.add(s[i]); + } else + throw new Error("Unsupported routing: "+r); + } + return (Server[]) list.toArray(new Server[list.size()]); } } |