taking related connections to the limit
Hi, I was wondering if netfilter can do the following:
If a packet has dest ip X, dport 110, do a DNAT --to IP Y, record the SRC IP
If a subsequent packet comes into dest IP X, from that SRC IP, --dport 25 from the same IP, DNAT --to IP Y also.
This is to do some work with POP-before-smtp, if you wondered why such a
demented thing would be needed.
John
Quoted 8 lines · John P. Looney
Hi, I was wondering if netfilter can do the following:
If a packet has dest ip X, dport 110, do a DNAT --to IP Y, record the
SRC IP If a subsequent packet comes into dest IP X, from that SRC IP, --dport 25 from the same IP, DNAT --to IP Y also.This is to do some work with POP-before-smtp, if you wondered why such
a demented thing would be needed.
I am not sure whether it can be done or not but remember that they would only have to connect in order to be allowed subsequent access to your SMTP server. netfilter obviously cannot handle authentication for POP3 so will never know whether the user was successful in their connection attempt. Normally, POP before SMTP is based on their username/password being entered successfully to POP, which allows later access to SMTP.
Personally I've always found authenticated SMTP to be a better alternative. It means I can give only selected POP users access to SMTP and also I can give non POP users access, if need be.
Just something so think about, perhaps.
David
Umm, yes I belive you're looking for the "recent" module, a very nice bit of code by Stephen Frost <[email protected]>.
Quoted 11 lines · John P. Looney
Hi, I was wondering if netfilter can do the following:
If a packet has dest ip X, dport 110, do a DNAT --to IP Y, record the SRC IP
If a subsequent packet comes into dest IP X, from that SRC IP, --dport 25 from the same IP, DNAT --to IP Y also.This is to do some work with POP-before-smtp, if you wondered why such a
demented thing would be needed.John
Quoted 2 lines · John P. Looney
If a packet has dest ip X, dport 110, do a DNAT --to IP Y, record the SRC IP
If a subsequent packet comes into dest IP X, from that SRC IP, --dport 25 from the same IP, DNAT --to IP Y also.
You should be able to do something like this with the help of the set extension to remember SRC IP for a while. You will need the help of a little userspace program to time out sessions after a while, but not much more.
Regards
Henrik
Quoted 10 lines · David Cannings
Quoted 8 lines · John P. Looney
Hi, I was wondering if netfilter can do the following:
If a packet has dest ip X, dport 110, do a DNAT --to IP Y, record the
SRC IP If a subsequent packet comes into dest IP X, from that SRC IP, --dport 25 from the same IP, DNAT --to IP Y also.This is to do some work with POP-before-smtp, if you wondered why such
a demented thing would be needed.
Quoted 6 lines
I am not sure whether it can be done or not but remember that they would only have to connect in order to be allowed subsequent access to your SMTP server. netfilter obviously cannot handle authentication for POP3 so will never know whether the user was successful in their connection attempt. Normally, POP before SMTP is based on their username/password being entered successfully to POP, which allows later access to SMTP.
You can actually handle authenticated POP-before-SMTP by having a script run from metalog (or whatever syslogd you like) the checks for the log line when POP authentication is verified and greps the IP of the client, then adding it to ipt_recent's list by writing to it's /proc/net/ipt_recent file. and the nice thing about ipt_recent is that it will let you time-out the SMTP window after a certain period of inactivity.
Quoted 3 lines
Personally I've always found authenticated SMTP to be a better alternative. It means I can give only selected POP users access to SMTP and also I can give non POP users access, if need be.
This is very true... and I agree. A small issue might be configuration of authenticated SMTP on other platforms... like windows... does it even support it? I wouldn't be at all surprised if it didn't. and if it does, I wouldn't be surprised if it dosen't actually work anyway :)
Quoted 4 lines
Just something so think about, perhaps.
David
- Vic M. Condino
Quoted 9 lines · Unit Zero
Quoted 3 lines · David Cannings
Personally I've always found authenticated SMTP to be a better alternative. It means I can give only selected POP users access to SMTP and also I can give non POP users access, if need be.
This is very true... and I agree. A small issue might be configuration of authenticated SMTP on other platforms... like windows... does it even support it? I wouldn't be at all surprised if it didn't. and if it does, I wouldn't be surprised if it dosen't actually work anyway :)
Going more than slightly off topic now but yes, Windows does have it and it does work, even in Outlook Express.
David
On Thu, Mar 04, 2004 at 05:30:54PM -0500, Unit Zero mentioned:
Quoted 2 lines
Umm, yes I belive you're looking for the "recent" module, a very nice bit of code by Stephen Frost <[email protected]>.
I've not seen that in patch-o-matic-20031219.tar.bz2...ah:
Perfect. What I'm trying to do is send pop-before-smtp users to a
different server to standard smtp connections.
John