unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* smtpmail-send-queued-mail fails with error 504 5.5.2
@ 2024-01-21 18:01 rameiko87
  2024-01-22 13:39 ` Manuel Giraud via Users list for the GNU Emacs text editor
  0 siblings, 1 reply; 8+ messages in thread
From: rameiko87 @ 2024-01-21 18:01 UTC (permalink / raw)
  To: help-gnu-emacs

Hello,

Could you please kindly help me with this? When I have 
smtpmail-queue-mail set to nil, sending emails works beautifully. I then 
change smtpmail-queue-mail to t: then the text of the email is saved in 
my queued email folder together with another file specifying the value 
of smtpmail-recipient-address-list (it contains the same address as in 
the To: header of my message). When I invoke smtpmail-send-queued-mail I 
get the following error:

Sending failed: 504 5.5.2 <usernameofmymachine@fedora>: Sender address 
rejected: need fully-qualified address

The strange thing is that usernameofmymachine@fedora would be the 
default address to appear in the From: header of C-x m, but
1. I set the variable message-user-fqdn (and it's different from 
"fedora"), so actually when I press C-x m I have 
usernameofmymachine@message-user-fqdn which is already different from 
usernameofmymachine@fedora
2. Before sending (that is to say, queuing), I do change the From: to my 
email address, and it appears correctly on the text file saved in the 
queued folder!

By the way, smtpmail-store-queue-variables is nil.

Please, help! Thanks so much.



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: smtpmail-send-queued-mail fails with error 504 5.5.2
  2024-01-21 18:01 smtpmail-send-queued-mail fails with error 504 5.5.2 rameiko87
@ 2024-01-22 13:39 ` Manuel Giraud via Users list for the GNU Emacs text editor
  2024-01-23 16:51   ` rameiko87
  0 siblings, 1 reply; 8+ messages in thread
From: Manuel Giraud via Users list for the GNU Emacs text editor @ 2024-01-22 13:39 UTC (permalink / raw)
  To: rameiko87; +Cc: help-gnu-emacs

rameiko87@posteo.net writes:

> Hello,
>
> Could you please kindly help me with this? When I have
> smtpmail-queue-mail set to nil, sending emails works beautifully. I
> then change smtpmail-queue-mail to t: then the text of the email is
> saved in my queued email folder together with another file specifying
> the value of smtpmail-recipient-address-list (it contains the same
> address as in the To: header of my message). When I invoke
> smtpmail-send-queued-mail I get the following error:
>
> Sending failed: 504 5.5.2 <usernameofmymachine@fedora>: Sender address
> rejected: need fully-qualified address
>
> The strange thing is that usernameofmymachine@fedora would be the
> default address to appear in the From: header of C-x m, but
> 1. I set the variable message-user-fqdn (and it's different from
> "fedora"), so actually when I press C-x m I have
> usernameofmymachine@message-user-fqdn which is already different from
> usernameofmymachine@fedora

Hi,

I've never touch 'message-user-fqdn' in years of doing mail into Emacs.

> 2. Before sending (that is to say, queuing), I do change the From: to
> my email address, and it appears correctly on the text file saved in
> the queued folder!

Hum, what is your value of 'user-mail-address'?  When it is set
correctly, you shouldn't have to manually edit your from header.
-- 
Manuel Giraud



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: smtpmail-send-queued-mail fails with error 504 5.5.2
  2024-01-22 13:39 ` Manuel Giraud via Users list for the GNU Emacs text editor
@ 2024-01-23 16:51   ` rameiko87
  2024-01-24  9:07     ` Manuel Giraud via Users list for the GNU Emacs text editor
  0 siblings, 1 reply; 8+ messages in thread
From: rameiko87 @ 2024-01-23 16:51 UTC (permalink / raw)
  To: Manuel Giraud; +Cc: help-gnu-emacs

> 
> I've never touch 'message-user-fqdn' in years of doing mail into Emacs.
> 

But then your Message-Id is not RFC compliant? This is the reason why I 
set it.

The default address in the From: field is 
usernameofmymachine@message-user-fqdn. This is already strange because 
it should use 'user-mail-address' since message-user-fqdn is explicitly 
reserved for Message-Id as the description of this variable says. I 
guess this is the first question we need to answer.

The second question is why the From header is ignored (from the message 
as saved in 'queued email folder') when sending with 
smtpmail-send-queued-mail. This is really worrisome!

  By the way because you ask, the reason why I change the From header is 
that I use a variety of different email addresses for the different 
affiliations which I have.

On 22.01.2024 14:39, Manuel Giraud wrote:
> 
>> Hello,
>> 
>> Could you please kindly help me with this? When I have
>> smtpmail-queue-mail set to nil, sending emails works beautifully. I
>> then change smtpmail-queue-mail to t: then the text of the email is
>> saved in my queued email folder together with another file specifying
>> the value of smtpmail-recipient-address-list (it contains the same
>> address as in the To: header of my message). When I invoke
>> smtpmail-send-queued-mail I get the following error:
>> 
>> Sending failed: 504 5.5.2 <usernameofmymachine@fedora>: Sender address
>> rejected: need fully-qualified address
>> 
>> The strange thing is that usernameofmymachine@fedora would be the
>> default address to appear in the From: header of C-x m, but
>> 1. I set the variable message-user-fqdn (and it's different from
>> "fedora"), so actually when I press C-x m I have
>> usernameofmymachine@message-user-fqdn which is already different from
>> usernameofmymachine@fedora
> 
> Hi,
> 
> I've never touch 'message-user-fqdn' in years of doing mail into Emacs.
> 
>> 2. Before sending (that is to say, queuing), I do change the From: to
>> my email address, and it appears correctly on the text file saved in
>> the queued folder!
> 
> Hum, what is your value of 'user-mail-address'?  When it is set
> correctly, you shouldn't have to manually edit your from header.



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: smtpmail-send-queued-mail fails with error 504 5.5.2
  2024-01-23 16:51   ` rameiko87
@ 2024-01-24  9:07     ` Manuel Giraud via Users list for the GNU Emacs text editor
  2024-01-24 10:57       ` rameiko87
  0 siblings, 1 reply; 8+ messages in thread
From: Manuel Giraud via Users list for the GNU Emacs text editor @ 2024-01-24  9:07 UTC (permalink / raw)
  To: rameiko87; +Cc: help-gnu-emacs

rameiko87@posteo.net writes:

>> I've never touch 'message-user-fqdn' in years of doing mail into
>> Emacs.
>> 
>
> But then your Message-Id is not RFC compliant? This is the reason why
> I set it.

I've just checked and my "Message-Id"s look like
<something>@ledu-giraud.fr.  So they seem to be correct and, as I said,
I've never fiddled with 'message-user-fqdn'.

> The default address in the From: field is
> usernameofmymachine@message-user-fqdn. This is already strange because
> it should use 'user-mail-address' since message-user-fqdn is
> explicitly reserved for Message-Id as the description of this variable
> says. I guess this is the first question we need to answer.

Yes it shouldn't be "usernameofmymachine@message-user-fqdn".  It should
be the value of 'user-mail-address'.  Could you try starting from "emacs
-Q", set 'user-mail-address' to what you want and 'M-x message-mail'?

> The second question is why the From header is ignored (from the
> message as saved in 'queued email folder') when sending with
> smtpmail-send-queued-mail. This is really worrisome!

Yes, this is something else but I imagine that
'smtpmail-send-queued-mail' respect 'user-mail-address'.

>  By the way because you ask, the reason why I change the From header
>  is that I use a variety of different email addresses for the
>  different affiliations which I have.

I do this too and it is just a matter of changing 'user-mail-address'
and 'smtpmail-smtp-server'.
-- 
Manuel Giraud



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: smtpmail-send-queued-mail fails with error 504 5.5.2
  2024-01-24  9:07     ` Manuel Giraud via Users list for the GNU Emacs text editor
@ 2024-01-24 10:57       ` rameiko87
  2024-01-24 13:02         ` Manuel Giraud via Users list for the GNU Emacs text editor
  0 siblings, 1 reply; 8+ messages in thread
From: rameiko87 @ 2024-01-24 10:57 UTC (permalink / raw)
  To: Manuel Giraud; +Cc: help-gnu-emacs



On 24.01.2024 10:07, Manuel Giraud wrote:
> 
>>> I've never touch 'message-user-fqdn' in years of doing mail into
>>> Emacs.
>>> 
>> 
>> But then your Message-Id is not RFC compliant? This is the reason why
>> I set it.
> 
> I've just checked and my "Message-Id"s look like
> <something>@ledu-giraud.fr.  So they seem to be correct and, as I said,
> I've never fiddled with 'message-user-fqdn'.
> 
>> The default address in the From: field is
>> usernameofmymachine@message-user-fqdn. This is already strange because
>> it should use 'user-mail-address' since message-user-fqdn is
>> explicitly reserved for Message-Id as the description of this variable
>> says. I guess this is the first question we need to answer.
> 
> Yes it shouldn't be "usernameofmymachine@message-user-fqdn".  It should
> be the value of 'user-mail-address'.  Could you try starting from 
> "emacs
> -Q", set 'user-mail-address' to what you want and 'M-x message-mail'?

I tried starting emacs as you suggested, and I can say that it shows no 
strange behaviour. Therefore there must be the following bug:

when user-mail-address is not set and therefore defaults to 
user@hostmachine (in my case user@fedora), as the description of the 
variable user-mail-address explicitly spells out, then the default email 
address qhen composing a new message somehow ignores this and uses 
user@message-user-fqdn (first thing to fix), which should instead only 
be reserved for message-id's (as the description of this variable says. 
Does it happen somewhere else too? this is the second thing to fix).

>> The second question is why the From header is ignored (from the
>> message as saved in 'queued email folder') when sending with
>> smtpmail-send-queued-mail. This is really worrisome!

This looks like another bug.

> 
> Yes, this is something else but I imagine that
> 'smtpmail-send-queued-mail' respect 'user-mail-address'.

so first of all, it probably does, in the sense that in my case it uses 
user@fedora, so message-user-fqdn does not intervene (silver lining). 
But it should use what I decided to set as header, not rewrite the 
headers without warning!

> 
>>  By the way because you ask, the reason why I change the From header
>>  is that I use a variety of different email addresses for the
>>  different affiliations which I have.
> 
> I do this too and it is just a matter of changing 'user-mail-address'
> and 'smtpmail-smtp-server'.

No, I don't want to change the variable every time!! I want to keep that 
variable for the default address, and change the headers as I need. And 
anyway, why this discrepancy between queued-sending and immediate 
sending? This I consider another bug, because not doing things 
consistently confuses the user (even not doing the *wrong* thing 
consistently confuses the user)
smtpmail-smtp-server can stay always the same because mine allows 
spoofing.

I think I will file a few bug reports today



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: smtpmail-send-queued-mail fails with error 504 5.5.2
  2024-01-24 10:57       ` rameiko87
@ 2024-01-24 13:02         ` Manuel Giraud via Users list for the GNU Emacs text editor
  2024-01-24 14:26           ` rameiko87
  0 siblings, 1 reply; 8+ messages in thread
From: Manuel Giraud via Users list for the GNU Emacs text editor @ 2024-01-24 13:02 UTC (permalink / raw)
  To: rameiko87; +Cc: help-gnu-emacs

rameiko87@posteo.net writes:

[...]

> when user-mail-address is not set and therefore defaults to
> user@hostmachine (in my case user@fedora), as the description of the
> variable user-mail-address explicitly spells out, then the default
> email address qhen composing a new message somehow ignores this and
> uses user@message-user-fqdn (first thing to fix),

Ok, so I've done the following:
    - emacs -Q
    - M-: (setq message-user-fqdn "elsewhere")
    - M-x message-mail

The "From:" is set to "user@elsewhere" as you, too, observed, right?
This is what you considered to be a bug.  I don't know if it is one but
you're right that this is not documented in 'message-user-fqdn' nor
'user-mail-address'.

> which should instead only be reserved for message-id's (as the
> description of this variable says. Does it happen somewhere else too?
> this is the second thing to fix).

How to fix something that we don't know about?

>>> The second question is why the From header is ignored (from the
>>> message as saved in 'queued email folder') when sending with
>>> smtpmail-send-queued-mail. This is really worrisome!
>
> This looks like another bug.
>
>> Yes, this is something else but I imagine that
>> 'smtpmail-send-queued-mail' respect 'user-mail-address'.
>
> so first of all, it probably does, in the sense that in my case it
> uses user@fedora, so message-user-fqdn does not intervene (silver
> lining). But it should use what I decided to set as header, not
> rewrite the headers without warning!

Yes, probably.  I'm not queuing mail so I should try it first.

>>>  By the way because you ask, the reason why I change the From header
>>>  is that I use a variety of different email addresses for the
>>>  different affiliations which I have.
>> I do this too and it is just a matter of changing
>> 'user-mail-address'
>> and 'smtpmail-smtp-server'.
>
> No, I don't want to change the variable every time!!

It could be just a command away ;-) but…

> I want to keep that variable for the default address, and change the
> headers as I need.

…fair enough too.

> And anyway, why this discrepancy between queued-sending and
> immediate sending? This I consider another bug, because not doing
> things consistently confuses the user (even not doing the *wrong*
> thing consistently confuses the user)

Yes, this is your second bug then.  I'll also try to test with queuing
message.

> smtpmail-smtp-server can stay always the same because mine allows
> spoofing.

Ok.

> I think I will file a few bug reports today

Yes, please do so!
-- 
Manuel Giraud



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: smtpmail-send-queued-mail fails with error 504 5.5.2
  2024-01-24 13:02         ` Manuel Giraud via Users list for the GNU Emacs text editor
@ 2024-01-24 14:26           ` rameiko87
  2024-01-24 16:46             ` Manuel Giraud via Users list for the GNU Emacs text editor
  0 siblings, 1 reply; 8+ messages in thread
From: rameiko87 @ 2024-01-24 14:26 UTC (permalink / raw)
  To: Manuel Giraud; +Cc: help-gnu-emacs

>> which should instead only be reserved for message-id's (as the
>> description of this variable says. Does it happen somewhere else too?
>> this is the second thing to fix).
> 
> How to fix something that we don't know about?

Is there any way to check where the variable message-user-fqdn is being 
used?

Also, I understand from your messages that when message-user-fqdn is nil 
then the Message-ID's are built with domain set to the value of the 
domain in user-mail-address, no matter whether this is a valid address 
or not. In the preceding sentence, by domain I mean everything to the 
right of the at-sign. Is this correct?

When I set message-user-fqdn instead, are the Message-ID's always built 
by using the message-user-fqdn regardless of the value of 
user-mail-address?

And then when message-user-fqdn is nil and user-mail-address is the 
default (that is user@fedora), then does Message Mode attempt sending to 
this invalid email address and shows an error, or does it modify the To: 
to some valid email address?



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: smtpmail-send-queued-mail fails with error 504 5.5.2
  2024-01-24 14:26           ` rameiko87
@ 2024-01-24 16:46             ` Manuel Giraud via Users list for the GNU Emacs text editor
  0 siblings, 0 replies; 8+ messages in thread
From: Manuel Giraud via Users list for the GNU Emacs text editor @ 2024-01-24 16:46 UTC (permalink / raw)
  To: rameiko87; +Cc: help-gnu-emacs

rameiko87@posteo.net writes:

>>> which should instead only be reserved for message-id's (as the
>>> description of this variable says. Does it happen somewhere else too?
>>> this is the second thing to fix).
>> How to fix something that we don't know about?
>
> Is there any way to check where the variable message-user-fqdn is
> being used?

Yes.  I've just used 'M-x rgrep' on Emacs lisp source.

> Also, I understand from your messages that when message-user-fqdn is
> nil then the Message-ID's are built with domain set to the value of
> the domain in user-mail-address, no matter whether this is a valid
> address or not.

Yes and it is a bit more complicated than that.  You can find the
precedence order for the chosen domain in 'message-make-fqdn' in
"message.el"

> In the preceding sentence, by domain I mean everything to the right of
> the at-sign. Is this correct?

Yes.

> When I set message-user-fqdn instead, are the Message-ID's always
> built by using the message-user-fqdn regardless of the value of
> user-mail-address?

Yes (likewise see 'message-make-fqdn').

> And then when message-user-fqdn is nil and user-mail-address is the
> default (that is user@fedora), then does Message Mode attempt sending
> to this invalid email address and shows an error, or does it modify
> the To: to some valid email address?

I guess you meant the "From:" here.  And, yes, as you can see in my
tests (and also yet again in 'message-make-fqdn'), it rewrites
"user@fedora" as "user@fedora.mail-host-address-is-not-set".
-- 
Manuel Giraud



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-01-24 16:46 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-21 18:01 smtpmail-send-queued-mail fails with error 504 5.5.2 rameiko87
2024-01-22 13:39 ` Manuel Giraud via Users list for the GNU Emacs text editor
2024-01-23 16:51   ` rameiko87
2024-01-24  9:07     ` Manuel Giraud via Users list for the GNU Emacs text editor
2024-01-24 10:57       ` rameiko87
2024-01-24 13:02         ` Manuel Giraud via Users list for the GNU Emacs text editor
2024-01-24 14:26           ` rameiko87
2024-01-24 16:46             ` Manuel Giraud via Users list for the GNU Emacs text editor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).