1 /*****************************************************************
2 * Licensed to the Apache Software Foundation (ASF) under one *
3 * or more contributor license agreements. See the NOTICE file *
4 * distributed with this work for additional information *
5 * regarding copyright ownership. The ASF licenses this file *
6 * to you under the Apache License, Version 2.0 (the *
7 * "License"); you may not use this file except in compliance *
8 * with the License. You may obtain a copy of the License at *
9 * *
10 * http://www.apache.org/licenses/LICENSE-2.0 *
11 * *
12 * Unless required by applicable law or agreed to in writing, *
13 * software distributed under the License is distributed on an *
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
15 * KIND, either express or implied. See the License for the *
16 * specific language governing permissions and limitations *
17 * under the License. *
18 ****************************************************************/
19
20
21 package org.apache.james.postage.smtpserver;
22
23 import org.apache.mailet.MailetContext;
24 import org.apache.mailet.Mail;
25 import org.apache.mailet.MailAddress;
26
27 import javax.mail.MessagingException;
28 import javax.mail.internet.MimeMessage;
29 import java.util.Collection;
30 import java.util.Iterator;
31
32 /***
33 * mock-up of MailetContext
34 */
35 public class TrivialMailContext implements MailetContext {
36
37 public void bounce(Mail mail, String message) throws MessagingException {
38
39 }
40
41 public void bounce(Mail mail, String message, MailAddress bouncer) throws MessagingException {
42
43 }
44
45 public Collection getMailServers(String host) {
46 return null;
47 }
48
49 public MailAddress getPostmaster() {
50 return null;
51 }
52
53 public Object getAttribute(String name) {
54 return null;
55 }
56
57 public Iterator getAttributeNames() {
58 return null;
59 }
60
61 public int getMajorVersion() {
62 return 0;
63 }
64
65 public int getMinorVersion() {
66 return 0;
67 }
68
69 public String getServerInfo() {
70 return null;
71 }
72
73 public boolean isLocalServer(String serverName) {
74 return false;
75 }
76
77 public boolean isLocalUser(String userAccount) {
78 return false;
79 }
80
81 public void log(String message) {
82
83 }
84
85 public void log(String message, Throwable t) {
86
87 }
88
89 public void removeAttribute(String name) {
90
91 }
92
93 public void sendMail(MimeMessage msg) throws MessagingException {
94
95 }
96
97 public void sendMail(MailAddress sender, Collection recipients, MimeMessage msg) throws MessagingException {
98
99 }
100
101 public void sendMail(MailAddress sender, Collection recipients, MimeMessage msg, String state) throws MessagingException {
102
103 }
104
105 public void sendMail(Mail mail) throws MessagingException {
106
107 }
108
109 public void setAttribute(String name, Object object) {
110
111 }
112
113 public void storeMail(MailAddress sender, MailAddress recipient, MimeMessage msg) throws MessagingException {
114
115 }
116
117 public Iterator getSMTPHostAddresses(String domainName) {
118 return null;
119 }
120
121
122 public boolean isLocalEmail(MailAddress arg0) {
123 return false;
124 }
125 }
126