Does an IMAP store always have an INBOX? - jakarta-mail

I'm using JavaMail's IMAP Store.
When opening the inbox, is it safe to assume that the name is always called "INBOX"?
IMAPFolder folder = (IMAPFolder) store.getFolder("INBOX");
Or is the "inbox" name nothing special and on a Swedish IMAP server it could be called "inkorg"?
I guess this same question applies equally to IMAP in general, beyond JavaMail.

Yes. Additionally, according to RFC 3501: INTERNET MESSAGE ACCESS PROTOCOL - VERSION 4rev1, INBOX has a number of special behaviors to boot:
5.1. Mailbox Naming
The case-insensitive mailbox name INBOX is a special name reserved to
mean "the primary mailbox for this user on this server". The
interpretation of all other names is implementation-dependent.
6.3.3. CREATE Command
It is an error to attempt to create INBOX or a mailbox
with a name that refers to an extant mailbox.
6.3.4. DELETE Command
It is an error to attempt to delete INBOX or a
mailbox name that does not exist.
6.3.5. RENAME Command
Renaming INBOX is permitted, and has special behavior. It moves
all messages in INBOX to a new mailbox with the given name,
leaving INBOX empty. If the server implementation supports
inferior hierarchical names of INBOX, these are unaffected by a
rename of INBOX.

Related

Active Directory - RequireSenderAuthenticationEnabled

I am pulling information from our Active Directory... however i am wanting to see which groups are internal or external.
So far on googling it seems that the
RequireSenderAuthenticationEnabled
is the switch to say if it external or extgernal.
What table and field in Active Directory is that information held.
Thanks
Chris
It's the msExchRequireAuthToSendTo attribute.
That attribute defines whether Exchange will reject emails from unauthenticated users.
"Unauthenticated" usually means "coming from outside your network", but not always. If an email is sent from inside your network via SMTP without authentication, it would still be rejected if that attribute is set to TRUE.

What is the difference between IMAPMessage.getUID() and Message-ID header?

What is the difference between these two from java mail perspective? I can see that 2 values are not same for a particular message. So what should I consider an IMAP message's unique id?
If I need to fetch message from an IMAP server corresponding to an unique id, should I use?
MessageIDTerm
or
IMAPFolder.getMessageByUID()
UID is the unique identification number of a email in a IMAP folder. Each mail in a folder is assigned a uid, it is you can say a index maintained by the mail folder. Whereas message-id is a header part of a email.
To understand in a simple term,
UID is a unique number which cannot be duplicated within a folder. If I copy same email twice in a folder, each will have same headers having same message-id but will have a different UID.
Other major difference is,
UID's are assigned by a imap server
MessageId's are set by the email
client.
So it is always better to rely on a UID to extract the email.
Refer : RFC - UID

how to find out wrong email id in mail using java

We will be sending automated emails through a mail box ,we will send an email with two to three emails in TO column and one or more emails in the CC column ,if i have a wrong email in the TO column in that mail box we will get a delivery report that email is wrong i need to write a program such that it will pick up the wrong email id
Start by reading up on JavaMail FAQ and the com.sun.mail.dsn package. The JavaMail Homepage has all of the downloads you'll need.
You could also enable the mail.smtp.reportsuccess property per the documentation:
When sending a message, detailed information on each address that fails is available in an SMTPAddressFailedException chained off the top level SendFailedException that is thrown. In addition, if the mail.smtp.reportsuccess property is set, an SMTPAddressSucceededException will be included in the list for each address that is successful. Note that this will cause a top level SendFailedException to be thrown even though the send was successful.

How do we get App Engine to email an invite to be a developer?

Someone invited me to be a developer on his app. I did not get the email invite?
I have had others invite me and it works (and works well!)
We got around the problem by having an invite sent to another account. That works for now, but I really need the invite to be sent to the correct account.
Gary
The question is borderline off-topic in that it's not usually a programming question, but it comes up so often, from programmers and the customers we support, that I wanted to put an answer here in the hopes that it would be helpful.
I see that it was in your spam folder, which is one of the more common causes of "lost" emails.
In short, when an email is sent from one server, it goes through several other servers and routers on the way to the final user's PC.
Any one of the following conditions could cause a sent email to not reach a recipient:
Blocked Outbound Mail - The sender's company/business/ISP has email scanning software that scans outbound email, and blocks suspicious outbound emails.
Our workplace has this to limit sensitive data being sent out accidentally, to block outbound infected emails sent from infected PCs.
Relay Server Permissions/Configuration - Your code is sending through a relay server that has rules blocking unauthorized use of email relay functionality.
In most shops with good security consciousness, email servers are configured to disallow email relay except for known IP addresses and/or known, explicitly authorized users.
External party blocks the email - The sender's company has been blacklisted.
Blocked Inbound Mail - The receivers company has email scanning software that scans incoming email (similar to #1) to block malicious/non-work related/bad emails from reaching the recipient's inbox.
Receiver's Spam Filtering - The receiver's email inbox has spam mail filtering, which may automatically move the email to a spam folder, delete them, or other action depending on how you have it configured.
Receiver's Inbound Mail Rules - Similar to the above. The recipient may have rules defined that block, delete, or move emails.
Outlook allows this, as do other email clients. Emails can match the patterns set for existing rules and result in false positives that trigger the rule execution.
Human error - the sender sent the email to the wrong email address.
Human error - the recipient accidentally deleted the email and just didn't see it. (You'd be surprised how often I've seen this.)
Bad programming - there was an error sending the email, but the exception handling ignores the error, so nobody ever knows any better.
Only #9 is actually a programming issue, and it's also (in my experience) the least common. Odds are that the problem has nothing to do with code that you'd be writing.
I'm sure there are more, but these are the ones I've seen the most frequently. I'll add as I think of others.

Postfix mail server and thousands of users?

greetings all
I have a postfix mail server that contains many domains
and each domain contains many users (each user has a mailBox)
and I want to handle that when an email comes to any mailBox of any user in all domains do some java code.
any ideas how this could be done ?
If the users have a 'real' system account, you can put a .forward into their home directory that looks like
"|/path/to/your/mail/handling/program"
which would automatically pipe the email to your program when it's received. Otherwise you could tweak the local delivery agent to do it for you.
I got to a solution to forward all the incoming emails to one single mailbox, using postfix with mysql db, and added a thread that runs every 5 seconds to check for new unread emails to that single one mailbox using javamail

Resources