Displaying 1 result from an estimated 1 matches for "login_protocol".
2007 Nov 14
1
libwrap-ing IMAP and POP logins
...ocal_port;
struct client *client;
int fd;
+#ifdef LIBWRAP
+ struct request_info req;
+ char daemon[13] = "dovecot-";
+#endif
fd = net_accept(LOGIN_LISTEN_FD, &remote_ip, &remote_port);
if (fd < 0) {
@@ -77,6 +88,17 @@
return;
}
+#ifdef LIBWRAP
+ strlcat(daemon, login_protocol, sizeof(daemon));
+ request_init(&req, RQ_DAEMON, daemon, RQ_FILE, fd, NULL);
+ fromhost(&req);
+ if (!hosts_access(&req)) {
+ i_info("libwrap: access denied");
+ net_disconnect(fd);
+ return;
+ }
+#endif
+
if (net_getsockname(fd, &local_ip, &local_port) < 0) {...