From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 27010 invoked from network); 16 Dec 2020 18:09:09 -0000 Received: from mx1.math.uh.edu (129.7.128.32) by inbox.vuxu.org with ESMTPUTF8; 16 Dec 2020 18:09:09 -0000 Received: from lists1.math.uh.edu ([129.7.128.208]) by mx1.math.uh.edu with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1kpbEa-00AHIh-5d for ml@inbox.vuxu.org; Wed, 16 Dec 2020 12:09:08 -0600 Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by lists1.math.uh.edu with smtp (Exim 4.94) (envelope-from ) id 1kpbEZ-0008Xc-HH for ml@inbox.vuxu.org; Wed, 16 Dec 2020 12:09:07 -0600 Received: from mx2.math.uh.edu ([129.7.128.33]) by lists1.math.uh.edu with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1kpbEY-0008XX-TE for ding@lists.math.uh.edu; Wed, 16 Dec 2020 12:09:06 -0600 Received: from quimby.gnus.org ([95.216.78.240]) by mx2.math.uh.edu with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1kpbEX-00GTQr-9w for ding@lists.math.uh.edu; Wed, 16 Dec 2020 12:09:06 -0600 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:Mime-Version:References:Message-ID:Date:Subject: From:To:Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=DbwzAmUCK+jAyusvUAGIUHNRw9lZz6qxNjikoq8j8kw=; b=gMU3EKhQrG5LK1Hfqf3DZi2JEQ NaJQsgrIprAJNZ9emH8e+axINTuU7cWYa0sEWAxUvdgMZlaZhuFJP+lK1Km4G5BRWas3GzVOdJxNW IfRbG/5zUU1ciOmKkB7eb9dO/3i/ZYxmsR0ZTbPht/WEVwfcO1SdBHu86EYwUdmgPMOU=; Received: from ciao.gmane.io ([116.202.254.214]) by quimby.gnus.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kpbER-0003S1-1G for ding@gnus.org; Wed, 16 Dec 2020 19:09:01 +0100 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1kpbEQ-0008Dz-Cp for ding@gnus.org; Wed, 16 Dec 2020 19:08:58 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: ding@gnus.org From: Eric Abrahamsen Subject: Re: download attachment and do chmod for certain files Date: Wed, 16 Dec 2020 10:08:54 -0800 Message-ID: <87ft45vd1l.fsf@ericabrahamsen.net> References: <87v9d2g14c.fsf@zoho.eu> <87mtydvdfn.fsf@ericabrahamsen.net> Mime-Version: 1.0 Content-Type: text/plain User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cancel-Lock: sha1:p2Gwayr0ldY1WYzcGMPeTqfS5lo= List-ID: Precedence: bulk Eric Abrahamsen writes: > Emanuel Berg writes: > >> Every time I get a photo (almost always a .jpg) and I get it >> from the mail location and interface to where I like it on the >> disk and with a proper filename, after that I have to do, e.g., >> 'chmod +r photo.jpg'. >> >> How would you automate this for certain files, say *.jpg ? >> >> So basically if photo.jpg, then chmod +r photo.jpg ? >> >> Non-trivial question I guess, so extra hacker points for >> a solution :) > > The "MIME Commands" part of the Gnus manual mentions the > `gnus-article-mime-part-function' variable (which holds a function) -- > if you look at the description of that, the example usage is very > close to yours. > > What I'm a little confused about is that this would run automatically > *every time you open the message*. This seems fairly inefficient -- I > think in normal mail usage it's very common for users to open messages > multiple times. So whatever function you wrote for that would maybe want > to check somehow if the images had already been saved. > > I expected there would be some sort of "save MIME handle alist" thing > where you could have it automatically kick in when you saved an image, > but I didn't immediately see anything like that. I've studiously avoided > learning anything about Gnus' MIME handling over the years. > > The other solution that comes to mind is using "pipe to part" sorry, "pipe part", that was a typo.