Add support for servers that only have IMAP servers and no SMTP servers
Categories
(Thunderbird :: Account Manager, enhancement)
Tracking
(Not tracked)
People
(Reporter: GNUtoo, Unassigned)
Details
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0
Steps to reproduce:
First try:
- I started with a fresh configuration
- I started adding a mail account
- I clicked on Manual config
- I selected IMAP and added manually the right settings
Actual results:
When doing that, Outgoing is set to SMTP, and there is no drop down menu with "No SMTP" available. Though in Authentication you can select "No Authentication".
Expected results:
- A way to disable SMTP should be available
- It should also be possible to disable it in the automatic configuration XML
| Reporter | ||
Comment 1•6 years ago
|
||
I've also tried that with the following configuration XML:
<?xml version="1.0" encoding="UTF-8"?>
<clientConfig version="1.1">
<emailProvider id="replicant.us">
<domain>replicant.us</domain>
<displayName>Replicant Mail</displayName>
<displayShortName>Replicant</displayShortName>
<incomingServer type="imap">
<hostname>imap.replicant.us</hostname>
<port>143</port>
<socketType>SSL</socketType>
<authentication>password-encrypted</authentication>
<username>%EMAILADDRESS%</username>
</incomingServer>
<documentation url="https://redmine.replicant.us/projects/replicant-infrastructure/wiki/">
<descr lang="en">Replicant infrastructure documentation page</descr>
</documentation>
<documentation url="ihttps://redmine.replicant.us/projects/replicant-infrastructure/wiki/ContactAddress">
<descr lang="en">IMAP settings</descr>
</documentation>
</emailProvider>
</clientConfig>
I've done the DNS setup and all that, and I verified with the error console that it was downloaded right, and I've the following:
2020-06-02 02:37:26 mail.setup INFO call 2 took 2312ms and succeeded at <http://autoconfig.replicant.us/mail/config-v1.1.xml>
2020-06-02 02:37:26 mail.setup INFO call 1 took 2334ms and failed with Need proper <outgoingServer> in XML file
The advantage of the XML method here is it's faster to reproduce.
I then went to look at the JavaScript code that creates that error and handles the parsing of the hostnames: https://hg.mozilla.org/comm-central/file/tip/mail/components/accountcreation/content/readFromXML.js#l317
I then looked at more code to see if it was possible to pass it some special values that would make it skip the SMTP server, like None for the hostname, unfortunately this cannot work: If I understand well, the hostname is sanitized by calling the sanitize.hostname(oX.hostname); here: https://hg.mozilla.org/comm-central/file/tip/mail/components/accountcreation/content/readFromXML.js#l226
It's probably implemented by this function: https://hg.mozilla.org/comm-central/file/tip/mail/components/accountcreation/content/sanitizeDatatypes.js#l98
which starts by calling cleanUpHostName to remove whitespaces: https://hg.mozilla.org/comm-central/file/tip/mailnews/base/util/hostnameUtils.jsm#l362
It then continue in sanitizeDatatypes.js and checks if the input is a hostname, and ipv4 or ipv6 address with some regexes.
I didn't find any code that could make the absence of SMTP work.
| Reporter | ||
Comment 2•6 years ago
|
||
As for the use case behind having an IMAP server without enabling users to use the SMTP server to send mails: I'm implementing a contact address for the Replicant project (A fully free software Android distribution), and we have a VM in a network that is in an university network.
In order to increase security and reduce maintenance, as we only need to receive email on that address, we have configured an SMTP server to only receive mail and never send any. This way there is much less probability of having our mail server be abused to send mail, and create issues for the whole network.
If we need to respond to mails, we'll simply send from our regular mail address like we did before.
| Reporter | ||
Comment 3•6 years ago
|
||
The bugzilla structure makes it hard for me to fit the bug description in a single "Steps to reproduce / Actual results / Expected results", so I'll re-explain the bug here to make it sure that people can understand it because things are a bit mixed together.
The issue is that I'm trying to find a way to add an account that has an IMAP server but that doesn't have any SMTP server.
The first thing I've tried is trough the the "manually settings" graphical interface to add new mail accounts:
- There is no way to disable the SMTP server here
- Adding bogus hostname won't work as:
- The code will throw an exception if the hostname is empty, or if there are only spaces in it.
- It treat what's in that field as a hostname, IPv4 or IPv6 depending on which regular expression it matches
- For the rest, it will raise an exception
This is why I tried to understand how hostnames were parsed, as explained in "I then looked at more code to see if it was possible to pass it some special values that would make it skip the SMTP server, like None for the hostname [...]"
I also tried the XML file I pasted above, to see if it would work and it failed with: Need proper <outgoingServer> in XML file which is probably from here: https://hg.mozilla.org/comm-central/file/tip/mail/components/accountcreation/content/readFromXML.js#l317 .
After re-reading that code, it could also not have entered the part where it tries to parse the outgoing server directives for (let oX of array_or_undef(xml.$outgoingServer)) { as there aren't any in the XML, and end up without any outgoing hostname.
Note that I am not familiar at all with JavaScript, as I didn't learn nor practice it. I am more used to programming languages C.
| Reporter | ||
Comment 4•6 years ago
|
||
So this brings me to two questions:
- How to represent the absence of outgoingServer in the file format (https://wiki.mozilla.org/Thunderbird:Autoconfiguration:ConfigFileFormat) ? Should no outgoingServer be fine, or should we use something like
<outgoingServer type="none"> </outgoingServer>instead? - How to represent the absence of outgoingServer in the 'manually config'? Would a drop down menu with
SMTPandno SMTPbe added instead of theSMTPlabel? That proposal is based on the following:- There is already an
IMAP/POP3drop down menu - There is a
No authenticationchoice in the Authentication drop down menu.
- There is already an
Denis.
Updated•6 years ago
|
Updated•5 years ago
|
Description
•