]> git.ipfire.org Git - people/ms/dma.git/commitdiff
drop the virtusertable support
authorSimon Schubert <2@0x2c.org>
Thu, 22 Apr 2010 14:04:24 +0000 (16:04 +0200)
committerSimon Schubert <2@0x2c.org>
Thu, 22 Apr 2010 14:04:24 +0000 (16:04 +0200)
A better way to set the envelope sender is to use either the -f argument
or to set the EMAIL environment variable.

Makefile.etc
conf.c
dma.8
dma.c
dma.conf
dma.h
virtusertable [deleted file]

index 7965caaf1834479f6301f96e8f314e6848455d1a..fca23b94a6047de02a6584b258192d3a1879611e 100644 (file)
@@ -11,8 +11,5 @@ FILES+=               auth.conf
 .if !exists(${DESTDIR}/etc/dma/dma.conf)
 FILES+=                dma.conf
 .endif
-.if !exists(${DESTDIR}/etc/dma/virtusertable)
-FILES+=                virtusertable
-.endif
 
 .include <bsd.prog.mk>
diff --git a/conf.c b/conf.c
index b676f9ce9209dc9e48eca57364a2e09fa7fc7667..5d177457ee1aa9f6c9eedec4b0c530d07b97472b 100644 (file)
--- a/conf.c
+++ b/conf.c
@@ -84,59 +84,6 @@ chomp(char *str)
                str[len - 1] = 0;
 }
 
-/*
- * Read the virtual user table
- */
-void
-parse_virtuser(const char *path)
-{
-       char line[2048];
-       FILE *v;
-       char *data;
-       struct virtuser *vu;
-       int lineno = 0;
-
-       v = fopen(path, "r");
-       if (v == NULL) {
-               errlog(1, "can not open virtuser file `%s'", path);
-               /* NOTREACHED */
-       }
-
-       while (!feof(v)) {
-               if (fgets(line, sizeof(line), v) == NULL)
-                       break;
-               lineno++;
-
-               chomp(line);
-
-               /* We hit a comment */
-               if (*line == '#')
-                       continue;
-               /* Ignore empty lines */
-               if (*line == 0)
-                       continue;
-
-               vu = calloc(1, sizeof(*vu));
-               if (vu == NULL)
-                       errlog(1, NULL);
-
-               data = strdup(line);
-               vu->login = strsep(&data, DP);
-               vu->address = data;
-
-               if (vu->login == NULL ||
-                   vu->address == NULL) {
-                       errlogx(1, "syntax error in virtuser file %s:%d",
-                               path, lineno);
-                       /* NOTREACHED */
-               }
-
-               SLIST_INSERT_HEAD(&virtusers, vu, next);
-       }
-
-       fclose(v);
-}
-
 /*
  * Read the SMTP authentication config file
  *
@@ -250,8 +197,6 @@ parse_conf(const char *config_path)
                        config.aliases = data;
                else if (strcmp(word, "SPOOLDIR") == 0 && data != NULL)
                        config.spooldir = data;
-               else if (strcmp(word, "VIRTPATH") == 0 && data != NULL)
-                       config.virtualpath = data;
                else if (strcmp(word, "AUTHPATH") == 0 && data != NULL)
                        config.authpath= data;
                else if (strcmp(word, "CERTFILE") == 0 && data != NULL)
@@ -260,8 +205,6 @@ parse_conf(const char *config_path)
                        config.mailname = data;
                else if (strcmp(word, "MAILNAMEFILE") == 0 && data != NULL)
                        config.mailnamefile = data;
-               else if (strcmp(word, "VIRTUAL") == 0 && data == NULL)
-                       config.features |= VIRTUAL;
                else if (strcmp(word, "STARTTLS") == 0 && data == NULL)
                        config.features |= STARTTLS;
                else if (strcmp(word, "SECURETRANSFER") == 0 && data == NULL)
diff --git a/dma.8 b/dma.8
index c8b4f180559854a9f7ded6494ec112f4e1427738..1c0ab676264e04760b027299539e7909d18512a3 100644 (file)
--- a/dma.8
+++ b/dma.8
@@ -135,8 +135,6 @@ can be configured with three config files:
 auth.conf
 .It
 dma.conf
-.It
-virtusertable
 .El
 .Pp
 These three files are stored per default in
@@ -192,22 +190,12 @@ Path to
 .Nm Ap s
 spool directory.
 Just stick with the default.
-.It Ic VIRTPATH Xo
-(string, default=/etc/dma/virtusertable)
-.Xc
-Path to the
-.Sq virtusertable
-file.
 .It Ic AUTHPATH Xo
 (string, default=/etc/dma/auth.conf)
 .Xc
 Path to the
 .Sq auth.conf
 file.
-.It Ic VIRTUAL Xo
-(boolean, default=commented)
-.Xc
-Comment if you want virtual user support.
 .It Ic SECURETRANS Xo
 (boolean, default=commented)
 .Xc
@@ -260,15 +248,6 @@ The name of the file to read the
 .Sq MAILNAME
 from.
 .El
-.Ss virtusertable
-The
-.Pa virtusertable
-file specifies a virtual user table.
-Each line has the format
-.Dq Li localuser:mail-address .
-Some smarthosts do not accept mails from unresolvable email address
-(e.g.\& user@localhost) so you have to rewrite your outgoing email
-address to a valid address.
 .Sh SEE ALSO
 .Xr mailaddr 7 ,
 .Xr mailwrapper 8 ,
diff --git a/dma.c b/dma.c
index 1ddd980946d8ebcdb83d8f2314e3e6440e8595f2..1b823837a268f99ddf558abc1d2689bc68389c85 100644 (file)
--- a/dma.c
+++ b/dma.c
@@ -63,7 +63,6 @@ static void deliver(struct qitem *);
 
 struct aliases aliases = LIST_HEAD_INITIALIZER(aliases);
 struct strlist tmpfs = SLIST_HEAD_INITIALIZER(tmpfs);
-struct virtusers virtusers = LIST_HEAD_INITIALIZER(virtusers);
 struct authusers authusers = LIST_HEAD_INITIALIZER(authusers);
 const char *username;
 const char *logident_base;
@@ -75,7 +74,6 @@ struct config config = {
        .port           = 25,
        .aliases        = "/var/mail/aliases",
        .spooldir       = "/var/spool/dma",
-       .virtualpath    = NULL,
        .authpath       = NULL,
        .certfile       = NULL,
        .features       = 0,
@@ -87,20 +85,8 @@ struct config config = {
 static char *
 set_from(struct queue *queue, const char *osender)
 {
-       struct virtuser *v;
        char *sender;
 
-       if ((config.features & VIRTUAL) != 0) {
-               SLIST_FOREACH(v, &virtusers, next) {
-                       if (strcmp(v->login, username) == 0) {
-                               sender = strdup(v->address);
-                               if (sender == NULL)
-                                       return(NULL);
-                               goto out;
-                       }
-               }
-       }
-
        if (osender) {
                sender = strdup(osender);
                if (sender == NULL)
@@ -487,12 +473,6 @@ skipopts:
 
        parse_conf(CONF_PATH);
 
-       if (config.features & VIRTUAL) {
-               if (config.virtualpath == NULL)
-                       errlogx(1, "no virtuser file specified, but VIRTUAL configured");
-               parse_virtuser(config.virtualpath);
-       }
-
        if (config.authpath != NULL)
                parse_authfile(config.authpath);
 
index 8fdb9a1759f162058e95ae0704fe160acf4248c5..3144de0f3f397f0cf0f707db747809dd3683ccbe 100644 (file)
--- a/dma.conf
+++ b/dma.conf
 # Path to your spooldir.  Just stay with the default.
 #SPOOLDIR /var/spool/dma
 
-# Path to your virtual user file.  Just stay with the default.
-#VIRTPATH /etc/dma/virtusertable
-
 # SMTP authentication
 #AUTHPATH /etc/dma/auth.conf
 
-# Uncomment if you want address rewriting
-#VIRTUAL
-
 # Uncomment if yout want TLS/SSL support
 #SECURETRANSFER
 
diff --git a/dma.h b/dma.h
index ac70b12f062c9d41d7174e5ff059af877e433e4d..a2ee868fa6cfee8a1a1ccba58c61a7b75ec684b4 100644 (file)
--- a/dma.h
+++ b/dma.h
@@ -56,7 +56,6 @@
 #define        SMTP_PORT       25              /* Default SMTP port */
 #define CON_TIMEOUT    120             /* Connection timeout */
 
