/****************************************************************
 * Licensed to the Apache Software Foundation (ASF) under one   *
 * or more contributor license agreements.  See the NOTICE file *
 * distributed with this work for additional information        *
 * regarding copyright ownership.  The ASF licenses this file   *
 * to you under the Apache License, Version 2.0 (the            *
 * "License"); you may not use this file except in compliance   *
 * with the License.  You may obtain a copy of the License at   *
 *                                                              *
 *   http://www.apache.org/licenses/LICENSE-2.0                 *
 *                                                              *
 * Unless required by applicable law or agreed to in writing,   *
 * software distributed under the License is distributed on an  *
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
 * KIND, either express or implied.  See the License for the    *
 * specific language governing permissions and limitations      *
 * under the License.                                           *
 ****************************************************************/


package org.apache.james.postage.smtpserver;

import org.apache.mailet.MailetContext;
import org.apache.mailet.Mail;
import org.apache.mailet.MailAddress;

import javax.mail.MessagingException;
import javax.mail.internet.MimeMessage;
import java.util.Collection;
import java.util.Iterator;

/**
 * mock-up of MailetContext
 */
public class TrivialMailContext implements MailetContext {

    public void bounce(Mail mail, String message) throws MessagingException {
        // trivial implementation
    }

    public void bounce(Mail mail, String message, MailAddress bouncer) throws MessagingException {
        // trivial implementation
    }

    public Collection getMailServers(String host) {
        return null;  // trivial implementation
    }

    public MailAddress getPostmaster() {
        return null;  // trivial implementation
    }

    public Object getAttribute(String name) {
        return null;  // trivial implementation
    }

    public Iterator getAttributeNames() {
        return null;  // trivial implementation
    }

    public int getMajorVersion() {
        return 0;  // trivial implementation
    }

    public int getMinorVersion() {
        return 0;  // trivial implementation
    }

    public String getServerInfo() {
        return null;  // trivial implementation
    }

    public boolean isLocalServer(String serverName) {
        return false;  // trivial implementation
    }

    public boolean isLocalUser(String userAccount) {
        return false;  // trivial implementation
    }

    public void log(String message) {
        // trivial implementation
    }

    public void log(String message, Throwable t) {
        // trivial implementation
    }

    public void removeAttribute(String name) {
        // trivial implementation
    }

    public void sendMail(MimeMessage msg) throws MessagingException {
        // trivial implementation
    }

    public void sendMail(MailAddress sender, Collection recipients, MimeMessage msg) throws MessagingException {
        // trivial implementation
    }

    public void sendMail(MailAddress sender, Collection recipients, MimeMessage msg, String state) throws MessagingException {
        // trivial implementation
    }

    public void sendMail(Mail mail) throws MessagingException {
        // trivial implementation
    }

    public void setAttribute(String name, Object object) {
        // trivial implementation
    }

    public void storeMail(MailAddress sender, MailAddress recipient, MimeMessage msg) throws MessagingException {
        // trivial implementation
    }

    public Iterator getSMTPHostAddresses(String domainName) {
        return null;  // trivial implementation
    }

    // compatibility with James-trunk
    public boolean isLocalEmail(MailAddress arg0) {
        return false; // trivial implementation
    }
}


@@ -1183,17 +1183,16 @@
 *****/%0A%0A
-%0A
 package 
@@ -1240,108 +1240,78 @@
 ort 
-org.apache.mailet.MailetContext;%0Aimport org.apache.mailet.Mail;%0Aimport org.apache.mailet.MailAddress
+java.util.Collection;%0Aimport java.util.Iterator;%0Aimport java.util.List
 ;%0A%0Ai
@@ -1391,62 +1391,209 @@
 ge;%0A
+%0A
 import 
-java.util.Collection;%0Aimport java.util.Iterator
+org.apache.mailet.LookupException;%0Aimport org.apache.mailet.Mail;%0Aimport org.apache.mailet.MailAddress;%0Aimport org.apache.mailet.MailetContext;%0Aimport org.apache.mailet.TemporaryLookupException
 ;%0A%0A/
@@ -2010,33 +2010,32 @@
     return null;
- 
  // trivial impl
@@ -2105,33 +2105,32 @@
     return null;
- 
  // trivial impl
@@ -2205,33 +2205,32 @@
     return null;
- 
  // trivial impl
@@ -2301,33 +2301,32 @@
     return null;
- 
  // trivial impl
@@ -2387,33 +2387,32 @@
        return 0;
- 
  // trivial impl
@@ -2481,17 +2481,16 @@
 eturn 0;
- 
  // triv
@@ -2563,33 +2563,32 @@
     return null;
- 
  // trivial impl
@@ -2672,33 +2672,32 @@
    return false;
- 
  // trivial impl
@@ -2788,17 +2788,16 @@
 n false;
- 
  // triv
@@ -3196,330 +3196,8 @@
  %7D%0A%0A
-    public void sendMail(MailAddress sender, Collection recipients, MimeMessage msg) throws MessagingException %7B%0A        // trivial implementation%0A    %7D%0A%0A    public void sendMail(MailAddress sender, Collection recipients, MimeMessage msg, String state) throws MessagingException %7B%0A        // trivial implementation%0A    %7D%0A%0A
     
@@ -3634,17 +3634,16 @@
 rn null;
- 
  // triv
@@ -3812,11 +3812,849 @@
 n%0A    %7D%0A
-%7D
 %0A
+    @Override%0A    public List%3CString%3E dnsLookup(String arg0, RecordType arg1) throws TemporaryLookupException, LookupException %7B%0A        // TODO Auto-generated method stub%0A        return null;%0A    %7D%0A%0A    @Override%0A    public void log(LogLevel arg0, String arg1) %7B%0A        // TODO Auto-generated method stub%0A%0A    %7D%0A%0A    @Override%0A    public void log(LogLevel arg0, String arg1, Throwable arg2) %7B%0A        // TODO Auto-generated method stub%0A%0A    %7D%0A%0A    @Override%0A    public void sendMail(MailAddress arg0, Collection%3CMailAddress%3E arg1, MimeMessage arg2) throws MessagingException %7B%0A        // TODO Auto-generated method stub%0A%0A    %7D%0A%0A    @Override%0A    public void sendMail(MailAddress arg0, Collection%3CMailAddress%3E arg1, MimeMessage arg2, String arg3)%0A            throws MessagingException %7B%0A        // TODO Auto-generated method stub%0A%0A    %7D%0A%7D
 %0A

Fix MailContext mock in postage project further to new 2.5.0 version