* don't use the config to get the hostname anymore, so we don't need to run suid...
authorWilfried Göesgens <willi@citadel.org>
Thu, 26 Apr 2007 22:30:56 +0000 (22:30 +0000)
committerWilfried Göesgens <willi@citadel.org>
Thu, 26 Apr 2007 22:30:56 +0000 (22:30 +0000)
citadel/Makefile.in
citadel/citmail.c
citadel/debian/citadel-mta.postinst

index 9d8e19cea995ca748f1a6d7cb2fc71d0ba35da35..8c29794cbb61cf49358725d6312314c1d9e2a21b 100644 (file)
@@ -152,8 +152,8 @@ citserver: $(SERV_OBJS)
 aidepost: aidepost.o config.o
        $(CC) aidepost.o config.o citadel_dirs.o $(LDFLAGS) -o aidepost $(LIBS)
 
-citmail: citmail.o config.o citadel_dirs.o
-       $(CC) citmail.o config.o citadel_dirs.o $(LDFLAGS) -o citmail $(LIBS)
+citmail: citmail.o citadel_dirs.o
+       $(CC) citmail.o citadel_dirs.o $(LDFLAGS) -o citmail $(LIBS)
 
 # setup does need LIBS defined, because it uses network functions which are in -lsocket -lnsl on Solaris.
 setup: setup.o tools.o citadel_dirs.o
index 09b6c93479614b39e9b52826819d257713cc7ebf..e5e7113782a3043fa660659f5179da6d5404cb1c 100644 (file)
@@ -26,7 +26,6 @@
 #ifndef HAVE_SNPRINTF
 #include "snprintf.h"
 #endif
-#include "config.h"
 #include "citadel_dirs.h"
 
 /* #define DEBUG  */   /* uncomment to get protocol traces */
@@ -161,6 +160,10 @@ void serv_puts(char *buf)
 void cleanup(int exitcode) {
        char buf[1024];
 
+       if (exitcode == 1)
+               printf ("Error while sending mail."
+                       "Check your maildata and make shure "
+                       "citadel is configured properly!");
        serv_puts("QUIT");
        serv_gets(buf);
        exit(exitcode);
@@ -180,19 +183,30 @@ int main(int argc, char **argv) {
        int home=0;
        char relhome[PATH_MAX]="";
        char ctdldir[PATH_MAX]=CTDLDIR;
+       char *sp, *ep;
+              
 
        /* TODO: should we be able to calculate relative dirs? */
        calc_dirs_n_files(relh, home, relhome, ctdldir);
 
-       get_config();
-
        pw = getpwuid(getuid());
 
        fp = tmpfile();
        if (fp == NULL) return(errno);
+       serv_sock = uds_connectsock(file_lmtp_socket);
+       serv_gets(buf);
+       if (buf[0]!='2') cleanup(1);
+
+       sp = strchr (buf, ' ');
+       if (sp == NULL) cleanup(1);
+       sp ++;
+       ep = strchr (sp, ' ');
+       if (ep == NULL) cleanup(1);
+       *ep = '\0';
+
        snprintf(fromline, sizeof fromline, "From: %s@%s",
-               pw->pw_name,
-               config.c_fqdn
+                pw->pw_name,
+                sp
        );
        while (fgets(buf, 1024, stdin) != NULL) {
                if ( ( (buf[0] == 13) || (buf[0] == 10)) && (in_body == 0) ) {
@@ -211,9 +225,6 @@ int main(int argc, char **argv) {
        }
        strip_trailing_nonprint(fromline);
 
-       serv_sock = uds_connectsock(file_lmtp_socket);
-       serv_gets(buf);
-       if (buf[0]!='2') cleanup(1);
 
        serv_puts("LHLO x");
        do {
index 84353c47361954ae0754140f4a856bf96c62603d..e8978e44d802f035a34c929089f4812129d1e89f 100644 (file)
@@ -5,8 +5,6 @@ set -e
 
 case "$1" in
     configure)
-        chown root:citadel /usr/sbin/sendmail
-        chmod 4755 /usr/sbin/sendmail
     ;;
 
     abort-upgrade|abort-remove|abort-deconfigure)