Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Qmail patch problem..

Status
Not open for further replies.

fw12

Programmer
Sep 1, 2006
8
US
Hi.

I'm having a hard time patching qmail with nullenvsender.patch.

Is this a permanent error, or is there something I can do?

The error says:

patching file qmail-smtpd.c
Hunk #1 FAILED at 112.
Hunk #2 succeeded at 222 (offset -113 lines).
Hunk #3 succeeded at 360 with fuzz 1 (offset -16 lines).
Hunk #4 succeeded at 280 (offset -166 lines).
Hunk #5 succeeded at 542 (offset -23 lines).
1 out of 5 hunks FAILED -- saving rejects to file qmail-smtpd.c.rej

qmail-smtpd.c.rej contains the following:
------------------BEGIN qmail-smtpd.c.rej -----------------
***************
*** 112,117 ****
void err_hmf() { out("553 sorry, your envelope sender domain must exist (#5.7.1)\r\n"); }
void err_smf() { out("451 DNS temporary failure (#4.3.0)\r\n"); }
void err_nogateway() { out("553 sorry, that domain isn't in my list of allowed rcpthosts (#5.7.1)\r\n"); }
#ifdef TLS
void err_nogwcert() { out("553 no valid cert for gatewaying (#5.7.1)\r\n"); }
#endif
--- 112,118 ----
void err_hmf() { out("553 sorry, your envelope sender domain must exist (#5.7.1)\r\n"); }
void err_smf() { out("451 DNS temporary failure (#4.3.0)\r\n"); }
void err_nogateway() { out("553 sorry, that domain isn't in my list of allowed rcpthosts (#5.7.1)\r\n"); }
+ void err_badbounce() { out("550 sorry, bounce messages should have a single envelope recipient (#5.7.1)\r\n"); }
#ifdef TLS
void err_nogwcert() { out("553 no valid cert for gatewaying (#5.7.1)\r\n"); }
#endif
-------------------------END qmail-smtpd.c.rej -----------------------


The patch is here:


The unpatched qmail-smtpd.c is here:

Thanks.
 
It looks to me that the patch errors in hunks 1 & 5 are easily introduced manually...

They appear only to be insertions and are prefixed with
"+++"

Try finding the appropriate text before and add the patch manually.

D.E.R. Management - IT Project Management Consulting
 
Thanks for your reply.

I don't know much about patches other than how to apply them.

What linux topic teaches how to create patches, or is it a programming thing?
 
Here's a quick run-thru on your specific subject:

The patch file is a special instruction set to modify existing code with adds/modifies/deletes. Applying the patch attempts to apply those patch hunk(s) by finding the affecting code and applying the patch.

Your patch has five hunks, #1 and #5 did not apply.

Because your patch hunks are trivial, I recommend you apply them manually.... Let's examine patch hunk #1.

Hunk #1 begins with the "@@" character and reads thusly (from your sample file as posted):
Code:
@@ -112,6 +112,7 @@
 void err_hmf() { out("553 sorry, your envelope sender domain must exist (#5.7.1)\r\n"); }
 void err_smf() { out("451 DNS temporary failure (#4.3.0)\r\n"); }
 void err_nogateway() { out("553 sorry, that domain isn't in my list of allowed rcpthosts (#5.7.1)\r\n"); }
+void err_badbounce() { out("550 sorry, bounce messages should have a single envelope recipient (#5.7.1)\r\n"); }
 #ifdef TLS
 void err_nogwcert() { out("553 no valid cert for gatewaying (#5.7.1)\r\n"); }
 #endif

The patch process begins lines wth "+" or "-" to connote whether the change is additive or subtractive.

In this case, the patch says:
"right after the line around #112-114, and right after the line that begins with 'void err_nogateway()...' you should insert the new line that begins with 'void err_badbounce()...'

In my opinion, the problem with applying the patch is that for some reason the line numbering is WAY off.
Patch hunk appears to need to be applied around line 54 of the unpatched qmail-smtpd.c you posted.

Similarly, patch hunk #5 should be applied around line 375.

I'm confused why the hunks #1 and #5 are so far off, but that's another matter. Good luck.


D.E.R. Management - IT Project Management Consulting
 
Excellent explanation!

There are a few other patches that I have to apply before this patch. I suspect those patches change the source enough to cause errors with this patch.

I read a guide online about patches, but it makes no mention of Hunks/@@/++/--, etc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top