No X-UIDL header found

The following mailman methods use the X-UIDL email header as the means to identify the email to be downloaded or deleted from a POP3 server:

GetFullEmail
DeleteEmail
DeleteBundle

If no X-UIDL header is found within the email, then it is not possible to determine the sequence number of the email to be downloaded or deleted. (POP3 commands to fetch or delete an email require a sequence number. The sequence number is unique only to the POP3 session. The POP3 UIDL command is used to get a list of UIDLs and their corresponding sequence numbers — allowing a UIDL to be mapped to a sequence number. The methods listed above use the X-UIDL header field value to find the sequence number to be deleted.)

Exchange Server Unencrypted Login/Password w/ POP3

Question:
We are currently using Chilkat to retrieve e-mail for a number of our applications.

A client of ours has updated their exchange mail server and they have disabled the pop3 service because of authentication issues (the user/password is sent unencrypted and would be a threat). Are there any other possibilities within the scope of chilkat to retrieve mail from an Exchange Server without these drawbacks?

Answer:
Your client may enable POP3 w/ SSL/TLS on the Exchange Server. POP3 over SSL/TLS is secure and the password is passed over a TLS encrypted channel. The standard port for POP3 over SSL/TLS is 995, and Chilkat fully supports it.

POP3 SSH Tunneling (Port Forwarding)

ASP: POP3 SSH Tunneling (Port Forwarding)
SQL Server: POP3 SSH Tunneling (Port Forwarding)
C#: POP3 SSH Tunneling (Port Forwarding)
C++: POP3 SSH Tunneling (Port Forwarding)
MFC: POP3 SSH Tunneling (Port Forwarding)
C: POP3 SSH Tunneling (Port Forwarding)
Delphi: POP3 SSH Tunneling (Port Forwarding)
Visual FoxPro: POP3 SSH Tunneling (Port Forwarding)
Java: POP3 SSH Tunneling (Port Forwarding)
Perl: POP3 SSH Tunneling (Port Forwarding)
PHP: POP3 SSH Tunneling (Port Forwarding)
Python: POP3 SSH Tunneling (Port Forwarding)
Ruby: POP3 SSH Tunneling (Port Forwarding)
VB.NET: POP3 SSH Tunneling (Port Forwarding)
Visual Basic: POP3 SSH Tunneling (Port Forwarding)
VBScript: POP3 SSH Tunneling (Port Forwarding)

POP3 Headers and Attachment Info

The POP3 protocol is not very feature rich. To download an email “header” the POP3 client must issue a “TOP” command. The following text is from RFC 1939 and describes the response to the TOP command:

...
After the initial +OK, the
POP3 server sends the headers of the message, the blank
line separating the headers from the body, and then the
number of lines of the indicated message's body, being
careful to byte-stuff the termination character (as with
all multi-line responses).
...

What this means is that the response will contain the N raw lines following the email header. An email with attachments is typically a multipart/mixed email and therefore the lines following the initial MIME header are the MIME sub-headers and sub-header bodies. For example, consider the following email which contains 3 GIF image attachments:

