quilt-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Quilt-dev] error with "Signed-off-by" names not being proper email


From: Jean Delvare
Subject: Re: [Quilt-dev] error with "Signed-off-by" names not being proper email names
Date: Sat, 25 Mar 2006 16:46:19 +0100

Hi Greg, Andreas,

> > Current quilt has heuristics built in for handling most patches well
> > enough. As part of those heuristics, it adds addresses from To: lines
> > in patch headers to the To: mail header, and Signed-off-by:,
> > Acked-by:, and Cc: to the Cc: mail header. It doesn't check those
> > addresses for validity or try to quote them, so that's probably what
> > causes this problem.
> 
> It's checking them for validity and dieing when they aren't in the
> proper format.

I think sendmail is checking and dying, not quilt. Quilt actually
doesn't seem to make any check.

> > Probably it would be good to be more liberal with recipient addresses
> > in general, and quote them properly automatically.
> 
> That would be nice :)

Here is a naive patch trying to add quotes when needed:

Index: quilt/mail.in
===================================================================
RCS file: /cvsroot/quilt/quilt/quilt/mail.in,v
retrieving revision 1.23
diff -u -r1.23 mail.in
--- quilt/mail.in       14 Feb 2006 18:08:01 -0000      1.23
+++ quilt/mail.in       25 Mar 2006 15:38:21 -0000
@@ -420,7 +420,14 @@
                                  s = $0
                                  sub(/^[^:]*:[ \t]*/, "", s)
                                  gsub(/'\''/, "'\'\''", s)
-                                 print "--add-recipient " r "='\''" s "'\''"
+                                 gsub(/"/, "", s)
+                                 addr = s
+                                 sub(/^[^<]*[ \t]*</, "<", addr)
+                                 sub(/[ \t]*<.*$/, "", s)
+                                 if (s ~ /[^A-Za-z0-9 _-]/) {
+                                       s = "\"" s "\""
+                                 }
+                                 print "--add-recipient " r "='\''" s " " addr 
"'\''"
                                }
        sub(/^Replace-/, "")    { r = $0
                                  sub(/:.*/, "", r)
Index: test/mail.test
===================================================================
RCS file: /cvsroot/quilt/quilt/test/mail.test,v
retrieving revision 1.7
diff -u -r1.7 mail.test
--- test/mail.test      1 Feb 2006 04:23:27 -0000       1.7
+++ test/mail.test      25 Mar 2006 15:38:21 -0000
@@ -38,14 +38,15 @@
        $ cat - no-subject > patches/3.diff
        < Subject of 3.diff
        <
-       < To: Dummy <address@hidden>
+       < To: John X. Doe <address@hidden>
        <
 
        $ cat - no-subject > patches/4.diff
        < First paragraph used as
        < subject of 4.diff.
        <
-       < Cc: Dummy <address@hidden>
+       < Signed-off-by: Joe R. Hacker <address@hidden>
+       < Cc: "John X. Doe" <address@hidden>
        <
 
        $ cat - no-subject > patches/5.diff
@@ -61,7 +62,7 @@
        <
 
        $ quilt mail --mbox mbox --prefix "test" --subject "This is a test" -m 
"Message"
-       $ grep -e '^Subject:' -e '^To:' -e '^Cc:' -e '^--$' mbox
+       $ grep -e '^Subject:' -e '^To:' -e '^Cc:' -e '^--$' -e '^ ' mbox
        > Subject: [test 0/5] This is a test
        > --
        > Cc: Dummy <address@hidden>
@@ -70,13 +71,14 @@
        > Cc: Dummy <address@hidden>
        > Subject: [test 2/5] Subject of 2.diff is: split into multiple lines
        > --
-       > To: Dummy <address@hidden>
+       > To: "John X. Doe" <address@hidden>
        > Subject: [test 3/5] Subject of 3.diff
-       > To: Dummy <address@hidden>
+       > To: John X. Doe <address@hidden>
        > --
-       > Cc: Dummy <address@hidden>
+       > Cc: "Joe R. Hacker" <address@hidden>,
+       >  "John X. Doe" <address@hidden>
        > Subject: [test 4/5] First paragraph used as subject of 4.diff.
-       > Cc: Dummy <address@hidden>
+       > Cc: "John X. Doe" <address@hidden>
        > --
        > Subject: [test 5/5] Subject of 5.diff
        > --

Basically, it breaks recipient strings into name and address, and adds
double quotes around the name if it contains non-alphanumeric,
non-blank characters.

Greg, does it fix your case?

Andreas, is it acceptable or do you have more elaborated plans?

As a side note, I have noticed that "quilt mail" creates an empty file
named "0". Any idea why it does that? That's a bug, hm?

Thanks,
-- 
Jean Delvare




reply via email to

[Prev in Thread] Current Thread [Next in Thread]