1.5.0
+ o Add option to copy From: to Reply-To: (Graham Leggett)
o remove contrib/pymime
o remove contrib/foot_filter
o granular access rejection message
The prefix for the Subject: line of mails to the list. This will alter the
Subject: line, and add a prefix if it's not present elsewhere.
+ * replyto (boolean)
+
+ When this file is present, the From: line of mails will be added as a
+ Reply-To: header. This allows the mail to be delivered safely when DMARC
+ protected emails are received from the list.
+
* owner (list)
The emailaddresses in this file (1 pr. line) will get mails to
void getinfo(const char *line, struct mailhdr *readhdrs);
int do_all_the_voodoo_here(int infd, int outfd, int hdrfd, int footfd,
const strlist *delhdrs, struct mailhdr *readhdrs,
- strlist *allhdrs, const char *subjectprefix);
+ strlist *allhdrs, const char *subjectprefix, int replyto);
int do_all_the_voodoo_here(int infd, int outfd, int hdrfd, int footfd,
const strlist *delhdrs, struct mailhdr *readhdrs,
- strlist *allhdrs, const char *prefix)
+ strlist *allhdrs, const char *prefix, int replyto)
{
char *hdrline, *unfolded, *unqp;
bool hdrsadded = false;
if(!delhdrs || !findit(hdrline, delhdrs))
dprintf(outfd, "%s", unfolded);
+ /* Should Reply-To be added? */
+ if(replyto) {
+ if(strncasecmp(hdrline, "From:", 5) == 0) {
+ dprintf(outfd, "Reply-To:%s\n", hdrline + 5);
+ }
+ }
+
free(hdrline);
free(unfolded);
}
int i, opt, moderated = 0, send = 0;
enum modreason modreason;
int hdrfd, footfd, rawmailfd, donemailfd, omitfd;
- bool addr_in_to_or_cc, notmetoo;
+ bool addr_in_to_or_cc, notmetoo, replyto;
bool findaddress = false, intocc = false, noprocess = false;
int maxmailsize = 0;
bool subonlypost, modonlypost, modnonsubposts, foundaddr = false;
subjectprefix = ctrlvalue(ml.ctrlfd, "prefix");
+ replyto = statctrl(ml.ctrlfd, "replyto");
+
if(do_all_the_voodoo_here(rawmailfd, donemailfd, hdrfd, footfd,
delheaders, readhdrs,
- &allheaders, subjectprefix) < 0) {
+ &allheaders, subjectprefix, replyto) < 0) {
log_error(LOG_ARGS, "Error in do_all_the_voodoo_here");
exit(EXIT_FAILURE);
}
}
if(do_all_the_voodoo_here(rawmailfd, donemailfd, -1,
-1, delheaders,
- NULL, &allheaders, NULL) < 0) {
+ NULL, &allheaders, NULL, 0) < 0) {
log_error(LOG_ARGS, "do_all_the_voodoo_here");
exit(EXIT_FAILURE);
}
QUIT\r
EOF
atf_check -o file:expected-5.txt sed -e "/^Message-ID:/d; /^Date:/d;" mail-5.txt
+
+ touch list/control/replyto
+ atf_check -s exit:0 $mlmmjreceive -L list -F <nosubject
+ cat >> expected-6.txt <<EOF
+EHLO heloname\r
+MAIL FROM:<test+bounces-6-user=test@mlmmjtest>\r
+RCPT TO:<user@test>\r
+DATA\r
+From: bob@test\r
+Reply-To: bob@test\r
+To: test@mlmmjtest\r
+Subject: [plop]\r
+\r
+Let's go, first email\r
+myfooter\r
+really\r
+.\r
+MAIL FROM:<test+bounces-6-user2=test@mlmmjtest>\r
+RCPT TO:<user2@test>\r
+DATA\r
+From: bob@test\r
+Reply-To: bob@test\r
+To: test@mlmmjtest\r
+Subject: [plop]\r
+\r
+Let's go, first email\r
+myfooter\r
+really\r
+.\r
+QUIT\r
+EOF
+ atf_check -o file:expected-6.txt sed -e "/^Message-ID:/d; /^Date:/d;" mail-6.txt
}
delheaders_body()