How to read file content and send email on Debian Bullseye

Thomas Passin list1 at tompassin.net
Sat Feb 4 23:49:19 EST 2023


On 2/4/2023 10:13 PM, 2QdxY4RzWzUUiLuE at potatochowder.com wrote:
> On 2023-02-04 at 17:59:11 -0500,
> Thomas Passin <list1 at tompassin.net> wrote:
> 
>> On 2/4/2023 10:05 AM, ^Bart wrote:
>>> Hi guys,
>>>
>>> On a Debian Bullseye server I have a lftp upload and after it I should
>>> send an email.
> 
> [...]
> 
>> [...] you could run a shell script that sends the file with lftp, and
>> depending on the return code uses xdg-email to send one of the two
>> messages. This would probably be simpler than using Python.
> 
> xdg-email appears to be for interactive use (it opens the user's
> "preferred email composer"); I think sendmail would work much better
> from a script.
> 
> Otherwise, I had the same initial thought, to add to and/or build a
> wrapper around the existing lftp script.

I have never used it, and I did see that wording in the man page, but it 
also showed putting all the info on the command line - from, to, 
subject, etc - so I thought it might be able to use a command line 
client without needed any GUI interaction.  But I don't know for sure.



More information about the Python-list mailing list