Skip to content
This repository has been archived by the owner on Feb 8, 2018. It is now read-only.

Commit

Permalink
Move to old-code
Browse files Browse the repository at this point in the history
svn path=/old-code/; revision=156225
  • Loading branch information
migueldeicaza committed Apr 27, 2010
1 parent d27dce8 commit 5910f16
Show file tree
Hide file tree
Showing 12 changed files with 684 additions and 0 deletions.
6 changes: 6 additions & 0 deletions net-pop3/ChangeLog
@@ -0,0 +1,6 @@
2006-07-14 Zac Bowling <zac@zacbowling.com>
src/POP3Connect.cs: Patch from Lars Brubaker

2005-03-19 Zac Bowling <zac@zacbowling.com>

* * : Intial commit of Mono.Net.POP3
21 changes: 21 additions & 0 deletions net-pop3/MIT.X11
@@ -0,0 +1,21 @@
Copyright (c) 2005 Zac Bowling, Ximian, Inc and the individuals listed
on the ChangeLog entries.

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
15 changes: 15 additions & 0 deletions net-pop3/Makefile
@@ -0,0 +1,15 @@
CSC=mcs
#PROGFILES=`cygpath \`cygpath -m -s "$(PROGRAMFILES)"\``
#CSC=$(PROGFILES)/Mono-1.1.3/bin/mcs.bat /d:WIN32
#ROOT=/cygdrive/$(subst \,/,$(subst :\,/,$(SYSTEMROOT)))
#CSC=$(ROOT)/microsoft.net/framework/v1.1.4322/csc.exe /d:WIN32 /optimize+

default:
$(CSC) /target:library ./src/POP3Connection.cs ./src/POP3Message.cs ./src/AssemblyInfo.cs /out:Mono.Net.POP3.dll
$(CSC) /target:exe ./samples/GetLastMessage.cs /r:Mono.Net.POP3.dll /out:./GetLastMessage.exe
$(CSC) /target:exe ./samples/ListSubjects.cs /r:Mono.Net.POP3.dll /out:./ListSubjects.exe
$(CSC) /target:exe ./samples/ListIDs.cs /r:Mono.Net.POP3.dll /out:./ListIDs.exe
$(CSC) /target:exe ./samples/LastMessageHeaders.cs /r:Mono.Net.POP3.dll /out:./LastMessageHeaders.exe

clean:
rm Mono.Net.POP3.dll GetLastMessage.exe ListIDs.exe ListSubjects.exe LastMessageHeaders.exe
Binary file added net-pop3/Mono.Net.Pop3.snk
Binary file not shown.
24 changes: 24 additions & 0 deletions net-pop3/README
@@ -0,0 +1,24 @@
Mono.Net.POP3
Copyright 2005(C) Zac Bowling
zac@zacbowling.com
http://zacbowling.com

Licenced under the terms of the MIT X11 licence.
Read the MIT.X11 for more information.

FEATURES:
* List support
* Top support with full message fall back.
* Decodes headers and messages for you.
* Delete support
* Lots of nice helper functions
* On-demand connection ablity
* Really simpile and lightweight
* Uses nothing more then System.Net

KNOWN ISSUE:
* None so far :-)

SAMPLES:
All of the samples are in the following syntax.
> mono <sample>.exe <username> <password> <server IP/Hostname>
Expand Down
31 changes: 31 additions & 0 deletions net-pop3/samples/GetLastMessage.cs
@@ -0,0 +1,31 @@
using System;
using System.Net;
using Mono.Net.POP3;

namespace Mono.Net.POP3.Samples
{
public class Test1
{
public static void Main(string[] args)
{
POP3Connection mails = new POP3Connection(
args[0], args[1], args[2]);
mails.Open();
short messcount = mails.MessageCount();
Console.WriteLine("MESSAGES COUNT: {0}",messcount);

short[] q = mails.List();
POP3Message msg = mails.Retr(q[q.GetUpperBound(0)]);

Console.WriteLine("MESSAGE TO:\t {0}", msg.To);
Console.WriteLine("MESSAGE FROM:\t {0}", msg.From);
Console.WriteLine("MESSAGE SUBJECT: {0}", msg.Subject);
Console.WriteLine("MESSAGE DATE:\t {0}", msg.Date);
Console.WriteLine("--- MESSAGE ---\n {0}", msg.Message);

mails.Close();

}
}
}

29 changes: 29 additions & 0 deletions net-pop3/samples/LastMessageHeaders.cs
@@ -0,0 +1,29 @@
using System;
using System.Net;
using Mono.Net.POP3;
using System.Collections;
using System.Collections.Specialized;

namespace Mono.Net.POP3.Samples
{
public class Test1
{
public static void Main(string[] args)
{
POP3Connection mails = new POP3Connection(
args[0], args[1], args[2]);
mails.Open();
short messcount = mails.MessageCount();
Console.WriteLine("MESSAGES COUNT: {0}",messcount);

short[] q = mails.List();
POP3Message msg = mails.Retr(q[q.GetUpperBound(0)]);
foreach ( DictionaryEntry de in msg.Headers )
Console.WriteLine( "\n***********\n{0}\n-----------\n{1}", de.Key, de.Value );

mails.Close();

}
}
}

27 changes: 27 additions & 0 deletions net-pop3/samples/ListIDs.cs
@@ -0,0 +1,27 @@
using System;
using System.Net;
using Mono.Net.POP3;

namespace Mono.Net.POP3.Samples
{
public class Test2
{
public static void Main(string[] args)
{
POP3Connection mails = new POP3Connection(
args[0], args[1], args[2]);

mails.Open();
int messcount = mails.MessageCount();
Console.WriteLine("MESSAGES COUNT: {0}",messcount);

foreach (short s in mails.List())
Console.WriteLine(s);


mails.Close();

}
}
}

30 changes: 30 additions & 0 deletions net-pop3/samples/ListSubjects.cs
@@ -0,0 +1,30 @@
using System;
using System.Net;
using Mono.Net.POP3;

namespace Mono.Net.POP3.Samples
{
public class Test2
{
public static void Main(string[] args)
{
POP3Connection mails = new POP3Connection(
args[0], args[1], args[2]);

mails.Open();
int messcount = mails.MessageCount();
Console.WriteLine("MESSAGES COUNT: {0}",messcount);

POP3Message[] msgs = mails.GetMessageRange(messcount-21,messcount-1,false);

foreach (POP3Message msg in msgs)
{
Console.WriteLine("{0} \n{1} \n{2} \n\n", msg.From.Trim(), msg.Subject.Trim(), msg.Date.Trim());
}

mails.Close();

}
}
}

6 changes: 6 additions & 0 deletions net-pop3/src/AssemblyInfo.cs
@@ -0,0 +1,6 @@
using System.Reflection;
using System.Runtime.CompilerServices;

[assembly:AssemblyVersion("1.0.0.0")]
[assembly:AssemblyDelaySign(false)]
[assembly:AssemblyKeyFile("Mono.Net.Pop3.snk")]

0 comments on commit 5910f16

Please sign in to comment.