summaryrefslogtreecommitdiff
path: root/usr.sbin/smtpd/smtpd.h
diff options
context:
space:
mode:
authorEric Faurot <eric@cvs.openbsd.org>2012-08-21 20:19:47 +0000
committerEric Faurot <eric@cvs.openbsd.org>2012-08-21 20:19:47 +0000
commit567cbc2bb44ed7a2c477b0787d4ccd50e8ebecf2 (patch)
tree8e02dd4f4d744ae5e98f189efaab025969f857a8 /usr.sbin/smtpd/smtpd.h
parentaeaaf85fa9a03d459d328e8f93992b1f1d1043b4 (diff)
Allow smtpd to work as a backup MX, relaying only to MXs with higher
priority in the DNS record. For example: accept for domain "foo.org" relay backup "mx3.foo.org" will relay mails for "foo.org" using only hosts with higher priority (i.e. lower value) than "mx3.foo.org", which is supposed to be the current server. If the specified backup MX is not found in the DNS record, relaying works as normal. ok gilles@
Diffstat (limited to 'usr.sbin/smtpd/smtpd.h')
-rw-r--r--usr.sbin/smtpd/smtpd.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/usr.sbin/smtpd/smtpd.h b/usr.sbin/smtpd/smtpd.h
index a30c5269b1f..0bcc8edc7f5 100644
--- a/usr.sbin/smtpd/smtpd.h
+++ b/usr.sbin/smtpd/smtpd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: smtpd.h,v 1.328 2012/08/21 13:13:17 eric Exp $ */
+/* $OpenBSD: smtpd.h,v 1.329 2012/08/21 20:19:46 eric Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org>
@@ -79,6 +79,8 @@
#define F_AUTH 0x04
#define F_SSL (F_SMTPS|F_STARTTLS)
+#define F_BACKUP 0x10 /* XXX */
+
#define F_SCERT 0x01
#define F_CCERT 0x02
@@ -88,6 +90,7 @@
#define ROUTE_SSL (ROUTE_STARTTLS | ROUTE_SMTPS)
#define ROUTE_AUTH 0x04
#define ROUTE_MX 0x08
+#define ROUTE_BACKUP 0x10 /* XXX */
typedef uint32_t objid_t;
@@ -653,12 +656,12 @@ enum dns_status {
struct dns {
uint64_t id;
char host[MAXHOSTNAMELEN];
+ char backup[MAXHOSTNAMELEN];
int port;
int error;
int type;
struct imsgev *asker;
struct sockaddr_storage ss;
- struct dns *next;
};
struct secret {
@@ -733,6 +736,7 @@ struct mta_route {
uint8_t flags;
char *hostname;
+ char *backupname;
uint16_t port;
char *cert;
char *auth;
@@ -954,7 +958,7 @@ struct delivery_backend *delivery_backend_lookup(enum action_type);
/* dns.c */
void dns_query_host(char *, int, uint64_t);
-void dns_query_mx(char *, int, uint64_t);
+void dns_query_mx(char *, char *, int, uint64_t);
void dns_query_ptr(struct sockaddr_storage *, uint64_t);
void dns_async(struct imsgev *, int, struct dns *);