mutt-ical
mutt-ical copied to clipboard
fix paging if sendmail command writes to file
When using Msmtpq instead of Msmtp, this command
https://github.com/marvinthepa/mutt-ical/blob/cba522e6de66d34d4e215fdcd0707e21f7970562/mutt-ical.py#L224
seems to send the mail through a pager (maybe of interest that $LESSOPEN = | lesspipe.sh %s
using bat
at times) , so that the lines in the mail file in ~/.msmtp.queue
are all numbered.
With Msmtp this mutt-ical.py (used for answering appointment requests under Mutt) works fine.
Since this seems rather odd to me, any explications are welcome.
The sendmail
command, either string or function reference, confused the script.
In line 222 there was
Incompatible types in assignment (expression has type "str | None", target has type "str | Header")
once commented out, there was no more paging.
The crucial fix seems to be
sendmail = lambda: arg.split() # If -s is provided, override sendmail with a lambda that returns the command
instead of
sendmail = arg.split()