config->features |= DEFER;
else if (strcmp(word, "INSECURE") == 0)
config->features |= INSECURE;
+ else if (strcmp(word, "FULLBOUNCE") == 0)
+ config->features |= FULLBOUNCE;
}
}
.Fl q
option.
This option is handy if you are behind a dialup line.
+.It Ic FULLBOUNCE Xo
+(boolean, default=commented)
+.Xc
+Uncomment if you want the bounce message to include the complete original
+message, not just the headers.
.El
.Ss virtusertable
The
struct queue bounceq;
struct qitem *bit;
char line[1000];
+ size_t pos;
int error;
/* Don't bounce bounced mails */
\n\
%s\n\
\n\
-Message headers follow.\n\
+%s\n\
\n\
",
bounceq.id,
rfc822date(),
VERSION, hostname(),
it->addr,
- reason);
+ reason,
+ config->features & FULLBOUNCE? "Original message follows.":
+ "Message headers follow.");
free(reason);
if (error < 0)
goto fail;
if (fseek(it->queuef, it->hdrlen, SEEK_SET) != 0)
goto fail;
- while (!feof(it->queuef)) {
- if (fgets(line, sizeof(line), it->queuef) == NULL)
- break;
- if (line[0] == '\n')
- break;
- if ((size_t)write(bounceq.mailfd, line, strlen(line)) != strlen(line))
- goto fail;
+ if (config->features & FULLBOUNCE) {
+ while ((pos = fread(line, 1, sizeof(line), it->queuef)) > 0) {
+ if ((size_t)write(bounceq.mailfd, line, pos) != pos)
+ goto fail;
+ }
+ } else {
+ while (!feof(it->queuef)) {
+ if (fgets(line, sizeof(line), it->queuef) == NULL)
+ break;
+ if (line[0] == '\n')
+ break;
+ if ((size_t)write(bounceq.mailfd, line, strlen(line)) != strlen(line))
+ goto fail;
+ }
}
if (fsync(bounceq.mailfd) != 0)
goto fail;
#define NOSSL 0x008 /* Do not use SSL */
#define DEFER 0x010 /* Defer mails */
#define INSECURE 0x020 /* Allow plain login w/o encryption */
+#define FULLBOUNCE 0x040 /* Bounce the full message */
#define CONF_PATH "/etc/dma/dma.conf" /* Default path to dma.conf */