aboutsummaryrefslogtreecommitdiffstats
path: root/mail/popper
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1998-08-05 06:45:21 +0800
committerache <ache@FreeBSD.org>1998-08-05 06:45:21 +0800
commit8a3d160a06196ffc3020009da38482d29dcdaace (patch)
tree6bbfbd825b16508ac57ea9554e6ee3ec7dbda1cb /mail/popper
parente4468c533407b54c4596d5dab44c17c0c6cf433e (diff)
downloadfreebsd-ports-gnome-8a3d160a06196ffc3020009da38482d29dcdaace.tar.gz
freebsd-ports-gnome-8a3d160a06196ffc3020009da38482d29dcdaace.tar.zst
freebsd-ports-gnome-8a3d160a06196ffc3020009da38482d29dcdaace.zip
add optional youbin support
Diffstat (limited to 'mail/popper')
-rw-r--r--mail/popper/Makefile13
-rw-r--r--mail/popper/files/patch-aa6
-rw-r--r--mail/popper/files/patch-aj62
-rw-r--r--mail/popper/files/sendto.c170
4 files changed, 246 insertions, 5 deletions
diff --git a/mail/popper/Makefile b/mail/popper/Makefile
index 3c1d48fccac5..a7d2fa3ed5e5 100644
--- a/mail/popper/Makefile
+++ b/mail/popper/Makefile
@@ -14,10 +14,14 @@ EXTRACT_SUFX= .tar.Z
MAINTAINER= ache@freebsd.org
+# Set POPD_YOUBIN_SUPPORT variable in the environment to enable
+# youbin support.
#
# If APOP_ONLY variable present in the environment, popper builds
-# with APOP authentification only
+# with APOP authentification only.
#
+# If FULL_POPD_DEBUG variable present in the environment, popper builds
+# with more verbose debugging.
O_DEFS= -DSETPROCTITLE -DKEEP_TEMP_DROP -DBSD44_DBM -DBIND43 \
-DBULLDB -DNONAUTHFILE='\"/etc/ftpusers\"'
@@ -31,12 +35,16 @@ O_DEFS+= -DSKEY
O_DEFS+= -DAPOP_ONLY
.endif
+.if defined(POPD_YOUBIN_SUPPORT)
+O_DEFS+= -DYOUBIN -DCALLED_FROM_POPD
+.endif
+
P_LIBS+= -lmd -lutil
GNU_CONFIGURE= yes
CONFIGURE_ARGS= --enable-apop=${PREFIX}/etc/popper/pop.auth \
--with-apopuid=pop
-.if defined(FULL_POP_DEBUG)
+.if defined(FULL_POPD_DEBUG)
CONFIGURE_ARGS+= --enable-debugging
.endif
CONFIGURE_ENV= LIBS="${P_LIBS}" O_DEFS="${O_DEFS}"
@@ -45,6 +53,7 @@ MAN8= popauth.8 popper.8
post-patch:
$(RM) ${WRKSRC}/md5.h
+ $(CP) ${FILESDIR}/sendto.c ${WRKSRC}
do-install:
cd ${WRKSRC} && \
diff --git a/mail/popper/files/patch-aa b/mail/popper/files/patch-aa
index f98a3959a450..f0e4359a14dd 100644
--- a/mail/popper/files/patch-aa
+++ b/mail/popper/files/patch-aa
@@ -1,5 +1,5 @@
*** Makefile.in.orig Fri Jul 10 03:44:06 1998
---- Makefile.in Sat Jul 18 20:04:20 1998
+--- Makefile.in Wed Aug 5 01:26:01 1998
***************
*** 1,20 ****
! CSRCS = flock.c pop_dele.c pop_dropcopy.c \
@@ -30,7 +30,7 @@
pop_rset.c pop_send.c pop_stat.c pop_updt.c \
pop_user.c pop_xtnd.c pop_xmit.c popper.c \
! pop_bull.c xtnd_xlst.c pop_uidl.c \
-! pop_rpop.c pop_apop.c pop_auth.c
+! pop_rpop.c pop_apop.c pop_auth.c sendto.c
! OBJS = pop_dele.o pop_dropcopy.o \
pop_get_command.o pop_get_subcommand.o pop_init.o \
@@ -39,7 +39,7 @@
pop_rset.o pop_send.o pop_stat.o pop_updt.o \
pop_user.o pop_xtnd.o pop_xmit.o popper.o \
! pop_bull.o xtnd_xlst.o pop_uidl.o \
-! pop_rpop.o pop_apop.o pop_auth.o
+! pop_rpop.o pop_apop.o pop_auth.o sendto.o
DOCS = README pop3.rfc1081 pop3e.rfc1082 popper.8
diff --git a/mail/popper/files/patch-aj b/mail/popper/files/patch-aj
new file mode 100644
index 000000000000..f7a697027080
--- /dev/null
+++ b/mail/popper/files/patch-aj
@@ -0,0 +1,62 @@
+*** pop_updt.c.orig Fri Jul 10 03:44:08 1998
+--- pop_updt.c Wed Aug 5 01:14:24 1998
+***************
+*** 126,131 ****
+--- 126,134 ----
+ mailunlock();
+ #endif
+ }
++ #ifdef YOUBIN
++ sendto_youbin(p->user);
++ #endif
+ return (POP_SUCCESS);
+ }
+
+***************
+*** 328,333 ****
+--- 331,339 ----
+ mailunlock();
+ #endif
+ (void)fclose(p->drop) ;
++ #ifdef YOUBIN
++ sendto_youbin(p->user);
++ #endif
+ #ifdef EDQUOT
+ if (save_errno == EDQUOT)
+ return pop_msg(p, POP_FAILURE,
+***************
+*** 348,353 ****
+--- 354,362 ----
+ mailunlock();
+ #endif
+ (void)fclose(p->drop);
++ #ifdef YOUBIN
++ sendto_youbin(p->user);
++ #endif
+ #ifdef EDQUOT
+ if (save_errno == EDQUOT)
+ return pop_msg(p, POP_FAILURE,
+***************
+*** 452,457 ****
+--- 461,469 ----
+ mailunlock();
+ #endif
+ (void)fclose(p->drop) ;
++ #ifdef YOUBIN
++ sendto_youbin(p->user);
++ #endif
+ #ifdef EDQUOT
+ if (save_errno == EDQUOT)
+ return pop_msg(p, POP_FAILURE,
+***************
+*** 475,480 ****
+--- 487,495 ----
+ #endif
+ (void)fclose(p->drop);
+ }
++ #ifdef YOUBIN
++ sendto_youbin(p->user);
++ #endif
+
+ return(pop_quit(p));
+ }
diff --git a/mail/popper/files/sendto.c b/mail/popper/files/sendto.c
new file mode 100644
index 000000000000..c7783e5df0ae
--- /dev/null
+++ b/mail/popper/files/sendto.c
@@ -0,0 +1,170 @@
+#ifdef YOUBIN
+/*
+ * Program: $RCSfile: sendto.c,v $ $Revision: 4.3 $
+ *
+ * Purpose: Send a message with UDP packet.
+ * Invoked from mh-inc-folder-hook.
+ *
+ * Usage: sendto <host> <service> <message>
+ *
+ * Author: K.Agusa agusa@nuie.nagoya-u.ac.jp
+ * S.Yamamoto yamamoto@nuie.nagoya-u.ac.jp
+ *
+ * Modified: K.Makimura macky@agusa.nuie.nagoya-u.ac.jp
+ *
+ * Date: 1993/07/24
+ * Modified: $Date: 1994/08/01 12:57:38 $
+ *
+ * Copyright: K.Agusa and S.Yamamoto 1993 - 94
+ *
+ * The X Consortium, and any party obtaining a copy of these files from
+ * the X Consortium, directly or indirectly, is granted, free of charge,
+ * a full and unrestricted irrevocable, world-wide, paid up, royalty-free,
+ * nonexclusive right and license to deal in this software and documentation
+ * files (the "Software"), including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+ * of the Software, and to permit persons who receive copies from any such
+ * party to do so. This license includes without limitation a license to do
+ * the foregoing actions under any patents of the party supplying this
+ * software to the X Consortium.
+ */
+
+#ifndef lint
+static char rcsid[] =
+ "$Id: sendto.c,v 4.3 1994/08/01 12:57:38 yamamoto Exp $";
+#endif /* not lint */
+
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/param.h>
+#include <netinet/in.h>
+#include <netdb.h>
+#include <stdio.h>
+
+/*
+ * Platform definitions.
+ */
+
+#if defined(SVR4) && !defined(SYSV)
+#define SYSV
+#endif /* defined(SVR4) && !defined(SYSV) */
+
+/*
+ * For compatibility.
+ */
+
+#ifdef SYSV
+#include <string.h> /* For strchr(). */
+#else /* not SYSV */
+#include <strings.h>
+#if !defined(strchr) && !defined(strrchr)
+#define strchr(str, c) index((str), (c))
+#define strrchr(str, c) rindex((str), (c))
+#endif /* !defined(strchr) && !defined(strrchr) */
+#endif /* not SYSV */
+
+#ifdef SYSV
+#define bzero(dst, len) memset((dst), '\0', (len))
+#define bcopy(src, dst, len) memcpy((dst), (src), (len))
+#endif
+
+static struct sockaddr_in sa; /* Server address. */
+static int sockid; /* Socket Id. */
+static char err_msg[256];
+
+static char *
+udp_init(host, service)
+char *host;
+char *service;
+{
+ struct hostent *hp; /* Result of host name lookup. */
+ struct servent *sp; /* Result of service lookup. */
+
+ if ((hp = gethostbyname(host)) == NULL) {
+ sprintf(err_msg, "No such host: %s", host);
+ return (err_msg);
+ }
+ if ((sp = getservbyname(service, "udp")) == NULL) {
+ sprintf(err_msg, "No such service: %s", service);
+ return (err_msg);
+ }
+ if ((sockid = socket(hp->h_addrtype, SOCK_DGRAM, 0)) < 0) {
+ sprintf(err_msg, "Error in getting socket");
+ return (err_msg);
+ }
+
+ bzero((char *)&sa, sizeof(sa));
+ sa.sin_family = hp->h_addrtype;
+ bcopy((char *)hp->h_addr, (char *)&sa.sin_addr, hp->h_length);
+ sa.sin_port = sp->s_port;
+
+ return ((char *)NULL);
+}
+
+static char *
+udp_send(message)
+char *message;
+{
+ int len;
+
+ len = strlen(message);
+ if (sendto(sockid, message, len, 0, (struct sockaddr *)&sa, sizeof(sa)) != len) {
+ sprintf(err_msg, "Error in sending packet");
+ return (err_msg);
+ }
+ return ((char *)NULL);
+}
+
+#ifndef CALLED_FROM_POPD
+
+void
+main(argc, argv)
+int argc;
+char **argv;
+{
+ char *msg;
+ char *prog_name;
+
+ if ((prog_name = strrchr(argv[0], '/')) != NULL) {
+ prog_name++;
+ } else {
+ prog_name = argv[0];
+ }
+
+ if (argc != 4) {
+ fprintf(stderr, "%s: Usage: sendto <host> <service> <message>\n",
+ prog_name);
+ exit(1);
+ }
+ if ((msg = udp_init(argv[1], argv[2])) != NULL) {
+ fprintf(stderr, "%s: %s\n", prog_name, msg);
+ exit(1);
+ }
+ if ((msg = udp_send(argv[3])) != NULL) {
+ fprintf(stderr, "%s: %s\n", prog_name, msg);
+ exit(1);
+ }
+ exit(0);
+}
+
+#else /* CALLED_FROM_POPD */
+
+#ifndef YOUBINSERVICE
+#define YOUBINSERVICE "biff" /* For patch to popd. */
+#endif /* not YOUBINSERVICE */
+
+void
+sendto_youbin(username)
+char *username;
+{
+ char msg[256];
+
+ if (udp_init("localhost", YOUBINSERVICE) != NULL) {
+ return;
+ }
+ sprintf(msg, "U %s", username);
+ udp_send(msg);
+}
+
+#endif /* CALLED_FROM_POPD */
+#endif /* YOUBIN */