GNU bug report logs - #16946
24.3; Rmail behaviour with a username containing "@"

Previous Next

Package: emacs;

Reported by: Robert Thorpe <rt <at> robertthorpeconsulting.com>

Date: Thu, 6 Mar 2014 03:04:01 UTC

Severity: normal

Tags: fixed

Found in version 24.3

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 16946 in the body.
You can then email your comments to 16946 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#16946; Package emacs. (Thu, 06 Mar 2014 03:04:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Robert Thorpe <rt <at> robertthorpeconsulting.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 06 Mar 2014 03:04:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Robert Thorpe <rt <at> robertthorpeconsulting.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.3; Rmail behaviour with a username containing "@"
Date: Thu, 06 Mar 2014 02:33:12 +0000
My webspace provider gives usernames that are email addresses.  So, the
username for the smtp, pop and imap servers for this email address is "rt <at> robertthorpeconsulting.com".

I can't use the character "@" in a username though, if it's sent to
movemail then that program will confuse what follows for the server
name.  I.e. if I do:-
(setq rmail-primary-inbox-list  '("imap://rt <at> robertthorpeconsulting.com <at> myserver.com")
Then everything after the first @ is taken to be the server address.

I can use "%40" as in web addresses instead of the first @.  If I do
that then movemail works fine and all my email is downloaded into the
temp file ".newmail-...."  Once this happens though Rmail gets confused.
Movemail creates a file containing "%" but Rmail is looking for "%40",
so it can't find the file.  It then report no new mail and doesn't copy
the temp file into RMAIL.

To solve this for myself I've edited the function
rmail-insert-inbox-text just after this bit:
      ;; At this point, TOFILE contains the name to read:
      ;; Either the alternate name (if we renamed)
      ;; or the actual inbox (if not renaming).

I've put in some code to substitute %40 for @ in tofile.  That fixes the
problem for me, but it's not a real fix.

I think at the least the manual should tell users they can't use
usernames with "@" in them.

BR,
Robert Thorpe


In GNU Emacs 24.3.1 (i686-pc-linux-gnu, GTK+ Version 3.4.2)
 of 2014-02-22 on chindi10, modified by Debian
Windowing system distributor `The X.Org Foundation', version 11.0.11103000
System Description:	Ubuntu 12.04.4 LTS

Configured using:
 `configure '--build' 'i686-linux-gnu' '--build' 'i686-linux-gnu'
 '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib'
 '--localstatedir=/var/lib' '--infodir=/usr/share/info'
 '--mandir=/usr/share/man' '--with-pop=yes'
 '--enable-locallisppath=/etc/emacs24:/etc/emacs:/usr/local/share/emacs/24.3/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.3/site-lisp:/usr/share/emacs/site-lisp'
 '--with-crt-dir=/usr/lib/i386-linux-gnu' '--with-x=yes'
 '--with-x-toolkit=gtk3' '--with-toolkit-scroll-bars'
 'build_alias=i686-linux-gnu' 'CFLAGS=-g -O2 -fstack-protector
 --param=ssp-buffer-size=4 -Wformat -Wformat-security
 -Werror=format-security -Wall' 'LDFLAGS=-Wl,-Bsymbolic-functions
 -Wl,-z,relro' 'CPPFLAGS=-D_FORTIFY_SOURCE=2''

Important settings:
  value of $LC_MONETARY: en_GB.UTF-8
  value of $LC_NUMERIC: en_GB.UTF-8
  value of $LC_TIME: en_GB.UTF-8
  value of $LANG: en_GB.UTF-8
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: RMAIL

Minor modes in effect:
  tooltip-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: t
  column-number-mode: t
  line-number-mode: t
  global-visual-line-mode: t
  visual-line-mode: t
  transient-mark-mode: t

Recent input:
M-x r m a i l <return> M-x r e p o r t <tab> <retu
rn>

Recent messages:
Loading debian-ispell...
Loading /var/cache/dictionaries-common/emacsen-ispell-default.el (source)...done
Loading debian-ispell...done
Loading /var/cache/dictionaries-common/emacsen-ispell-dicts.el (source)...done
Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)...done
For information about GNU Emacs and the GNU system, type C-h C-a.
Counting messages...done
Getting mail from the remote server ...
(No new mail has arrived)
0 new messages read

Load-path shadows:
/usr/share/emacs/24.3/site-lisp/debian-startup hides /usr/share/emacs/site-lisp/debian-startup
/usr/share/emacs24/site-lisp/dictionaries-common/flyspell hides /usr/share/emacs/24.3/lisp/textmodes/flyspell
/usr/share/emacs24/site-lisp/dictionaries-common/ispell hides /usr/share/emacs/24.3/lisp/textmodes/ispell

Features:
(shadow sort gnus-util mail-extr emacsbug sendmail rmailmm message
format-spec rfc822 mml easymenu mml-sec mm-decode mm-bodies mm-encode
mailabbrev gmm-utils mailheader mail-parse rfc2231 rmail rfc2047 rfc2045
ietf-drums mm-util mail-prsvr mail-utils server time-date tooltip
ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd
fontset image regexp-opt fringe tabulated-list newcomment lisp-mode
register page menu-bar rfn-eshadow timer select scroll-bar mouse
jit-lock font-lock syntax facemenu font-core frame cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev
minibuffer loaddefs button faces cus-face macroexp files text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote make-network-process dbusbind
dynamic-setting system-font-setting font-render-setting move-toolbar gtk
x-toolkit x multi-tty emacs)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16946; Package emacs. (Fri, 04 Dec 2020 12:06:02 GMT) Full text and rfc822 format available.

Message #8 received at 16946 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Robert Thorpe <rt <at> robertthorpeconsulting.com>
Cc: 16946 <at> debbugs.gnu.org
Subject: Re: bug#16946: 24.3; Rmail behaviour with a username containing "@"
Date: Fri, 04 Dec 2020 13:04:57 +0100
Robert Thorpe <rt <at> robertthorpeconsulting.com> writes:

> My webspace provider gives usernames that are email addresses.  So, the
> username for the smtp, pop and imap servers for this email address is "rt <at> robertthorpeconsulting.com".
>
> I can't use the character "@" in a username though, if it's sent to
> movemail then that program will confuse what follows for the server
> name.  I.e. if I do:-
> (setq rmail-primary-inbox-list  '("imap://rt <at> robertthorpeconsulting.com <at> myserver.com")
> Then everything after the first @ is taken to be the server address.

(This bug report unfortunately got no response at the time.)

I don't use pop3 myself, so I can't really test this.  I tried looking
in the changelog to see whethers anything has changed in this area, and
I can't see anything in particular...  but these days, we recommend the
system-wide movemail implementation, which may or may not have this
limitation.

Are you still seeing this issue in more recent Emacs versions?  Having
an "@" in a user name is quote common, so it's odd that we haven't seen
more bug reports about this if it's still an issue.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Fri, 04 Dec 2020 12:06:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16946; Package emacs. (Sun, 06 Dec 2020 03:08:01 GMT) Full text and rfc822 format available.

Message #13 received at 16946 <at> debbugs.gnu.org (full text, mbox):

From: Robert Thorpe <rt <at> robertthorpeconsulting.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 16946 <at> debbugs.gnu.org
Subject: Re: bug#16946: 24.3; Rmail behaviour with a username containing "@"
Date: Sun, 06 Dec 2020 03:06:39 +0000
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Robert Thorpe <rt <at> robertthorpeconsulting.com> writes:
>
>> My webspace provider gives usernames that are email addresses.  So, the
>> username for the smtp, pop and imap servers for this email address is "rt <at> robertthorpeconsulting.com".
>>
>> I can't use the character "@" in a username though, if it's sent to
>> movemail then that program will confuse what follows for the server
>> name.  I.e. if I do:-
>> (setq rmail-primary-inbox-list  '("imap://rt <at> robertthorpeconsulting.com <at> myserver.com")
>> Then everything after the first @ is taken to be the server address.
>
> (This bug report unfortunately got no response at the time.)
>
> I don't use pop3 myself, so I can't really test this.  I tried looking
> in the changelog to see whethers anything has changed in this area, and
> I can't see anything in particular...  but these days, we recommend the
> system-wide movemail implementation, which may or may not have this
> limitation.
>
> Are you still seeing this issue in more recent Emacs versions?  Having
> an "@" in a user name is quote common, so it's odd that we haven't seen
> more bug reports about this if it's still an issue.

Thank you for looking at my very old bug report.

I checked it recently and the problem is still there.  Notice that it
happens on IMAP and POP3.  If you look at the code I quoted above it uses
IMAP.

I think it's caused by movemail from GNU Mailutils though.  Mailutils
can't deal with two "@" symbols (one in the username and another for the
server).  I can replicate this by using movemail on the command line
without any Emacs involvement.  I think this is a bug in mailutils.
Would you agree?  If so I'll report it.

I'm not sure that it would be possible for the Mailutils maintainers to
fix it without changing the options format for the command.  On the
other hand I think the options format really should be changed.

The kludge to fix this is to use "%40" in the email address instead of
"@".  That's what I've been using.

I don't know why it hasn't been reported again.  Perhaps few people use
Rmail and have email addresses of that sort.  Or perhaps when they found
the problem they searched the web and found the mailing list discussions
where someone gave the "%40" hack.

BR,
Robert Thorpe





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16946; Package emacs. (Sun, 06 Dec 2020 13:55:02 GMT) Full text and rfc822 format available.

Message #16 received at 16946 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Robert Thorpe <rt <at> robertthorpeconsulting.com>
Cc: 16946 <at> debbugs.gnu.org
Subject: Re: bug#16946: 24.3; Rmail behaviour with a username containing "@"
Date: Sun, 06 Dec 2020 14:54:26 +0100
Robert Thorpe <rt <at> robertthorpeconsulting.com> writes:

> I think it's caused by movemail from GNU Mailutils though.  Mailutils
> can't deal with two "@" symbols (one in the username and another for the
> server).  I can replicate this by using movemail on the command line
> without any Emacs involvement.  I think this is a bug in mailutils.
> Would you agree?  If so I'll report it.

I'm not quite sure.  As you point out:

> I'm not sure that it would be possible for the Mailutils maintainers to
> fix it without changing the options format for the command.  On the
> other hand I think the options format really should be changed.
>
> The kludge to fix this is to use "%40" in the email address instead of
> "@".  That's what I've been using.

So perhaps we should just fix Emacs to allow %40, and document that.
You said:

> To solve this for myself I've edited the function
> rmail-insert-inbox-text just after this bit:
>       ;; At this point, TOFILE contains the name to read:
>       ;; Either the alternate name (if we renamed)
>       ;; or the actual inbox (if not renaming).
>
> I've put in some code to substitute %40 for @ in tofile.  That fixes the
> problem for me, but it's not a real fix.

Could you submit a patch for that, so that we could see what that'd look
like?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Removed tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sun, 06 Dec 2020 13:55:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16946; Package emacs. (Sun, 06 Dec 2020 14:14:01 GMT) Full text and rfc822 format available.

Message #21 received at 16946 <at> debbugs.gnu.org (full text, mbox):

From: Jean Louis <bugs <at> gnu.support>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 16946 <at> debbugs.gnu.org, Robert Thorpe <rt <at> robertthorpeconsulting.com>
Subject: Re: bug#16946: 24.3; Rmail behaviour with a username containing "@"
Date: Sun, 6 Dec 2020 17:10:14 +0300
* Lars Ingebrigtsen <larsi <at> gnus.org> [2020-12-06 16:55]:
> Robert Thorpe <rt <at> robertthorpeconsulting.com> writes:
> 
> > I think it's caused by movemail from GNU Mailutils though.  Mailutils
> > can't deal with two "@" symbols (one in the username and another for the
> > server).  I can replicate this by using movemail on the command line
> > without any Emacs involvement.  I think this is a bug in mailutils.
> > Would you agree?  If so I'll report it.
> 
> I'm not quite sure.  As you point out:

Send email to Sergey on bug-mailutils <at> gnu.org with reference to this
bug to see if it is bug in GNU Mailutils.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16946; Package emacs. (Sun, 06 Dec 2020 23:52:01 GMT) Full text and rfc822 format available.

Message #24 received at 16946 <at> debbugs.gnu.org (full text, mbox):

From: Robert Thorpe <rt <at> robertthorpeconsulting.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 16946 <at> debbugs.gnu.org
Subject: Re: bug#16946: 24.3; Rmail behaviour with a username containing "@"
Date: Sun, 06 Dec 2020 23:50:32 +0000
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Robert Thorpe <rt <at> robertthorpeconsulting.com> writes:
>
>> I think it's caused by movemail from GNU Mailutils though.  Mailutils
>> can't deal with two "@" symbols (one in the username and another for the
>> server).  I can replicate this by using movemail on the command line
>> without any Emacs involvement.  I think this is a bug in mailutils.
>> Would you agree?  If so I'll report it.
>
> I'm not quite sure.  As you point out:

I think that the GNU Mailutils manual should at least mention that it's
necessary.  Ideally though, there should be another options format which
splits up the information in a more sensible way.  One where the server,
username, port and password are all passed in separate options rather
than one big one.

I will send a message to bug-mailutils <at> gnu.org.

>> I'm not sure that it would be possible for the Mailutils maintainers to
>> fix it without changing the options format for the command.  On the
>> other hand I think the options format really should be changed.
>>
>> The kludge to fix this is to use "%40" in the email address instead of
>> "@".  That's what I've been using.
>
> So perhaps we should just fix Emacs to allow %40, and document that.
> You said:
>
>> To solve this for myself I've edited the function
>> rmail-insert-inbox-text just after this bit:
>>       ;; At this point, TOFILE contains the name to read:
>>       ;; Either the alternate name (if we renamed)
>>       ;; or the actual inbox (if not renaming).
>>
>> I've put in some code to substitute %40 for @ in tofile.  That fixes the
>> problem for me, but it's not a real fix.
>
> Could you submit a patch for that, so that we could see what that'd look
> like?

