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

fix paging if sendmail command writes to file #20

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

Konfekt
Copy link

@Konfekt Konfekt commented Apr 10, 2024

When using Msmtpq instead of Msmtp, this command

execute(sendmail() + ['--', to], message.as_bytes())

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()

@Konfekt Konfekt force-pushed the main branch 2 times, most recently from ab2caba to 26c743a Compare April 11, 2024 04:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants