Package mireka.transmission.immediate
Class IndirectImmediateSender
- Object
-
- mireka.transmission.immediate.IndirectImmediateSender
-
- All Implemented Interfaces:
ImmediateSender
@NotThreadSafe public class IndirectImmediateSender extends Object implements ImmediateSender
IndirectImmediateSender synchronously sends all mails through other SMTP servers specified in the configuration, typically to a smarthost, instead of sending the mail directly to the SMTP servers of the recipients. It tries all listed smarthosts until a working one is found. The smarthost will in turn transmit the mail to remote domains. This is useful for example if a network is behind a dynamic IP address, considering that dynamic IP addresses are frequently rejected by SMTP servers.If a smart host name resolves to more than one IP addresses, than only the first one is used.
Instead of specifying a single smarthost, an Upstream with more servers can also be supplied and Mireka will distribute outgoing mails like a simple load balancer.
-
-
Constructor Summary
Constructors Constructor Description IndirectImmediateSender()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MailToHostTransmittergetMailToHostTransmitter()UpstreamgetUpstream()voidsend(Mail mail)Transmits mail to a smart host.voidsetBackendServer(BackendServer server)Sets the upstream to the supplied single server.voidsetMailToHostTransmitter(MailToHostTransmitter mailToHostTransmitter)voidsetUpstream(Upstream upstream)booleansingleDomainOnly()Returns true if the createdImmediateSenderrequires that all recipients of the mail to be sent have the same remote-part.
-
-
-
Method Detail
-
singleDomainOnly
public boolean singleDomainOnly()
Description copied from interface:ImmediateSenderReturns true if the createdImmediateSenderrequires that all recipients of the mail to be sent have the same remote-part.- Specified by:
singleDomainOnlyin interfaceImmediateSender
-
send
public void send(Mail mail) throws SendException, RecipientsWereRejectedException, IllegalArgumentException, PostponeException
Transmits mail to a smart host.- Specified by:
sendin interfaceImmediateSender- Throws:
PostponeException- if transmission to all of the hosts must be postponed, because all of them are assumed to be busy at this moment.IllegalArgumentException- if the domains of the recipients are not the same, or if the recipient is the special global postmaster address, which has no absolute domain.SendExceptionRecipientsWereRejectedException
-
getMailToHostTransmitter
public MailToHostTransmitter getMailToHostTransmitter()
- Category:
- GETSET
-
setMailToHostTransmitter
public void setMailToHostTransmitter(MailToHostTransmitter mailToHostTransmitter)
- Category:
- GETSET
-
setBackendServer
public void setBackendServer(BackendServer server)
Sets the upstream to the supplied single server.- Category:
- GETSET
-
getUpstream
public Upstream getUpstream()
- Category:
- GETSET
-
setUpstream
public void setUpstream(Upstream upstream)
- Category:
- GETSET
-
-