diff options
author | Jacek Masiulaniec <jacekm@cvs.openbsd.org> | 2009-01-28 18:10:20 +0000 |
---|---|---|
committer | Jacek Masiulaniec <jacekm@cvs.openbsd.org> | 2009-01-28 18:10:20 +0000 |
commit | 68114201e212db1a07f7ced205d25dd66ab2a8aa (patch) | |
tree | ff0c83661369fe44031f2e956ff84a04308f2165 /usr.sbin/smtpd/smtp_session.c | |
parent | cba1f56c98b7e77645cc402548b86d10a80efa19 (diff) |
reuse recipient_to_path; ok gilles@
Diffstat (limited to 'usr.sbin/smtpd/smtp_session.c')
-rw-r--r-- | usr.sbin/smtpd/smtp_session.c | 31 |
1 files changed, 2 insertions, 29 deletions
diff --git a/usr.sbin/smtpd/smtp_session.c b/usr.sbin/smtpd/smtp_session.c index 0298da84b77..5055386dec9 100644 --- a/usr.sbin/smtpd/smtp_session.c +++ b/usr.sbin/smtpd/smtp_session.c @@ -1,4 +1,4 @@ -/* $OpenBSD: smtp_session.c,v 1.42 2009/01/28 17:29:11 jacekm Exp $ */ +/* $OpenBSD: smtp_session.c,v 1.43 2009/01/28 18:10:19 jacekm Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org> @@ -966,40 +966,13 @@ int session_set_path(struct path *path, char *line) { size_t len; - char *username; - char *hostname; len = strlen(line); if (*line != '<' || line[len - 1] != '>') return 0; line[len - 1] = '\0'; - username = line + 1; - hostname = strchr(username, '@'); - - if (username[0] == '\0') { - *path->user = '\0'; - *path->domain = '\0'; - return 1; - } - - if (hostname == NULL) { - if (strcasecmp(username, "postmaster") != 0) - return 0; - hostname = "localhost"; - } else { - *hostname++ = '\0'; - } - - if (strlcpy(path->user, username, sizeof(path->user)) - >= MAX_LOCALPART_SIZE) - return 0; - - if (strlcpy(path->domain, hostname, sizeof(path->domain)) - >= MAX_DOMAINPART_SIZE) - return 0; - - return 1; + return recipient_to_path(path, line + 1); } void |