Class MtaAddress


  • @Immutable
    public class MtaAddress
    extends Object
    MtaAddress contains all informations which are necessary to contact that MTA and identify it in DSN reports, logs.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      java.net.InetAddress address
      IP address of MTA.
      String dnsName
      The host name as an RFC-5321 domain name or address-literal.
      int port  
    • Constructor Summary

      Constructors 
      Constructor Description
      MtaAddress​(String dnsName, java.net.InetAddress address)
      Constructs a new MtaAddress with the default port, which is 25.
      MtaAddress​(String smtpFormattedHost, java.net.InetAddress address, int port)  
      MtaAddress​(org.xbill.DNS.Name dnsName, java.net.InetAddress address)
      Constructs a new MtaAddress with the default port, which is 25.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(Object obj)  
      int hashCode()  
      String toString()
      Prints the address in a compact form for informational purposes.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • dnsName

        public final String dnsName
        The host name as an RFC-5321 domain name or address-literal. It comes from the content of a DNS MX record or an email address with a literal address part, or a smart host or back-end server name. For example:
        • mail.example.com
        • [192.0.2.0]
        • [IPv6:::1]
      • address

        public final java.net.InetAddress address
        IP address of MTA. It is possible that a domain name in an MX records have multiple A records, therefore a single domain name may refer to multiple MTA servers, and only this address differentiates between them.
      • port

        public final int port
    • Constructor Detail

      • MtaAddress

        public MtaAddress​(String smtpFormattedHost,
                          java.net.InetAddress address,
                          int port)
        Parameters:
        smtpFormattedHost - The host name as an RFC-5321 domain name or address-literal. It comes from the content of a DNS MX record or an email address with a literal address part, or a smart host or back-end server name. For example:
        • mail.example.com
        • [192.0.2.0]
        • [IPv6:::1]
        address - IP address of the MTA
        port - port of the remote MTA
      • MtaAddress

        public MtaAddress​(String dnsName,
                          java.net.InetAddress address)
        Constructs a new MtaAddress with the default port, which is 25. This is the equivalent of calling MtaAddress(String, InetAddress, int) with port 25.
      • MtaAddress

        public MtaAddress​(org.xbill.DNS.Name dnsName,
                          java.net.InetAddress address)
        Constructs a new MtaAddress with the default port, which is 25. This is the equivalent of calling MtaAddress(String, InetAddress, int) with port 25, and with a dnsName converted from the supplied DnsJava Name object by removing the last dot. The trailing dot marks an absolute domain name in DNS - but that syntax is invalid in SMTP.
    • Method Detail

      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • equals

        public boolean equals​(Object obj)
        Overrides:
        equals in class Object
      • toString

        public String toString()
        Prints the address in a compact form for informational purposes.
        Overrides:
        toString in class Object