# Copyright 2003 Data Helper, Inc. # This program is realeased under the # GNU GENERAL PUBLIC LICENSE Version 2. # See COPYING.GPL for information. # Mark Willcox #################################################################### # Configuration variables: -- Please see the README. # DB_DIR is where the files go. Make sure there's a "/" on the end! DB_DIR = /var/lib/postpop/db/ # POPUSER is the user (and optional group) of the user who owns the mail # directories. If your real users own their mail, supply some unprivileged, # un-shelled user. #POPUSER = popuser:popuser POPUSER = nfsnobody:nfsnobody # DIR_DEPTH is the number of nodes of the IP address that will be prepended # to the file name as directories. You should usually leave this as zero # unless you have a LOT of POP boxes that are accessed from a LOT of different # IP addresses. DIR_DEPTH = 0 # AUTH_LIFE is the number of minutes the SMTP door stays open after a POP # authorization. AUTH_LIFE = 10 # BIN_DIR is where the programs go. BIN_DIR = /bin # If your users own their own Maildirs (the user fields in your # /var/qmail/users/assign files are NOT all the same user), you will # have to setuid postpop and allow all user to run it. You can add # a password to keep them from doing so. This is all described better # in the README file. # This parameter is the name of the file that will contain the password. # It will be owned and readable by the POPUSER. # Leave it empty if you don't want to use a password. #PASSWD= PASSWD=/var/lib/postpop/passwd #################################################################### DEST_POP = postpop SRC_POP = postpop.c DEST_PLOP = properplop SRC_PLOP = properplop.c CFLAGS = -O2 RM = rm -f STRIP = strip CP = cp ECHO = echo CHMOD = chmod CHOWN = chown PERMS = 755 PRIVATE = 400 MKDIR = mkdir -p all: $(DEST_POP) $(DEST_PLOP) install: all -$(STRIP) $(DEST_POP) $(CP) $(DEST_POP) $(BIN_DIR) -$(CHMOD) $(PERMS) $(BIN_DIR)/$(DEST_POP) -$(CHOWN) $(POPUSER) $(BIN_DIR)/$(DEST_POP) -$(STRIP) $(DEST_PLOP) $(CP) $(DEST_PLOP) $(BIN_DIR) -$(CHMOD) $(PERMS) $(BIN_DIR)/$(DEST_PLOP) -$(CHOWN) $(POPUSER) $(BIN_DIR)/$(DEST_PLOP) -$(MKDIR) $(DB_DIR) -$(CHMOD) $(PERMS) $(DB_DIR) -$(CHOWN) $(POPUSER) $(DB_DIR) -if [ '$(PASSWD)' != '' ] ; then \ touch $(PASSWD); \ $(CHOWN) $(POPUSER) $(PASSWD); \ $(CHMOD) $(PRIVATE) $(PASSWD); \ fi @$(ECHO) Installed. $(DEST_POP): $(SRC_POP) -@$(CC) $(CFLAGS) \ -D'PASSWD="$(PASSWD)"' \ -D'IP_DIR="$(DB_DIR)"' \ -D'DIR_DEPTH=($(DIR_DEPTH))' \ -D'AUTH_LIFE=($(AUTH_LIFE)*60)' \ $(SRC_POP) -o $(DEST_POP) $(LDFLAGS) @$(ECHO) $(SRC_POP) compiled. $(DEST_PLOP): $(SRC_PLOP) -@$(CC) $(CFLAGS) \ -D'IP_DIR="$(DB_DIR)"' \ -D'DIR_DEPTH=($(DIR_DEPTH))' \ -D'AUTH_LIFE=($(AUTH_LIFE)*60)' \ $(SRC_PLOP) -o $(DEST_PLOP) $(LDFLAGS) @$(ECHO) $(SRC_PLOP) compiled. clean: $(RM) $(DEST_POP) $(DEST_PLOP)