de.malowa.greylister
Class SMTPInformation

java.lang.Object
  extended by de.malowa.greylister.SMTPInformation

public class SMTPInformation
extends java.lang.Object

Provides information from the SMTP dialog of a client.


Constructor Summary
SMTPInformation(java.lang.String sender, java.lang.String recipient, java.lang.String ip, java.lang.String hostname, java.lang.String helo)
          Constructs a SMTPInformation consisting of following information:
 
Method Summary
 java.lang.String getClientHost()
          Gets the name of the client.
 java.lang.String getClientIP()
          Gets the IPv4 address of the requesting client
 java.lang.String getClientIP3Byte()
          Return the first 3 byte from the IP of the requesting client including the dots.
 java.lang.String getHelo()
          Returns the string a sender provided for EHLO or HELO during SMTP dialog.
 java.lang.String getRecipient()
          Gets the mail address of the origination recipient.
 java.lang.String getRecipientDomain()
          Gets the domain part of the recipient's mail address.
 java.lang.String getSender()
          Gets the mail address of the sender
 java.lang.String getSenderDomain()
          Gets the domain part of the sender's mail address.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SMTPInformation

public SMTPInformation(java.lang.String sender,
                       java.lang.String recipient,
                       java.lang.String ip,
                       java.lang.String hostname,
                       java.lang.String helo)
Constructs a SMTPInformation consisting of following information:

Parameters:
sender - sender's mail address (MAIL FROM)
recipient - recipient's mail address (RCPT TO)
ip - client's IP
hostname - client's host name
helo - provided EHLO/HELO
Method Detail

getClientIP

public java.lang.String getClientIP()
Gets the IPv4 address of the requesting client

Returns:
IPv4 address in dotted notation

getSender

public java.lang.String getSender()
Gets the mail address of the sender

Returns:
the sender's mail address

getRecipient

public java.lang.String getRecipient()
Gets the mail address of the origination recipient.

Returns:
the recipient's mail address

getHelo

public java.lang.String getHelo()
Returns the string a sender provided for EHLO or HELO during SMTP dialog.

Returns:
the HELO/EHLO name

getSenderDomain

public java.lang.String getSenderDomain()
Gets the domain part of the sender's mail address. If the sender mail address would be 'sender@example.com' it will return 'example.com'. If the address does not contain an (at) the whole sender will be returned.

Returns:
the domain name of the sender

getRecipientDomain

public java.lang.String getRecipientDomain()
Gets the domain part of the recipient's mail address. If the recipient mail address would be 'sender@example.com' it will return 'example.com'. If the address does not contain an (at) the whole recipient will be returned.

Returns:
the domain name of the sender

getClientHost

public java.lang.String getClientHost()
Gets the name of the client. The name was previously resolved via RDNS and therefore is not faked. The function returns unknown if the real host name could not be retrieved.

Returns:
the name of the requesting client

getClientIP3Byte

public java.lang.String getClientIP3Byte()
Return the first 3 byte from the IP of the requesting client including the dots. So for an address of '1.2.3.4' it will return '1.2.3'.

Returns:
first 3 byte of an IPv4-Address

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()