⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 _changes in synapse needed to work with simail.txt

📁 siMail, siMail, siMail, siMail
💻 TXT
字号:
replace
#  for n := 0 to FHeaders.Count -1 do
#  begin
#  ...
#  ...
#      Flines.Add(t);
#    until s = '';
#  end;

with
# FLines.Assign(FHeaders);

unit: mimepart.pas
class: TMIMEPart

add published property
#    property ContentLocation:String read FContentLocation write FContentLocation;

in procedure Clear add
#  FContentLocation := '';

in procedure DecodePart change
#  if FPrimaryCode = MP_TEXT then
to
#  (* charcter set in html message part DOESN'T need to be converted
#     because html engine decodes it. Also decoding any html message
#     send from mozilla, pocomail, outlook, outlook express, foxmail
#     is not shown correctly if decoded.
#  if (FPrimaryCode = MP_TEXT) and (FSecondary <> 'HTML') then


replace DecodePartHeader procedure with this one
I've got messages which had a part of header in next line
but without whitespace.

#------------------#
procedure TMIMEPart.DecodePartHeader;
var
  n: integer;
  s, su, fn: string;
  st, st2: string;
  t: string;
begin
  Primary := 'text';
  FSecondary := 'plain';
  FDescription := '';
  Charset := FDefaultCharset;
  FFileName := '';
  Encoding := '7BIT';
  FDisposition := '';
  FContentID := '';
  fn := '';
  for n := 0 to FHeaders.Count - 1 do
    if FHeaders[n] <> '' then
    begin
      s := FHeaders[n];
      su := UpperCase(s);
      if Pos('CONTENT-TYPE:', su) = 1 then
      begin
        st := Trim(SeparateRight(su, ':'));
        st2 := Trim(SeparateLeft(st, ';'));
        Primary := Trim(SeparateLeft(st2, '/'));
        FSecondary := Trim(SeparateRight(st2, '/'));
        if (FSecondary = Primary) and (Pos('/', st2) < 1) then
          FSecondary := '';
        case FPrimaryCode of
          MP_TEXT:
            begin
              Charset := UpperCase(GetParameter(s, 'charset'));
              if (Charset = '') and (n <> FHeaders.Count - 1) then begin //try next line just in case
                t := FHeaders[n+1];
                Charset := UpperCase(GetParameter(t, 'charset'));
              end;
              FFileName := GetParameter(s, 'name');
              if (FFileName = '') and (n <> FHeaders.Count - 1) then begin //try next line just in case
                t := FHeaders[n+1];
                FFileName := UpperCase(GetParameter(t, 'name'));
              end;
            end;
          MP_MULTIPART:
            begin
              FBoundary := GetParameter(s, 'Boundary');
              if (FBoundary = '') and (n <> FHeaders.Count - 1) then begin //try next line just in case
                t := FHeaders[n+1];
                FBoundary := GetParameter(t, 'Boundary');
              end;
          end;
          MP_MESSAGE:
            begin
            end;
          MP_BINARY:
            begin
              FFileName := GetParameter(s, 'name');
              if (FFileName = '') and (n <> FHeaders.Count - 1) then begin //try next line just in case
                t := FHeaders[n+1];
                FFileName := GetParameter(t, 'name');
              end;
          end;
        end;
      end;
      if Pos('CONTENT-TRANSFER-ENCODING:', su) = 1 then
        Encoding := Trim(SeparateRight(su, ':'));
      if Pos('CONTENT-DESCRIPTION:', su) = 1 then
        FDescription := Trim(SeparateRight(s, ':'));
      if Pos('CONTENT-LOCATION:', su) = 1 then
        FContentLocation := Trim(SeparateRight(s, ':'));
      if Pos('CONTENT-DISPOSITION:', su) = 1 then
      begin
        FDisposition := SeparateRight(su, ':');
        FDisposition := Trim(SeparateLeft(FDisposition, ';'));
        fn := GetParameter(s, 'FileName');
        if (fn = '') and (n <> FHeaders.Count - 1) then begin //try next line just in case
            t := FHeaders[n+1];
            fn := GetParameter(t, 'FileName');
        end;
      end;
      if Pos('CONTENT-ID:', su) = 1 then
        FContentID := Trim(SeparateRight(s, ':'));
    end;
  if FFileName = '' then
    FFileName := fn;
  FFileName := InlineDecode(FFileName, FTargetCharset);
  FFileName := ExtractFileName(FFileName);
end;
#------------------#

in procedure EncodePartHeader add
#  if FContentLocation <> '' then
#    FHeaders.Insert(0, 'Content-Location: ' + FContentLocation);

after
#  if FContentID <> '' then
#    FHeaders.Insert(0, 'Content-ID: ' + FContentID);

unit: pop3sen.pas
class: TPOP3Send

add published property
#    property ListSize: Integer read  FListSize;

in procedure Create add
#  FListSize := 0;

replace procedure List with (I just added capbility for property ListSize)
#------------------#
function TPOP3Send.List(Value: Integer): Boolean;
var
  s:string;
begin
  Result := False;
  if Value = 0 then
    FSock.SendString('LIST' + CRLF)
  else
    FSock.SendString('LIST ' + IntToStr(Value) + CRLF);
  if ReadResult(False) <> 1 then
    Exit;
  s := SeparateRight(ResultString, '+OK ');
  FListSize := StrToIntDef(SeparateLeft(SeparateRight(s, ' '), ' '), 0);

  Result := True;
end;
#------------------#

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -