Article delegate-en/2311 of [1-5169] on the server localhost:119
  upper oldest olders older1 this newer1 newers latest
[Top/Up] [oldest] - [Older+chunk] - [Newer+chunk] - [newest + Check]

Newsgroups: mail-lists.delegate-en

[DeleGate-En] transparent POP3 proxy forwarding without the user@host
27 Jun 2003 06:31:06 GMT Edwin Groothuis <>


I need delegate to do pop3 forwarding, without doing to user@host
command, so that we can do virusscanning for all email coming into
our network. To set this up wasn't that much of a problem:

FreeBSD specific ipfw rules:
00500   1165    48039 fwd,8110 tcp from any to any 110 via vmnet1

Or in normal english: forward all packets coming in via interface
vmnet1 towards a popserver to on port 8110. (on which we
have delegate in pop3 mode running).

Add this patch to src/pop3.c:
diff -ru work/delegate8.5.5/src/pop.c work-new/delegate8.5.5/src/pop.c
--- work/delegate8.5.5/src/pop.c	Fri Feb  7 17:09:31 2003
+++ work-new/delegate8.5.5/src/pop.c	Fri Jun 27 16:23:53 2003
@@ -423,6 +423,12 @@
 		if( dp = strrpbrk(user,POP_USERHOST_ESCDELIM) )
 			*dp = '@';
+	} else {
+		char remote[LNSIZE];
+		char temp[LNSIZE];
+		gethostName(ClientSock,remote,PN_HOST);
+		sprintf(temp,"//%s/%s",remote,userhost);
+		strcpy(userhost,temp);
 	opts = CTX_mount_url_to(Conn,NULL,"GET",userhost);
 	if( opts ){

This will cause people who authenticate with "USER blaat" to be
connected to their remote host as user "blaat", even when they don't
have used "USER blaat@remotehost".

This trick will also work under Linux with the proper iptables
statement which I'm don't know.

Please consider accepting this patch into the distribution.


ps. do you have intentions of ever replacing all the strcpy()/sprintf()s
    with strncpy() and snprintf()s?

Edwin Groothuis      |            Personal website:    |    Weblog: 

  admin search upper oldest olders older1 this newer1 newers latest
[Top/Up] [oldest] - [Older+chunk] - [Newer+chunk] - [newest + Check]