summaryrefslogtreecommitdiff
path: root/mail-mta/netqmail/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /mail-mta/netqmail/files
reinit the tree, so we can have metadata
Diffstat (limited to 'mail-mta/netqmail/files')
-rw-r--r--mail-mta/netqmail/files/1.06-exit.patch18
-rw-r--r--mail-mta/netqmail/files/1.06-fbsd-utmpx.patch64
-rw-r--r--mail-mta/netqmail/files/1.06-readwrite.patch13
-rw-r--r--mail-mta/netqmail/files/genqmail-20080406-ldflags.patch13
-rw-r--r--mail-mta/netqmail/files/qmail-smtputf8.patch242
-rw-r--r--mail-mta/netqmail/files/use-new-path-for-functions.sh.patch11
6 files changed, 361 insertions, 0 deletions
diff --git a/mail-mta/netqmail/files/1.06-exit.patch b/mail-mta/netqmail/files/1.06-exit.patch
new file mode 100644
index 000000000000..e0e7dea0f324
--- /dev/null
+++ b/mail-mta/netqmail/files/1.06-exit.patch
@@ -0,0 +1,18 @@
+Index: netqmail-1.06/qmail-pw2u.c
+===================================================================
+--- netqmail-1.06.orig/qmail-pw2u.c
++++ netqmail-1.06/qmail-pw2u.c
+@@ -1,3 +1,4 @@
++#include <unistd.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include "substdio.h"
+Index: netqmail-1.06/qmail-qmtpd.c
+===================================================================
+--- netqmail-1.06.orig/qmail-qmtpd.c
++++ netqmail-1.06/qmail-qmtpd.c
+@@ -1,3 +1,4 @@
++#include <unistd.h>
+ #include "stralloc.h"
+ #include "substdio.h"
+ #include "qmail.h"
diff --git a/mail-mta/netqmail/files/1.06-fbsd-utmpx.patch b/mail-mta/netqmail/files/1.06-fbsd-utmpx.patch
new file mode 100644
index 000000000000..8500eb53e3ee
--- /dev/null
+++ b/mail-mta/netqmail/files/1.06-fbsd-utmpx.patch
@@ -0,0 +1,64 @@
+--- qbiff.c.orig 2010-04-06 08:43:28.000000000 -0300
++++ qbiff.c 2010-04-06 08:44:35.000000000 -0300
+@@ -1,13 +1,6 @@
+ #include <sys/types.h>
+ #include <sys/stat.h>
+-#include <utmp.h>
+-#ifndef UTMP_FILE
+-#ifdef _PATH_UTMP
+-#define UTMP_FILE _PATH_UTMP
+-#else
+-#define UTMP_FILE "/etc/utmp"
+-#endif
+-#endif
++#include <utmpx.h>
+ #include "readwrite.h"
+ #include "stralloc.h"
+ #include "substdio.h"
+@@ -21,15 +14,12 @@
+ #include "env.h"
+ #include "exit.h"
+
+-substdio ssutmp;
+-char bufutmp[sizeof(struct utmp) * 16];
+-int fdutmp;
+ substdio sstty;
+ char buftty[1024];
+ int fdtty;
+
+-struct utmp ut;
+-char line[sizeof(ut.ut_line) + 1];
++struct utmpx *ut;
++char line[sizeof(ut->ut_line) + 1];
+ stralloc woof = {0};
+ stralloc tofrom = {0};
+ stralloc text = {0};
+@@ -64,7 +54,7 @@
+ if (!(user = env_get("USER"))) _exit(0);
+ if (!(sender = env_get("SENDER"))) _exit(0);
+ if (!(userext = env_get("LOCAL"))) _exit(0);
+- if (str_len(user) > sizeof(ut.ut_name)) _exit(0);
++ if (str_len(user) > sizeof(ut->ut_user)) _exit(0);
+
+ if (!stralloc_copys(&tofrom,"*** TO <")) _exit(0);
+ if (!stralloc_cats(&tofrom,userext)) _exit(0);
+@@ -89,15 +79,11 @@
+ if (!stralloc_cat(&woof,&text)) _exit(0);
+ if (!stralloc_cats(&woof,"\015\n")) _exit(0);
+
+- fdutmp = open_read(UTMP_FILE);
+- if (fdutmp == -1) _exit(0);
+- substdio_fdbuf(&ssutmp,read,fdutmp,bufutmp,sizeof(bufutmp));
+-
+- while (substdio_get(&ssutmp,&ut,sizeof(ut)) == sizeof(ut))
+- if (!str_diffn(ut.ut_name,user,sizeof(ut.ut_name)))
++ while ((ut = getutxent()) != NULL)
++ if (ut->ut_type == USER_PROCESS && !str_diffn(ut->ut_user,user,sizeof(ut->ut_user)))
+ {
+- byte_copy(line,sizeof(ut.ut_line),ut.ut_line);
+- line[sizeof(ut.ut_line)] = 0;
++ byte_copy(line,sizeof(ut->ut_line),ut->ut_line);
++ line[sizeof(ut->ut_line)] = 0;
+ if (line[0] == '/') continue;
+ if (!line[0]) continue;
+ if (line[str_chr(line,'.')]) continue;
diff --git a/mail-mta/netqmail/files/1.06-readwrite.patch b/mail-mta/netqmail/files/1.06-readwrite.patch
new file mode 100644
index 000000000000..a2fbe5fe695e
--- /dev/null
+++ b/mail-mta/netqmail/files/1.06-readwrite.patch
@@ -0,0 +1,13 @@
+diff --git a/readwrite.h b/readwrite.h
+index 2a64968..0a641a3 100644
+--- a/readwrite.h
++++ b/readwrite.h
+@@ -1,7 +1,4 @@
+ #ifndef READWRITE_H
+ #define READWRITE_H
+-
+-extern int read();
+-extern int write();
+-
++#include <unistd.h>
+ #endif
diff --git a/mail-mta/netqmail/files/genqmail-20080406-ldflags.patch b/mail-mta/netqmail/files/genqmail-20080406-ldflags.patch
new file mode 100644
index 000000000000..1eb334c259c1
--- /dev/null
+++ b/mail-mta/netqmail/files/genqmail-20080406-ldflags.patch
@@ -0,0 +1,13 @@
+diff -Nuar genqmail-20080406.orig/spp/Makefile genqmail-20080406/spp/Makefile
+--- genqmail-20080406.orig/spp/Makefile 2008-04-06 15:44:14.000000000 +0000
++++ genqmail-20080406/spp/Makefile 2013-05-27 00:37:58.687763457 +0000
+@@ -14,7 +14,7 @@
+ rm -f $(TARGETS)
+
+ $(RESOLV_OBJS):
+- $(CC) $(CFLAGS) -o $@ $@.c -lresolv
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $@.c -lresolv
+
+ $(SIMPLE_OBJS):
+- $(CC) $(CFLAGS) -o $@ $@.c
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $@.c
diff --git a/mail-mta/netqmail/files/qmail-smtputf8.patch b/mail-mta/netqmail/files/qmail-smtputf8.patch
new file mode 100644
index 000000000000..5b656b9dbd9d
--- /dev/null
+++ b/mail-mta/netqmail/files/qmail-smtputf8.patch
@@ -0,0 +1,242 @@
+This patch adds EAI support to qmail; EAI allows UTF8 almost everywhere in
+email.
+
+Thanks for CNNIC for sponsoring this work.
+
+--- /dev/null
++++ netqmail-1.06/Makefile
+@@ -1446,7 +1446,7 @@ substdio.a error.a str.a fs.a auto_qmail.o dns.lib socket.lib
+ timeoutwrite.o timeoutconn.o tcpto.o now.o dns.o ip.o \
+ ipalloc.o ipme.o quote.o ndelay.a case.a sig.a open.a \
+ lock.a seek.a getln.a stralloc.a alloc.a substdio.a error.a \
+- str.a fs.a auto_qmail.o `cat dns.lib` `cat socket.lib`
++ str.a fs.a auto_qmail.o `cat dns.lib` `cat socket.lib` -lidn2
+
+ qmail-remote.0: \
+ qmail-remote.8
+--- /dev/null
++++ netqmail-1.06/qmail-remote.c
+@@ -2,6 +2,7 @@
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+ #include <arpa/inet.h>
++#include <idn2.h>
+ #include "sig.h"
+ #include "stralloc.h"
+ #include "substdio.h"
+@@ -42,6 +43,7 @@
+ stralloc routes = {0};
+ struct constmap maproutes;
+ stralloc host = {0};
++stralloc asciihost = {0};
+ stralloc sender = {0};
+
+ saa reciplist = {0};
+@@ -53,12 +55,13 @@
+ # include "tls.h"
+ # include "ssl_timeoutio.h"
+ # include <openssl/x509v3.h>
+-# define EHLO 1
+
+ int tls_init();
+ const char *ssl_err_str = 0;
+ #endif
+
++# define EHLO 1
++
+ void out(s) char *s; { if (substdio_puts(subfdoutsmall,s) == -1) _exit(0); }
+ void zero() { if (substdio_put(subfdoutsmall,"\0",1) == -1) _exit(0); }
+ void zerodie() { zero(); substdio_flush(subfdoutsmall); _exit(0); }
+@@ -156,6 +159,7 @@
+ substdio smtpfrom = SUBSTDIO_FDBUF(saferead,-1,smtpfrombuf,sizeof smtpfrombuf);
+
+ stralloc smtptext = {0};
++stralloc firstpart = {0};
+
+ void get(ch)
+ char *ch;
+@@ -308,6 +312,8 @@
+ int r;
+ char ch;
+
++ substdio_put(&smtpto,firstpart.s,firstpart.len);
++
+ for (;;) {
+ r = substdio_get(&ssin,&ch,1);
+ if (r == 0) break;
+@@ -518,6 +524,88 @@
+
+ stralloc recip = {0};
+
++int containsutf8(p, l) unsigned char * p; int l;
++{
++ int i = 0;
++ while (i<l)
++ if(p[i++] > 127) return 1;
++ return 0;
++}
++
++int utf8message;
++
++void checkutf8message()
++{
++ int pos;
++ int i;
++ int r;
++ char ch;
++ int state;
++
++ if (containsutf8(sender.s, sender.len)) { utf8message = 1; return; }
++ for (i = 0;i < reciplist.len;++i)
++ if (containsutf8(reciplist.sa[i].s, reciplist.sa[i].len)) {
++ utf8message = 1;
++ return;
++ }
++
++ state = 0;
++ pos = 0;
++ for (;;) {
++ r = substdio_get(&ssin,&ch,1);
++ if (r == 0) break;
++ if (r == -1) temp_read();
++
++ if (!stralloc_append(&firstpart,&ch)) temp_nomem();
++
++ if (ch == '\r')
++ continue;
++ if (ch == '\t')
++ ch = ' ';
++
++ switch (state) {
++ case 6: /* in Received, at LF but before WITH clause */
++ if (ch == ' ') { state = 3; pos = 1; continue; }
++ state = 0;
++ /* FALL THROUGH */
++
++ case 0: /* start of header field */
++ if (ch == '\n') return;
++ state = 1;
++ pos = 0;
++ /* FALL THROUGH */
++
++ case 1: /* partway through "Received:" */
++ if (ch != "RECEIVED:"[pos] && ch != "received:"[pos]) { state = 2; continue; }
++ if (++pos == 9) { state = 3; pos = 0; }
++ continue;
++
++ case 2: /* other header field */
++ if (ch == '\n') state = 0;
++ continue;
++
++ case 3: /* in Received, before WITH clause or partway though " with " */
++ if (ch == '\n') { state = 6; continue; }
++ if (ch != " WITH "[pos] && ch != " with "[pos]) { pos = 0; continue; }
++ if (++pos == 6) { state = 4; pos = 0; }
++ continue;
++
++ case 4: /* in Received, having seen with, before the argument */
++ if (pos == 0 && (ch == ' ' || ch == '\t')) continue;
++ if (ch != "UTF8"[pos] && ch != "utf8"[pos]) { state = 5; continue; }
++ if(++pos == 4) { utf8message = 1; state = 5; continue; }
++ continue;
++
++ case 5: /* after the RECEIVED WITH argument */
++ /* blast() assumes that it copies whole lines */
++ if (ch == '\n') return;
++ state = 1;
++ pos = 0;
++ continue;
++ }
++ }
++}
++
+ void smtp()
+ {
+ unsigned long code;
+@@ -571,9 +659,12 @@
+ }
+ #endif
+
++ checkutf8message();
+ substdio_puts(&smtpto,"MAIL FROM:<");
+ substdio_put(&smtpto,sender.s,sender.len);
+- substdio_puts(&smtpto,">\r\n");
++ substdio_puts(&smtpto,">");
++ if (utf8message) substdio_puts(&smtpto," SMTPUTF8");
++ substdio_puts(&smtpto,"\r\n");
+ substdio_flush(&smtpto);
+ code = smtpcode();
+ if (code >= 500) quit("DConnected to "," but sender was rejected");
+@@ -702,9 +793,17 @@
+ relayhost[i] = 0;
+ }
+ if (!stralloc_copys(&host,relayhost)) temp_nomem();
++ } else {
++ char * ascii = 0;
++ host.s[host.len] = '\0';
++ switch (idn2_lookup_u8(host.s, (uint8_t**)&ascii, IDN2_NFC_INPUT)) {
++ case IDN2_OK: break;
++ case IDN2_MALLOC: temp_nomem();
++ default: perm_dns();
++ }
++ if (!stralloc_copys(&asciihost, ascii)) temp_nomem();
+ }
+
+-
+ addrmangle(&sender,argv[2],&flagalias,0);
+
+ if (!saa_readyplus(&reciplist,0)) temp_nomem();
+@@ -723,7 +822,7 @@
+
+
+ random = now() + (getpid() << 16);
+- switch (relayhost ? dns_ip(&ip,&host) : dns_mxip(&ip,&host,random)) {
++ switch (relayhost ? dns_ip(&ip,&host) : dns_mxip(&ip,&asciihost,random)) {
+ case DNS_MEM: temp_nomem();
+ case DNS_SOFT: temp_dns();
+ case DNS_HARD: perm_dns();
+--- /dev/null
++++ netqmail-1.06/qmail-smtpd.c
+@@ -273,6 +273,7 @@
+ stralloc rcptto = {0};
+ stralloc fuser = {0};
+ stralloc mfparms = {0};
++int smtputf8 = 0;
+
+ int mailfrom_size(arg) char *arg;
+ {
+@@ -323,6 +324,7 @@
+ while (len) {
+ arg++; len--;
+ if (*arg == ' ' || *arg == '\0' ) {
++ if (case_starts(mfparms.s,"SMTPUTF8")) smtputf8 = 1;
+ if (case_starts(mfparms.s,"SIZE=")) if (mailfrom_size(mfparms.s+5)) { flagsize = 1; return; }
+ if (case_starts(mfparms.s,"AUTH=")) mailfrom_auth(mfparms.s+5,mfparms.len-5);
+ if (!stralloc_copys(&mfparms,"")) die_nomem;
+@@ -351,7 +353,7 @@
+ out("\r\n250-STARTTLS");
+ #endif
+ size[fmt_ulong(size,(unsigned int) databytes)] = 0;
+- out("\r\n250-PIPELINING\r\n250-8BITMIME\r\n");
++ out("\r\n250-PIPELINING\r\n250-SMTPUTF8\r\n250-8BITMIME\r\n");
+ out("250-SIZE "); out(size); out("\r\n");
+ #ifdef CRAM_MD5
+ out("250 AUTH LOGIN PLAIN CRAM-MD5\r\n");
+@@ -516,7 +518,15 @@
+ if (qmail_open(&qqt) == -1) { err_qqt(); return; }
+ qp = qmail_qp(&qqt);
+ out("354 go ahead\r\n");
+-
++
++ if (smtputf8) {
++ stralloc utf8proto = {0};
++ if ('E' == *protocol) protocol++;
++ if (!stralloc_copys(&utf8proto, "UTF8")) die_nomem();
++ if (!stralloc_cats(&utf8proto, protocol)) die_nomem();
++ utf8proto.s[utf8proto.len] = '\0';
++ protocol = utf8proto.s;
++ }
+ received(&qqt,protocol,local,remoteip,remotehost,remoteinfo,fakehelo);
+ blast(&hops);
+ hops = (hops >= MAXHOPS);
+
diff --git a/mail-mta/netqmail/files/use-new-path-for-functions.sh.patch b/mail-mta/netqmail/files/use-new-path-for-functions.sh.patch
new file mode 100644
index 000000000000..52f3d8e9a957
--- /dev/null
+++ b/mail-mta/netqmail/files/use-new-path-for-functions.sh.patch
@@ -0,0 +1,11 @@
+--- genqmail-20080406.orig/ssl/mkservercert.orig 2015-10-18 12:46:40.082559295 -0200
++++ genqmail-20080406/ssl/mkservercert 2015-10-18 12:49:03.749576181 -0200
+@@ -5,7 +5,7 @@
+ # Based on mkimapdcert from courier-imap.
+
+ test -x /usr/bin/openssl || exit 0
+-source /etc/init.d/functions.sh || exit 1
++source /lib/gentoo/functions.sh || exit 1
+
+ filedir="/var/qmail/control"
+ pemfile="${filedir}/servercert.pem"