0

I am new to web development. I am using James mail server. I created two domains and two users respectively. I am able to send messages to one another and get the messages from 'inbox' folder by the assist of this. I cannot find the way of getting 'sentbox' in the store(I am not sure if there is such folder). There must be another approaches and insights on how to get outbox, draft that James might hold.

Thanks in advance

boburShox
  • 2,630
  • 5
  • 23
  • 35

2 Answers2

1

"sentbox", "outbox", "draft", these are all just regular folders in a mail server. Unlike Inbox, there's nothing special about them. You choose the name of the folder. You create the folder just like any other folder. You store messages in the folder just like any other folder.

Bill Shannon
  • 29,579
  • 6
  • 38
  • 40
  • I got that. But how can I get messages separately, then. For example, I tested getMessages() after getFolder('inbox') returns messages that I received. What about messages I sent. How I can get them. – boburShox Jan 04 '13 at 09:55
  • First you have to "put" them. They don't magically show up anywhere. After you send the message you have to copy the message to a folder. – Bill Shannon Jan 06 '13 at 09:44
  • Thanks @Shannon, you gave the primar understanding on working with Email servers – boburShox Jan 07 '13 at 09:15
  • 1
    One of my colleague has found out that **there is** another default folder other than *inbox* what is called *Sent*. Here is the code: http://grepcode.com/file/repo1.maven.org/maven2/org.apache.james/james-server-mailets/3.0-beta4/org/apache/james/transport/mailets/ToSenderFolder.java#lnml-143. I presume that if you name your folder as *Sent*, Mailet appends your message after sending, and highly likely that you will also append your message to *Sent* folder manually, which indicates double appending! – boburShox Apr 16 '13 at 05:40
0

Your use case is actually common, and there is a standard way to implement it.

It relies on the Mailet configuration. Make your local delivrey not ghosting emails. Then put behind it a ToSenderFolder with a SenderIsLocal matcher to ensure mail is delivered in the sent box. Finnaly ghost emails for local users with the Null mailet and RecipientIsLocalMatcher.

This is not standard as handling this logic is MUA job. However it still is very easy to implement with standard components.

Cheers,

Benoit

Benwa
  • 91
  • 4