Click here to Skip to main content
15,895,283 members

sending a malformed email from pop3 server

soby asked:

Open original thread
Hey guys,
I am working on a system which receives a corrupted emails blocking the system from pulling emails which get stuck in the mail server. Apparently the bad emails do not end properly. I think according to protocol each email should end with "\r\n.\r\n", however, looks like the malformed emails don't end like I said causing problem with detecting the size which in turn causes reading too much and problem with the next email.

I am not saying exactly that the message itself should be ended with "\r\n.\r\n". I made my question around what I see in the code where it is trying to read (data from bio connection)and detect "\r\n.\r\n". The code, when sees this string, marks the end of buffer with '\0' and returns successfully from the function which is reading the content from socket; otherwise, if it does not find the string prints an error indicating the 'end was not found' and then returns unsuccessful.

I was wondering how can I create and send a malformed email, so I can receive it and debugge our system to see how it is reacting to this problem.

I appreciate any input on how to write a small tool using python, c# or c++ to send such an email.
Thanks,
Tags: C++, C#, Python

Plain Text
ASM
ASP
ASP.NET
BASIC
BAT
C#
C++
COBOL
CoffeeScript
CSS
Dart
dbase
F#
FORTRAN
HTML
Java
Javascript
Kotlin
Lua
MIDL
MSIL
ObjectiveC
Pascal
PERL
PHP
PowerShell
Python
Razor
Ruby
Scala
Shell
SLN
SQL
Swift
T4
Terminal
TypeScript
VB
VBScript
XML
YAML

Preview



When answering a question please:
  1. Read the question carefully.
  2. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  3. If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
  4. Don't tell someone to read the manual. Chances are they have and don't get it. Provide an answer or move on to the next question.
Let's work to help developers, not make them feel stupid.
Please note that all posts will be submitted under the http://www.codeproject.com/info/cpol10.aspx.



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900