-#define VIRTUAL                0x001           /* Support for address rewrites */
 #define STARTTLS       0x002           /* StartTLS support */
 #define SECURETRANS    0x004           /* SSL/TLS in general */
 #define NOSSL          0x008           /* Do not use SSL */
@@ -107,7 +106,6 @@ struct config {
        int port;
        const char *aliases;
        const char *spooldir;
-       const char *virtualpath;
        const char *authpath;
        const char *certfile;
        int features;
@@ -119,13 +117,6 @@ struct config {
 };
 
 
-struct virtuser {
-       SLIST_ENTRY(virtuser) next;
-       char *login;
-       char *address;
-};
-SLIST_HEAD(virtusers, virtuser);
-
 struct authuser {
        SLIST_ENTRY(authuser) next;
        char *login;
@@ -148,7 +139,6 @@ struct mx_hostentry {
 extern struct aliases aliases;
 extern struct config config;
 extern struct strlist tmpfs;
-extern struct virtusers virtusers;
 extern struct authusers authusers;
 extern const char *username;
 extern const char *logident_base;
@@ -162,7 +152,6 @@ extern FILE *yyin;
 /* conf.c */
 void trim_line(char *);
 void parse_conf(const char *);
-void parse_virtuser(const char *);
 void parse_authfile(const char *);
 
 /* crypto.c */
diff --git a/virtusertable b/virtusertable
deleted file mode 100644 (file)
index 010c4f7..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-# $DragonFly: src/etc/dma/virtusertable,v 1.1 2008/02/02 18:24:00 matthias Exp $
-#
-# Virtual user table for address rewriting.  If you want to use this file
-# don't forget to uncomment VIRTUAL option in dma.conf.
-#
-# Format: localuser:my-real@email-address.example.com