You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-user@james.apache.org by Dariusz Luksza <da...@gmail.com> on 2011/05/29 00:34:11 UTC

Sending mails without javax.mail

Hi all!

I would like to include send mail server directly in my java application.
It should starts up with app and should accept programmatically composed
messages without javax.mail (I'm thinking about directly injecting mails
inside James mail queue and send to the recipients).

Is is possible with James smtpserver?
How to startup only smtp server programmatically?
What classes should I use?

Thank you in advance for any hints

-- 
Best regards

GSM: +48 695 192 160
Blog: http://luksza.org
LinkedIn: http://www.linkedin.com/in/dariuszluksza

---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: Sending mails without javax.mail

Posted by Eric Charles <er...@apache.org>.
Hi,

Quick answer (short on time) : Let your webapp depend on the jar [1] and 
instanciate a spring context [2] on webapp init and use the 
smtpserver/mailspooler/mailboxmanager/messagemanager beans to interact 
depending on your needs.

See also http://markmail.org/thread/2e4czins6teazzuw for a older 
conversation on this (architecture details have changed).

Tks,
- Eric

[1] 
https://svn.apache.org/repos/asf/james/server/trunk/container-spring/pom.xml

[2] 
https://svn.apache.org/repos/asf/james/server/trunk/container-spring/src/main/config/james/context/james-server-context.xml


On 31/05/2011 13:10, Dariusz Luksza wrote:
> On 05/30/11 11:48, Norman Maurer wrote:
>> Yes, I hope we will once have a replacement which use NIO.
>
> OK, but now, after a little bit of thinking this isn't an issue for me.
> The JAMES server can uses what ever it would like to use to communicate
> with other servers.
>
> I would like to embed JAMES inside my web application and would like to
> communicate directly with it without using SMTP or POP3/IMAP to send
> and receive mails.
>
> What I want to achieve is a integrated system that talks directly to mail
> server using it internals not the defined net protocol (like smtp/pop3).
> I can "hack" james (debug it internal architecture and find places
> that from my point of view are suitable for me), but such process is
> error prone and consume lots of time. Other solution is just ask the
> developers (and this is my current approach ;))
>
> So my questions are still open:
> * how configure and run JAMES programatically (without init scripts) ?
> * how hook inside mail sending process to send mails not connecting
>     to localhost:25
> * same for receiving mails via pop3/imap
>


---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: Sending mails without javax.mail

Posted by Dariusz Luksza <da...@gmail.com>.
On 05/30/11 11:48, Norman Maurer wrote:
> Yes, I hope we will once have a replacement which use NIO.

OK, but now, after a little bit of thinking this isn't an issue for me.
The JAMES server can uses what ever it would like to use to communicate
with other servers.

I would like to embed JAMES inside my web application and would like to
communicate directly with it without using SMTP or POP3/IMAP to send
and receive mails.

What I want to achieve is a integrated system that talks directly to mail
server using it internals not the defined net protocol (like smtp/pop3).
I can "hack" james (debug it internal architecture and find places
that from my point of view are suitable for me), but such process is
error prone and consume lots of time. Other solution is just ask the
developers (and this is my current approach ;))

So my questions are still open:
* how configure and run JAMES programatically (without init scripts) ?
* how hook inside mail sending process to send mails not connecting
   to localhost:25
* same for receiving mails via pop3/imap

-- 
Best regards

GSM: +48 695 192 160
Blog: http://luksza.org
LinkedIn: http://www.linkedin.com/in/dariuszluksza

---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: Sending mails without javax.mail

Posted by Norman Maurer <no...@googlemail.com>.
Yes, I hope we will once have a replacement which use NIO.

Bye,
Norman


2011/5/30 Dariusz Luksza <da...@gmail.com>:
> On 05/30/11 10:35, Norman Maurer wrote:
>> JAMES use javax.mail under the hood so you will still use it ;) But I
>> guess you just want to pipe emails into james via "telnet" right ?
>
> So you are saying that JAMES uses javax.mail to deliver mails between
> servers?
>
> --
> Best regards
>
> GSM: +48 695 192 160
> Blog: http://luksza.org
> LinkedIn: http://www.linkedin.com/in/dariuszluksza
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
> For additional commands, e-mail: server-user-help@james.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: Sending mails without javax.mail

Posted by Dariusz Luksza <da...@gmail.com>.
On 05/30/11 10:35, Norman Maurer wrote:
> JAMES use javax.mail under the hood so you will still use it ;) But I
> guess you just want to pipe emails into james via "telnet" right ?

So you are saying that JAMES uses javax.mail to deliver mails between
servers?

-- 
Best regards

GSM: +48 695 192 160
Blog: http://luksza.org
LinkedIn: http://www.linkedin.com/in/dariuszluksza

---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: Sending mails without javax.mail

Posted by Norman Maurer <no...@googlemail.com>.
Hi there,

JAMES use javax.mail under the hood so you will still use it ;) But I
guess you just want to pipe emails into james via "telnet" right ?

Bye,
Norman


2011/5/29 Dariusz Luksza <da...@gmail.com>:
> Hi all!
>
> I would like to include send mail server directly in my java application.
> It should starts up with app and should accept programmatically composed
> messages without javax.mail (I'm thinking about directly injecting mails
> inside James mail queue and send to the recipients).
>
> Is is possible with James smtpserver?
> How to startup only smtp server programmatically?
> What classes should I use?
>
> Thank you in advance for any hints
>
> --
> Best regards
>
> GSM: +48 695 192 160
> Blog: http://luksza.org
> LinkedIn: http://www.linkedin.com/in/dariuszluksza
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
> For additional commands, e-mail: server-user-help@james.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org