warp

package module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 20, 2021 License: MIT Imports: 8 Imported by: 0

README

(⌒▽  ▽⌒)
\ ▽ ▽ /
|\▽▽/|
|o\/o|
ヽooooノ
 ̄TT ̄
(⌒||⌒)
| ̄ ̄ ̄ ̄ ̄|
|_____|
|    |
|____|

WARP: This is an outbound transparent SMTP proxy.

GitHub Release MIT License Go Documentation codecov



Usage

Proxy:

vagrant@sender:~$ /vagrant/warp -ip 192.168.30.30 -port 10025
2021/01/19 16:17:20 new connection
2021/01/19 16:17:20 remote addr: 192.168.30.40:42516 origin addr: 192.168.30.50:25
2021/01/19 16:17:20 start proxy
2021/01/19 16:17:20 end proxy
2021/01/19 16:17:20 connection closed

Send mail:

vagrant@sender:~$ telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 sender ESMTP Postfix (Ubuntu)
HELO localhost
250 sender
MAIL FROM: root@sender
250 2.1.0 Ok
RCPT TO: root@receiver
250 2.1.5 Ok
DATA
354 End data with <CR><LF>.<CR><LF>
Subject: Yo
From: root@sender
To: root@receiver
This is from proxy.
.
250 2.0.0 Ok: queued as 345FE3E8F8
quit
221 2.0.0 Bye
Connection closed by foreign host.

Received mail:

vagrant@receiver:~$ sudo cat /var/spool/mail/root
From root@sender  Tue Jan 19 16:17:20 2021
Return-Path: <root@sender>
X-Original-To: root@receiver
Delivered-To: root@receiver
Received: from sender (proxy [192.168.30.30])
        by receiver (Postfix) with ESMTPS id 978363E8E4
        for <root@receiver>; Tue, 19 Jan 2021 16:17:20 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
        by sender (Postfix) with SMTP id 345FE3E8F8
        for <root@receiver>; Tue, 19 Jan 2021 16:16:21 +0000 (UTC)
Subject: Yo
From: root@sender
To: root@receiver
Message-Id: <20210119161632.345FE3E8F8@sender>
Date: Tue, 19 Jan 2021 16:16:21 +0000 (UTC)

This is from proxy.

Contribution

  1. Fork (https://github.com/linyows/warp/fork)
  2. Create a feature branch
  3. Commit your changes
  4. Rebase your local changes against the master branch
  5. Run test suite with the go test ./... command and confirm that it passes
  6. Run gofmt -s
  7. Create a new Pull Request

Author

linyows

Documentation

Index

Constants

View Source
const SO_ORIGINAL_DST = 80

Variables

This section is empty.

Functions

This section is empty.

Types

type Pipe

type Pipe struct {
	Src *net.TCPConn
	Dst *net.TCPConn
}

func (*Pipe) Do

func (p *Pipe) Do()

type Server

type Server struct {
	Addr string
	Port int
}

func (*Server) HandleConnection

func (s *Server) HandleConnection(conn *net.TCPConn)

func (*Server) OriginalAddr

func (s *Server) OriginalAddr(conn *net.TCPConn) (*net.TCPAddr, error)

func (*Server) Start

func (s *Server) Start() error

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL