1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
28 #ifndef __com_sun_star_mail_XMailServer_idl__
29 #define __com_sun_star_mail_XMailServer_idl__
31 #ifndef __com_sun_star_uno_XInterface_idl__
32 #include
<com
/sun
/star
/uno
/XInterface.idl
>
35 #ifndef __com_sun_star_mail_XAuthenticator_idl__
36 #include
<com
/sun
/star
/mail
/XAuthenticator.idl
>
39 #ifndef __com_sun_star_mail_XMailMessage_idl__
40 #include
<com
/sun
/star
/mail
/XMailMessage.idl
>
43 #ifndef __com_sun_star_auth_AuthenticationFailedException_idl__
44 #include
<com
/sun
/star
/auth
/AuthenticationFailedException.idl
>
47 #ifndef __com_sun_star_io_AlreadyConnectedException_idl__
48 #include
<com
/sun
/star
/io
/AlreadyConnectedException.idl
>
51 #ifndef __com_sun_star_io_NotConnectedException_idl__
52 #include
<com
/sun
/star
/io
/NotConnectedException.idl
>
55 #ifndef __com_sun_star_io_UnknownHostException_idl__
56 #include
<com
/sun
/star
/io
/UnknownHostException.idl
>
59 #ifndef __com_sun_star_io_NoRouteToHostException_idl__
60 #include
<com
/sun
/star
/io
/NoRouteToHostException.idl
>
63 #ifndef __com_sun_star_io_ConnectException_idl__
64 #include
<com
/sun
/star
/io
/ConnectException.idl
>
67 #ifndef __com_sun_star_lang_IllegalArgumentException_idl__
68 #include
<com
/sun
/star
/lang
/IllegalArgumentException.idl
>
71 #ifndef __com_sun_star_ucb_InteractiveIOException_idl__
72 #include
<com
/sun
/star
/ucb
/InteractiveIOException.idl
>
75 #ifndef __com_sun_star_mail_MailException_idl__
76 #include
<com
/sun
/star
/mail
/MailException.idl
>
79 #ifndef __com_sun_star_mail_SendMailMessageFailedException_idl__
80 #include
<com
/sun
/star
/mail
/SendMailMessageFailedException.idl
>
83 #ifndef __com_sun_star_mail_XConnectionListener_idl__
84 #include
<com
/sun
/star
/mail
/XConnectionListener.idl
>
87 #ifndef __com_sun_star_datatransfer_UnsupportedFlavorException_idl__
88 #include
<com
/sun
/star
/datatransfer
/UnsupportedFlavorException.idl
>
91 module com
{ module sun
{ module star
{ module mail
{
94 Represents a mail server abstraction.
96 @see com::sun::star::mail::XMailMessage
100 interface XMailServer
: ::com
::sun
::star
::uno
::XInterface
{
103 The complete domain name of the mail server.
105 [attribute
, readonly] string Name
;
108 The port number that will be used to connect to the mail server.
109 If no port number has been set the default port number 25 will
112 [attribute
] long Port
;
115 Returns all connection types which are supported by the
116 mail server. Possible connection types are for instance
117 secure connections like 'SSL' or 'TLS'.
120 a sequence of supported connection types.
122 sequence
<string> getSupportedConnectionTypes
();
125 Set the connection type that will be used to connect to the
126 mail server. The supported connection types may be queried
127 using <code>getSupportedConnectionTypes()</code>.
128 If no connection types has explicitly been set the default
129 connection type will be used.
131 @param sConnectionType
132 [in] identifies the connection that should be used to connect
135 @throws com::sun::star::lang::IllegalArgumentException
136 if the provided connection type is not supported.
138 @see getSupportedConnectionTypes
139 @see isConnectionTypeSupported
141 void setConnectionType
([in] string sConnectionType
)
142 raises
(com
::sun
::star
::lang
::IllegalArgumentException
);
145 Allow a client to query if a certain connection type is
148 @param sConnectionType
149 [in] query if a certain connection type is supported.
152 <TRUE/> if the specified connection type is supported.
154 boolean isConnectionTypeSupported
([in] string sConnectionType
);
157 Register a connection listener.
160 [in] a listener that will be informed about connection events.
162 @see com::sun::star::mail::XConnectionListener
164 void addConnectionListener
([in] XConnectionListener xListener
);
167 Unregister a connection listener.
170 [in] a listener that no longer need to be informed about connection events.
172 @see com::sun::star::mail::XConnectionListener
174 void removeConnectionListener
([in] XConnectionListener xListener
);
177 Login a user to the mail server. Only one user may logged in
178 at a time. An attempt to login while another user is logged in
179 causes an exception to be thrown.
181 @param xAuthenticator
182 [in] an interface used to query for the necessary user information
183 needed to login to the mail server.
185 @throws com::sun::star::io::AlreadyConnectedException
186 on a try to connect to an already connect mail server.
188 @throws com::sun::star::io::UnknownHostException
189 usually if the IP address of the mail server could not be
190 determined. Possible causes are a broken network connection,
191 a wrong server name, an unreachable DNS server, etc.
193 @throws com::sun::star::io::NoRouteToHostException
194 if an error occured to connect to the remote mail server.
195 Typically the remote mail server cannot be reach because of an
196 intervening firewall, or if an intermediate router is down,
197 the network connection is broken, etc.
199 @throws com::sun::star::io::ConnectException
200 if an error occured while attempting to connect to the remote
201 mail server. Typically the connection was refused remotely,
202 because the mail server is not listening on the remote address/port.
204 @throws com::sun::star::auth::AuthenticationException
205 if the specified user could not be logged in.
207 @throws com::sun::star::mail::IllegalStateException
208 if a user is currently logged in.
210 @throws com::sun::star::mail::MailException
211 for other errors during login.
213 @see com::sun::star::mail::XAuthenticator
214 @see com::sun::star::io::AlreadyConnectedException
215 @see com::sun::star::io::UnknownHostException
216 @see com::sun::star::io::NoRouteToHostException
217 @see com::sun::star::io::ConnectException
218 @see com::sun::star::auth::AuthenticationException
219 @see com::sun::star::mail::IllegalStateException
220 @see com::sun::star::mail::MailException
222 void connectUser
([in] XAuthenticator xAuthenticator
)
223 raises
(com
::sun
::star
::io
::AlreadyConnectedException
,
224 com
::sun
::star
::io
::UnknownHostException
,
225 com
::sun
::star
::io
::NoRouteToHostException
,
226 com
::sun
::star
::io
::ConnectException
,
227 com
::sun
::star
::auth
::AuthenticationFailedException
,
228 com
::sun
::star
::mail
::MailException
);
231 Logoff the currently logged in user.
233 @throws com::sun::star::mail::MessagingException
234 if errors occur during logoff.
236 void disconnectUser
()
237 raises
(com
::sun
::star
::mail
::MailException
);
240 Returns whether a user is currently logged in to the mail server or not.
243 <TRUE/> if a user is currently logged in to the mail server.
245 boolean isUserConnected
();
248 Send a mail message to its recipients.
250 @throws com::sun::star::io::NotConnectedException
251 if no user is currently connected to the mail server.
253 @throws com::sun::star::mail::SendMailMessageFailedException
254 if the message could not be sent because of invalid recipient
255 addresses. The e-mail addresses of recipients have to conform to
256 <a href="http://www.ietf.org/rfc/rfc822.txt">RFC 822</a>.
258 @throws com::sun::star::mail::MailException
259 is thrown on other errors that may happen during sending.
260 A possible reason may be for instance that a file attachment
261 specified in a mail message could not be found or accessed.
263 @throws com::sun::star::datatransfer::UnsupportedFlavorException
264 is thrown when the body of the mail message is provided in an
265 unsupported mime content type or may be thrown if one of the file
266 attachments specifies an unspupported mime content type.
268 @see com::sun::star::io::NotConnectedExceptionException
269 @see com::sun::star::mail::SendMailMessageFailedException
270 @see com::sun::star::mail::MailException
271 @see com::sun::star::datatransfer::UnsupportedFlavorException
273 void sendMailMessage
([in] XMailMessage xMailMessage
)
274 raises
(com
::sun
::star
::io
::NotConnectedException
, com
::sun
::star
::mail
::SendMailMessageFailedException
, com
::sun
::star
::mail
::MailException
, com
::sun
::star
::datatransfer
::UnsupportedFlavorException
);