aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2006-10-30 17:31:02 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2006-10-30 17:31:02 +0000
commit4c1895c89225c40bec6af7faf5805f9c7572eded (patch)
treebd527dc20733e92c6866fd7e63f67138701821d4 /src/main.c
parent21a4c6fcb8b3b0565bcdf13b227d91636ca1fae0 (diff)
downloadmailfromd-4c1895c89225c40bec6af7faf5805f9c7572eded.tar.gz
mailfromd-4c1895c89225c40bec6af7faf5805f9c7572eded.tar.bz2
(set_mailfrom): Check if value is a valid mail address (or a list thereof)
git-svn-id: file:///svnroot/mailfromd/trunk@703 7a8a7f39-df28-0410-adc6-e0d955640f24
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index 197b90b0..2c377960 100644
--- a/src/main.c
+++ b/src/main.c
@@ -74,7 +74,7 @@ char *portspec = DEFAULT_SOCKET; /* Communication socket specification */
int force_remove; /* Remove local communication socket if it already
exists */
int foreground; /* Stay in foreground */
-char *postmaster_email = "";
+char *postmaster_email = "<>";
unsigned long source_address = INADDR_ANY; /* Source address for TCP
connections */
char *syslog_tag; /* Tag to mark syslog entries with. */
@@ -416,6 +416,19 @@ set_pidfile(void *value)
void
set_mailfrom(void *value)
{
+ int rc;
+ mu_address_t addr;
+
+ /* FIXME-MU: compensate for mailutils deficiency */
+ if (*(char*)value == 0)
+ value = "<>";
+ rc = mu_address_create(&addr, value);
+ if (rc) {
+ mu_error("cannot create address `%s': %s",
+ value, mu_strerror(rc));
+ return;
+ }
+ mu_address_destroy(&addr);
postmaster_email = value;
}

Return to:

Send suggestions and report system problems to the System administrator.