Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] Attachments saved under ~/home/<user>/snap/prospect-mail/<version>/Download as default #257

Closed
Gvald opened this issue Jan 22, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@Gvald
Copy link

Gvald commented Jan 22, 2023

As in the title, attachments default to be saved under ~/home/<user>/snap/prospect-mail/<version>/Download, instead of ~/home/<user>/Download folder.

There's config user-dirs.dirs file in place, which contains:

XXXX$: ~/snap/prospect-mail/22/.config  bat user-dirs.dirs 
───────┬────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
       │ File: user-dirs.dirs
───────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
   1   │ # This file is written by xdg-user-dirs-update
   2   │ # If you want to change or add directories, just edit the line you're
   3   │ # interested in. All local changes will be retained on the next run.
   4   │ # Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped
   5   │ # homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an
   6   │ # absolute path. No other format is supported.
   7   │ # 
   8   │ XDG_DESKTOP_DIR="$HOME/Desktop"
   9   │ XDG_DOWNLOAD_DIR="$HOME/Downloads"
  10   │ XDG_TEMPLATES_DIR="$HOME/Templates"
  11   │ XDG_PUBLICSHARE_DIR="$HOME/Public"
  12   │ XDG_DOCUMENTS_DIR="$HOME/Documents"
  13   │ XDG_MUSIC_DIR="$HOME/Music"
  14   │ XDG_PICTURES_DIR="$HOME/Pictures"
  15   │ XDG_VIDEOS_DIR="$HOME/Videos"
───────┴────────────────────────────────────────────────────────────────────────

This apparently doesn't help, and attachments still defaults to the above.

Attached screenshot:
prospect_mail_save

System info

cat /etc/lsb-release
───────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
   1   │ DISTRIB_ID=Ubuntu
   2   │ DISTRIB_RELEASE=22.04
   3   │ DISTRIB_CODENAME=jammy
   4   │ DISTRIB_DESCRIPTION="Ubuntu 22.04.1 LTS"
XXXX$: snap info prospect-mail 
name:      prospect-mail
summary:   Unofficial Outlook client
publisher: Julian Alarcon (alarconj)
store-url: https://snapcraft.io/prospect-mail
contact:   https://github.com/julian-alarcon
license:   unset
description: |
  Unofficial Outlook client using Electron. It uses the Web App and wraps it as a standalone
  application using Electron.
  This **only works for Microsoft/Office 365 accounts **, don't use it for personal Outlook.com
  accounts.
  
  It has **NO DIRECT AFFILIATION** with Microsoft, Microsoft 365 or any product by Microsoft.
commands:
  - prospect-mail
snap-id:      ayYEnTUxxxxxkzAcSRM
tracking:     latest/stable
refresh-date: 2022-04-05
channels:
  latest/stable:    0.4.0 2021-12-13 (22) 85MB -
  latest/candidate: ↑                          
  latest/beta:      ↑                          
  latest/edge:      0.4.0 2021-12-13 (22) 85MB -
installed:          0.4.0            (22) 85MB -
@Dano-drevo
Copy link

I have a similar issue but not exactly the same:
When downloading attachments, I often want to store them to /tmp. When choosing the /tmp/ directory from the menu, the file is downloaded to /tmp/snap-private-tmp/snap.prospect-mail/tmp/ (which is also a protected folder and I need to type in my credentials 2 times in order to access it).

It only happens when trying to download to the /tmp AFAIK. With other directories I've tried, it worked.
I am using Ubuntu 22.04.2 LTS.

@julian-alarcon
Copy link
Owner

julian-alarcon commented Sep 18, 2023

Can you try with the latest beta version (0.5-beta1)?
sudo snap install prospect-mail --channel=beta

Also available here in other packages: https://github.com/julian-alarcon/prospect-mail/releases/tag/v0.5.0-beta1

@julian-alarcon julian-alarcon added the pending-response Pending for a response, if no response is obtained it will be close label Sep 19, 2023
@Dano-drevo
Copy link

I've tried the latest version. I could not simulate the default download location behavior as there was always a "download prompt" asking me for the desired download location. I confirm that when ~/Downloads was selected, the file(s) was properly downloaded to the correct location.

Maybe @Gvald can verify this as it was them who initially raised this particular issue.

However, regarding my own, slightly different issue, the new version didn't fix it.
I even created a symlink ~/temp -> /tmp and when tried to store to ~/temp the client still stored the file(s) to /tmp/snap-private-tmp/snap.prospect-mail/tmp as always.

It's almost as if the client automatically expands any /tmp/* path to its dedicated snap's tmp folder.
This is further supported by the fact, that one can not whatsoever access the /tmp directory from the download prompt window (the displayed chosen directory and its content is always that of /tmp/snap-private-tmp/snap.prospect-mail/tmp when /tmp is selected).

@julian-alarcon
Copy link
Owner

Got it! It seems that saving files in /tmp is forbidden by design in snap apps. So, there is a bug reported related to this (https://bugs.launchpad.net/snapd/+bug/1972762), but I don't think that they will make any change to it.

More info about this here:
https://askubuntu.com/questions/1188811/snap-how-to-grant-tmp-access-to-snap-chromium
https://forum.snapcraft.io/t/ubuntu-chromium-where-is-my-tmp-directory/14862/5

I will close this ticket as it's related with the ~/Download directory and it was fixed in version #288

@julian-alarcon julian-alarcon added bug Something isn't working and removed pending-response Pending for a response, if no response is obtained it will be close labels Sep 21, 2023
@Dano-drevo
Copy link

Thanks for links. That is an interesting design for snap to say the least. Suggested workarounds are an overkill for the possibility to download files from the mail client directly to /tmp .

Knowing that this is an "issue" with the snap, I've reinstalled the prospect-mail using .deb package and voila, it works as intended.

Thank you for your responses Julian.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants