Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 102149 Details for
Bug 95892
[qmail] patches to be added to -r17
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
For relaying outgoing mail to a smarthost which requires authentication.
qmail-remote-auth.patch (text/plain), 4.68 KB, created by
bugzilla
on 2006-11-16 13:09:09 UTC
(
hide
)
Description:
For relaying outgoing mail to a smarthost which requires authentication.
Filename:
MIME Type:
Creator:
bugzilla
Created:
2006-11-16 13:09:09 UTC
Size:
4.68 KB
patch
obsolete
>--- qmail-remote.c.orig Mon Jun 15 03:52:55 1998 >+++ qmail-remote.c Sat Nov 20 21:37:47 2004 >@@ -43,6 +43,8 @@ > struct constmap maproutes; > stralloc host = {0}; > stralloc sender = {0}; >+stralloc auth_smtp_user = {0}; >+stralloc auth_smtp_pass = {0}; > > saa reciplist = {0}; > >@@ -221,19 +223,55 @@ > unsigned long code; > int flagbother; > int i; >+ stralloc slop = {0}; > > if (smtpcode() != 220) quit("ZConnected to "," but greeting failed"); >- >- substdio_puts(&smtpto,"HELO "); >+ >+ substdio_puts(&smtpto,"EHLO "); > substdio_put(&smtpto,helohost.s,helohost.len); > substdio_puts(&smtpto,"\r\n"); > substdio_flush(&smtpto); >- if (smtpcode() != 250) quit("ZConnected to "," but my name was rejected"); >- >- substdio_puts(&smtpto,"MAIL FROM:<"); >- substdio_put(&smtpto,sender.s,sender.len); >- substdio_puts(&smtpto,">\r\n"); >- substdio_flush(&smtpto); >+ if (smtpcode() != 250) { >+ substdio_puts(&smtpto,"HELO "); >+ substdio_put(&smtpto,helohost.s,helohost.len); >+ substdio_puts(&smtpto,"\r\n"); >+ substdio_flush(&smtpto); >+ if (smtpcode() != 250) quit("ZConnected to "," but my name was rejected"); >+ } >+ i = 0; >+ while((i += str_chr(smtptext.s+i,'\n') + 1) && (i+14 < smtptext.len) && >+ str_diffn(smtptext.s+i+4,"AUTH LOGIN\n",11) && >+ str_diffn(smtptext.s+i+4,"AUTH LOGIN ",11) && >+ str_diffn(smtptext.s+i+4,"AUTH PLAIN LOGIN\n",17) && >+ str_diffn(smtptext.s+i+4,"AUTH PLAIN LOGIN ",17) && >+ str_diffn(smtptext.s+i+4,"AUTH=LOGIN\n",11) && >+ str_diffn(smtptext.s+i+4,"AUTH=LOGIN ",11)); >+ if ((i+14 < smtptext.len) && auth_smtp_user.len && auth_smtp_pass.len) { >+ substdio_puts(&smtpto,"AUTH LOGIN\r\n"); >+ substdio_flush(&smtpto); >+ if (smtpcode() != 334) quit("ZConnected to "," but authentication was rejected (AUTH LOGIN)"); >+ if (b64encode(&auth_smtp_user,&slop) < 0) temp_nomem(); >+ substdio_put(&smtpto,slop.s,slop.len); >+ substdio_puts(&smtpto,"\r\n"); >+ substdio_flush(&smtpto); >+ if (smtpcode() != 334) quit("ZConnected to "," but authentication was rejected (username)"); >+ if (b64encode(&auth_smtp_pass,&slop) < 0) temp_nomem(); >+ substdio_put(&smtpto,slop.s,slop.len); >+ substdio_puts(&smtpto,"\r\n"); >+ substdio_flush(&smtpto); >+ if (smtpcode() != 235) quit("ZConnected to "," but authentication was rejected (password)"); >+ substdio_puts(&smtpto,"MAIL FROM:<"); >+ substdio_put(&smtpto,sender.s,sender.len); >+ substdio_puts(&smtpto,"> AUTH=<"); >+ substdio_put(&smtpto,sender.s,sender.len); >+ substdio_puts(&smtpto,">\r\n"); >+ substdio_flush(&smtpto); >+ } else { >+ substdio_puts(&smtpto,"MAIL FROM:<"); >+ substdio_put(&smtpto,sender.s,sender.len); >+ substdio_puts(&smtpto,">\r\n"); >+ substdio_flush(&smtpto); >+ } > code = smtpcode(); > if (code >= 500) quit("DConnected to "," but sender was rejected"); > if (code >= 400) quit("ZConnected to "," but sender was rejected"); >@@ -331,7 +367,7 @@ > char **argv; > { > static ipalloc ip = {0}; >- int i; >+ int i,j; > unsigned long random; > char **recips; > unsigned long prefme; >@@ -347,6 +383,9 @@ > > if (!stralloc_copys(&host,argv[1])) temp_nomem(); > >+ if (!stralloc_copys(&auth_smtp_user,"")) temp_nomem(); >+ if (!stralloc_copys(&auth_smtp_pass,"")) temp_nomem(); >+ > relayhost = 0; > for (i = 0;i <= host.len;++i) > if ((i == 0) || (i == host.len) || (host.s[i] == '.')) >@@ -355,6 +394,16 @@ > if (relayhost && !*relayhost) relayhost = 0; > > if (relayhost) { >+ i = str_chr(relayhost,' '); >+ if (relayhost[i]) { >+ j = str_chr(relayhost + i + 1,' '); >+ if (relayhost[j]) { >+ relayhost[i] = 0; >+ relayhost[i + j + 1] = 0; >+ if (!stralloc_copys(&auth_smtp_user,relayhost + i + 1)) temp_nomem(); >+ if (!stralloc_copys(&auth_smtp_pass,relayhost + i + j + 2)) temp_nomem(); >+ } >+ } > i = str_chr(relayhost,':'); > if (relayhost[i]) { > scan_ulong(relayhost + i + 1,&port); >--- Makefile~ Thu Apr 17 02:55:05 2003 >+++ Makefile Thu Apr 17 03:02:06 2003 >@@ -1445,12 +1445,12 @@ > load qmail-remote.o control.o constmap.o timeoutread.o 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 dns.lib socket.lib >+substdio.a error.a str.a fs.a auto_qmail.o base64.o dns.lib socket.lib > ./load qmail-remote control.o constmap.o timeoutread.o \ > 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 base64.o `cat dns.lib` `cat socket.lib` > > qmail-remote.0: \ > qmail-remote.8 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 95892
:
69319
| 102149