Ok, I implemented minimum required support to get it working with
email address as username.
It is enough to log in and navigate in the mailbox.
It surely have some limitations (I did not check email sending) but
now perfectly suit my needs (simple and self contained webmail
to consult and delete emails).

Emmanuel.
----------
email_as_login.patch:

Description: add basic support to use email address as username/login
  Username:backenPID was limited to 32 bytes. Bump to 64 to be usable with
  email address.
  @ was used unconditionally as a delimiter to split the request int the argv
  array. As many proxy/reverse-proxy rewrite %40 as @, do not split on @
  if we are processing the username (second field).
Author: Emmanuel Fusté <emmanuel.fu...@thalesgroup.com>
Origin: other
Bug-Debian: http://bugs.debian.org/720334
Last-Update: 2013-08-27

--- prayer-1.3.5-dfsg1.orig/servers/prayer_server.c
+++ prayer-1.3.5-dfsg1/servers/prayer_server.c
@@ -58,7 +58,7 @@ prayer_compose_dump(struct prayer *praye

  static BOOL check_argv_valid(char *s)
  {
-    if (!(s && s[0] && (strlen(s) < 32)))
+    if (!(s && s[0] && (strlen(s) < 64)))
          return(NIL);

      /* Check for ".." or "/" embedded into username */
--- prayer-1.3.5-dfsg1.orig/shared/request.c
+++ prayer-1.3.5-dfsg1/shared/request.c
@@ -1482,7 +1482,8 @@ void request_parse_argv(struct request *
          if (*t == '?')
              break;

-        if ((*t == '/') || (*t == '@'))
+        /* If @ is found in the second field, it is part of the username */
+        if ((*t == '/') || ((*t == '@') && (request->argc > 2)))
              request->argc++;
      }

@@ -1495,7 +1496,7 @@ void request_parse_argv(struct request *
      i = 0;
      t = s;
      while (*t) {
-        if ((*t == '/') || (*t == '@')) {
+        if ((*t == '/') || ((*t == '@') && (i > 1))) {
              *t++ = '\0';        /* Tie off previous string */
              request->argv[++i] = t;     /* Found start of next argv elt */
              continue;

Reply via email to