MIME-Version: 1.0
Date: Tue, 04 Nov 2008 14:54:33 -0600
Message-ID: <CHILKAT-MID-1adb0da5-2646-edac-1f79-9e288b0677ac@CK2007>
X-Mailer: Chilkat Software Inc (http://www.chilkatsoft.com)
X-Priority: 3 (Normal)
Subject: This is a test
From: "Support" <support@something-123.com>
Return-Path: support@something-123.com
To: "Admin" <admin@something-123.com>
Content-Type: multipart/mixed;
	boundary="-----_chilkat_5ad_e1df_7b63f7c5.559182f3_.MIX"

This is a multi-part message in MIME format.

-------_chilkat_5ad_e1df_7b63f7c5.559182f3_.MIX
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

This is line 1
This is line 2
This is line 3
This is line 4
This is line 5
This is line 6
This is line 7
This is line 8
This is line 9

-------_chilkat_5ad_e1df_7b63f7c5.559182f3_.MIX
Content-Type: image/gif;
	name="small1.gif"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
	 filename="small1.gif"

R0lGODlhFAAUAJH/AP///wD/PACLIQAAACwAAAAAFAAUAEACFoyPqcvtLoaclL6Ls968+w+G
4kiWYwEAOw==

-------_chilkat_5ad_e1df_7b63f7c5.559182f3_.MIX
Content-Type: image/gif;
	name="small2.gif"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
	 filename="small2.gif"

R0lGODlhFAAUAJH/AP///wD/PACLIQAAACwAAAAAFAAUAEACFoyPqcvtLoaclL6Ls968+w+G
4kiWYwEAOw==

-------_chilkat_5ad_e1df_7b63f7c5.559182f3_.MIX
Content-Type: image/gif;
	name="small3.gif"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
	 filename="small3.gif"

R0lGODlhFAAUAJH/AP///wD/PACLIQAAACwAAAAAFAAUAEACFoyPqcvtLoaclL6Ls968+w+G
4kiWYwEAOw==

-------_chilkat_5ad_e1df_7b63f7c5.559182f3_.MIX--

A POP3 server would respond to a “TOP 25” lines command by sending the following:
(The line numbers enclosed in parentheses are not actually included in the POP3 server’s response)

MIME-Version: 1.0
Date: Tue, 04 Nov 2008 14:54:33 -0600
Message-ID: <CHILKAT-MID-1adb0da5-2646-edac-1f79-9e288b0677ac@CK2007>
X-Mailer: Chilkat Software Inc (http://www.chilkatsoft.com)
X-Priority: 3 (Normal)
Subject: This is a test
From: "Support" <support@something-123.com>
Return-Path: support@something-123.com
To: "Admin" <admin@something-123.com>
Content-Type: multipart/mixed;
	boundary="-----_chilkat_5ad_e1df_7b63f7c5.559182f3_.MIX"

(1)This is a multi-part message in MIME format.
(2)
(3)-------_chilkat_5ad_e1df_7b63f7c5.559182f3_.MIX
(4)Content-Type: text/plain
(5)Content-Transfer-Encoding: quoted-printable
(6)
(7)This is line 1
(8)This is line 2
(9)This is line 3
(10)This is line 4
(11)This is line 5
(12)This is line 6
(13)This is line 7
(14)This is line 8
(15)This is line 9
(16)
(17)-------_chilkat_5ad_e1df_7b63f7c5.559182f3_.MIX
(18)Content-Type: image/gif;
(19)	name="small1.gif"
(20)Content-Transfer-Encoding: base64
(21)Content-Disposition: attachment;
(22)	 filename="small1.gif"
(23)
(24)R0lGODlhFAAUAJH/AP///wD/PACLIQAAACwAAAAAFAAUAEACFoyPqcvtLoaclL6Ls968+w+G
(25)4kiWYwEAOw==

The POP3 client has no knowledge of the attachments following the 1st 25 lines. The POP3 client, if it’s able to parse the prematurely chopped-off MIME, may have knowledge of attachments that might have been included in the response (it would depend on how good the MIME parser is capable of dealing with prematurely terminated MIME). You can see that no matter how many header lines are retrieved, you can never be sure of receiving all the attachments (or even knowing about them) unless the entire email is downloaded. For example, you could have an email with two attachments — one very large one and one very small one. If the small one follows the large one, you’ll never see it unless you download the full contents of the large attachment to get at the small attachment that follows…

-ERR Mailbox Locked

If you see this error when trying to login to a POP3 server, it most likely means that the server is only allowing a single connection (i.e. session) at a time for each mailbox, and than another user already has mailbox open.  It could also mean that the POP3 administrator temporarily locked the mailbox to prevent access.

No messages in POP3 mailbox?

Question:
I am reading my POP3 mailbox by calling mailman.CopyMail. It returns a bundle object, but the bundle.MessageCount = 0. I know there are emails in the mailbox. What happened?

Answer:
The most common mistake is that you’re looking at your email using a program such as Outlook and your emails have already been downloaded and removed from the POP3 server. After calling CopyMail, check the contents of the mailman’s Pop3SessionLog property — it is a string that may be displayed in your application. You should see the entire conversation between POP3 client (the Chilkat email component) and the POP3 server, including the response from the POP3 server that indicates 0 messages in the mailbox.

UIDL Max Size? (for POP3)

Question:
I’m trying to find out the maximum size of the POP3 UIDL.
I’ve found various POP3 specs, but they dont list field sizes.
Do you know the max size or can you give me any links to this info?

Answer:

(from RFC 1939) The unique-id of a message is an arbitrary server-determined
string, consisting of one to 70 characters in the range 0x21
to 0x7E, which uniquely identifies a message within a
maildrop and which persists across sessions. This
persistence is required even if a session ends without
entering the UPDATE state. The server should never reuse an
unique-id in a given maildrop, for as long as the entity
using the unique-id exists.

IMPORTANT: It has been found that some servers produce longer UIDLs than the max indicated by the POP3 RFC specification. If using a database field to store the UIDL, it’s best to make it 255 chars.

POP3 Change Password Programmatically?

Question:

Is it possible to change the password for a POP3 account or create a POP3 account?

Answer:

Account management is not part of the POP3 protocol and therefore it is not possible to change POP3 passwords programmatically.

POP3 and SMTP multithread-safe?

Question:
Is your component fully threadable? Is it thread safe to use in a multithreaded application?
Does it Supports multiple (simultaneous) connections?

Answer:

Yes, it’s safe for multi-threading. However, you cannot have several threads all trying to share the same POP3 or SMTP session at the same time because they would all interfere with each other — for example, one thread sends a message but another thread receives the response.

This applies to all Chilkat components that communicate with servers: FTP, HTTP, POP3, IMAP, SMTP, etc. the are all thread-safe, but you cannot expect multiple threads to be sending/receiving messages using the same instance of a Chilkat object simultaneously because they would all interfere with each other.

You may achieve multiple (simultaneous) connections by instantiating multiple instances of the mailman object — each would have its own session.

POP3 Sessions w.r.t. New Email and Deleting Email

The POP3 protocol is such that a new session is started after a successful login. The session is a snapshot of the existing emails in the mailbox. Any new email that arrives during the session will not be seen until the session is ended (i.e. you logout) and a new session is started. Also, emails marked for deletion are not actually deleted until the session ends.

If you are writing a program to delete multiple emails, then session management becomes important. If your program loses connection to the POP3 server while marking the Nth email for deletion, then none of the emails will have actually been deleted. (Internally, the POP3 server requires a QUIT command to be sent before the TCP/IP socket disconnect. The Chilkat Pop3EndSession method does this.)

The mailman.ImmediateDelete property controls whether the POP3 session is automatically ended and re-established in each of the various delete methods. If set to false, then the POP3 session remains open after each email is marked for delete. This is more efficient when marking many emails for deletion, but your code will need to recover appropriately if a connection is lost before marking the last email for deletion and cleanly closing the POP3 session.