I forgot to tell you about that part of it.  I don't need my work-around
anymore.  I think it's been fixed in mailutils.  I don't see any fix in
rmail-insert-inbox-text.

The problem was the treatment of the %40.  It appears in the filename
"tofile" that's passed in Rmail.  In the past, movemail decoded it to @
and created a file with @ in the name.  That confused Rmail which didn't
do that with it's tofile.  So, I added (setq tofile (url-unhex-string
tofile)) just before Rmail opens the file.

Now though, movemail keeps the URL encoding in the filename, it keeps
the %40 and doesn't change it to @.  That solved that problem.

But, you still have to put in %40 when setting the username, and the
Rmail manual doesn't mention that.  Perhaps it should, I can write a
patch for that if you want.

BR,
Robert Thorpe




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16946; Package emacs. (Mon, 07 Dec 2020 15:06:02 GMT) Full text and rfc822 format available.

Message #27 received at 16946 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Robert Thorpe <rt <at> robertthorpeconsulting.com>
Cc: 16946 <at> debbugs.gnu.org
Subject: Re: bug#16946: 24.3; Rmail behaviour with a username containing "@"
Date: Mon, 07 Dec 2020 16:05:22 +0100
Robert Thorpe <rt <at> robertthorpeconsulting.com> writes:

> Now though, movemail keeps the URL encoding in the filename, it keeps
> the %40 and doesn't change it to @.  That solved that problem.

Ah, I see.

> But, you still have to put in %40 when setting the username, and the
> Rmail manual doesn't mention that.  Perhaps it should, I can write a
> patch for that if you want.

Yes, that would be welcome.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16946; Package emacs. (Mon, 14 Dec 2020 06:09:02 GMT) Full text and rfc822 format available.

Message #30 received at 16946 <at> debbugs.gnu.org (full text, mbox):

From: Robert Thorpe <rt <at> robertthorpeconsulting.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 16946 <at> debbugs.gnu.org
Subject: Re: bug#16946: 24.3; Rmail behaviour with a username containing "@"
Date: Mon, 14 Dec 2020 06:08:24 +0000
[Message part 1 (text/plain, inline)]
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Robert Thorpe <rt <at> robertthorpeconsulting.com> writes:
>
>> But, you still have to put in %40 when setting the username, and the
>> Rmail manual doesn't mention that.  Perhaps it should, I can write a
>> patch for that if you want.
>
> Yes, that would be welcome.

I made an edit to rmail.texi from the emacs-27 branch.  I've attached
the output of "diff -u" as instructed in "Sending Patches".

I have not filed copyright assignment paperwork for Emacs.

BR,
Robert Thorpe

[at_prob_diff.txt (text/plain, inline)]
--- rmail.texi	2020-12-14 05:27:47.041314124 +0000
+++ nrmail.texi	2020-12-14 05:56:34.468029100 +0000
@@ -1591,6 +1591,8 @@
 Otherwise, Rmail will ask you for the password to use.
 @end enumerate
 
+On some mailservers the usernames include domain information, which can mean they contain the @code{@@} symbol.  The inbox specifier string uses @code{@@} to signal the start of the mailserver name.  This creates confusion for movemail.  If your username contains @code{@@} and you're using Mailutils movemail then you can fix this.  In the username replace @code{@@} with it's URL encoding @code{%40}.
+
 @vindex rmail-movemail-flags
   If you need to pass additional command-line flags to @command{movemail},
 set the variable @code{rmail-movemail-flags} a list of the flags you

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16946; Package emacs. (Mon, 14 Dec 2020 16:53:02 GMT) Full text and rfc822 format available.

Message #33 received at 16946 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Robert Thorpe <rt <at> robertthorpeconsulting.com>
Cc: 16946 <at> debbugs.gnu.org
Subject: Re: bug#16946: 24.3; Rmail behaviour with a username containing "@"
Date: Mon, 14 Dec 2020 17:51:56 +0100
Robert Thorpe <rt <at> robertthorpeconsulting.com> writes:

> I made an edit to rmail.texi from the emacs-27 branch.  I've attached
> the output of "diff -u" as instructed in "Sending Patches".

Thanks; applied to Emacs 28.

> I have not filed copyright assignment paperwork for Emacs.

It's small enough to apply without assignment.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) fixed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Mon, 14 Dec 2020 16:53:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 28.1, send any further explanations to 16946 <at> debbugs.gnu.org and Robert Thorpe <rt <at> robertthorpeconsulting.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Mon, 14 Dec 2020 16:53:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 12 Jan 2021 12:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 131 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.