LukeSmithxyz / mutt-wizard

A system for automatically configuring mutt and isync with a simple interface and safe passwords
GNU General Public License v3.0
2.38k stars 378 forks source link

send fails with child exit 127 #156

Closed Valansch closed 5 years ago

Valansch commented 5 years ago

Hi when i try to send emails i get an error in the footer bar:

error sending message, child exited 127 (Exec error.).

I installed sendmail and set smtp_url and pass as suggested here

But that didnt change anything.

uname -a Linux username-manjaro 5.0.7-1-MANJARO #1 SMP PREEMPT Sat Apr 6 08:50:27 UTC 2019 x86_64 GNU/Linux

pacman -Qe

acpid 2.0.31-1
alsa-firmware 1.0.29-2
alsa-utils 1.1.8-1
android-tools 9.0.0_r30-2
android-udev 20190315-1
appimagelauncher 1.2.2-3
ark 18.12.3-1
autoconf 2.69-5
automake 1.16.1-1
avahi 0.7+18+g1b5f401-1
b43-fwcutter 019-2
bash 5.0.002-1
binutils 2.31.1-4
bison 3.3.2-1
bluedevil 1:5.15.4-1
btrfs-progs 4.20.2-1
bzip2 1.0.6-8
calligra 3.1.0-16
chromium 73.0.3683.103-2
coreutils 8.31-1
cpupower 5.0-1
crda 4.14-2
cronie 1.5.4-1
cryptsetup 2.1.0-1.1
cups 2.2.11-1
cups-pdf 3.0.1-4
cups-pk-helper 0.2.6-3
device-mapper 2.02.184-3
dhclient 4.4.1-4
dhcpcd 7.0.8-1
diffutils 3.7-1
dmidecode 3.2-1
dmraid 1.0.0.rc16.3-11
dnsmasq 2.80-3
dolphin 18.12.3-1
dolphin-plugins 18.12.3-1
dosfstools 4.1-2
e2fsprogs 1.45.0-1
ecryptfs-utils 111-3
efibootmgr 16-1
entr 4.2-1
exfat-utils 1.3.0-1
f2fs-tools 1.12.0-2
fakeroot 1.23-1
feh 3.1.3-1
ffmpeg 1:4.1.2-2
ffmpegthumbs 18.12.3-1
file 5.36-1
filelight 18.12.3-1
filesystem 2018.9-1
findutils 4.6.0-4
firefox 66.0.3-1
flatpak 1.3.1-1
flex 2.6.4-2
gawk 4.2.1-2
gcc 8.2.1+20181127-1
gcc-libs 8.2.1+20181127-1
gettext 0.19.8.1-3
ghostscript 9.27-1
git 2.21.0-1
glibc 2.28-5
gnome-icon-theme 3.12.0-5
gnome-themes-extra 3.28-1
gnu-netcat 0.7.1-7
gparted 0.33.0-1
grep 3.3-1
grub 2.03.5-1
grub-customizer 5.1.0-1
grub-theme-manjaro 18.0-1
gsfonts 20180524-2
gst-libav 1.14.4+2+gc324028-1
gst-plugins-bad 1.14.4+22+ge87fb02c1-1
gst-plugins-base 1.14.4+18+g3cc7cc757-1
gst-plugins-good 1.14.4-2
gst-plugins-ugly 1.14.4-2
gtk-theme-breath 5.9.0-1
gtk3 1:3.24.8-1
gvfs 1.40.1-1
gvfs-afc 1.40.1-1
gvfs-gphoto2 1.40.1-1
gvfs-mtp 1.40.1-1
gvfs-nfs 1.40.1-1
gvfs-smb 1.40.1-1
gwenview 18.12.3-1
gzip 1.10-1
handbrake 1.2.2-2
hashcat 1:5.1.0-1
haveged 1.9.4-3
hplip 1:3.19.3-1
htop 2.2.0-2
illyria-wallpaper 1.4-1
imagewriter 1.10.1420800585.134a9b3-4
inetutils 1.9.4-7
intel-ucode 20190312-1
inxi 3.0.32-1
iproute2 5.0.0-1
iptables 1:1.8.2-1
iputils 20180629.f6aac8d-4
ipw2100-fw 1.3-9
ipw2200-fw 3.1-7
isync 1.3.0-2
jfsutils 1.1.15-6
jre8-openjdk 8.u212-1
kaccounts-providers 18.12.3-1
kamera 18.12.3-1
kate 18.12.3-1
kcalc 18.12.3-1
kde-gtk-config 5.15.4-1
kde-servicemenus-rootactions 2.9.1-1
kdeconnect 1.3.4-1
kdegraphics-thumbnailers 18.12.3-1
kdenetwork-filesharing 18.12.3-1
kdeplasma-addons 5.15.4-1
keditbookmarks 18.12.3-1
keepassxc 2.4.1-1
kfind 18.12.3-1
kgamma5 5.15.4-1
kget 18.12.3-1
khelpcenter 18.12.3-1
kimageformats 5.56.0-1
kinfocenter 5.15.4-1
kio-extras 18.12.3-2
kmenuedit 5.15.4-1
konsole 18.12.3-1
konversation 1.7.5-1
kscreen 5.15.4-1
kscreenlocker 5.15.4-1
ksshaskpass 5.15.4-1
ksysguard 5.15.4-1
ksystemlog 18.12.3-1
kwallet-pam 5.15.4-2
kwalletmanager 18.12.3-1
kwayland-integration 5.15.4-1
kwin 5.15.4-1
kwrited 5.15.4-1
less 530-1
lib32-flex 2.6.4-2
lib32-libcanberra 0.30+2+gc0620e4-1
lib32-libcanberra-pulse 0.30+2+gc0620e4-1
lib32-libva-intel-driver 2.3.0-1
lib32-libva-mesa-driver 19.0.2-1
lib32-libva-vdpau-driver 0.7.4-6
lib32-mesa-demos 8.4.0-1
lib32-mesa-vdpau 19.0.2-1
lib32-nvidia-utils 1:418.56-1
lib32-vulkan-intel 19.0.2-1
lib32-vulkan-radeon 19.0.2-1
libcanberra 0.30+2+gc0620e4-2
libcanberra-gstreamer 0.30+2+gc0620e4-2
libcanberra-pulse 0.30+2+gc0620e4-2
libdvdcss 1.4.2-1
libktorrent 2.1-1
libreoffice-fresh 6.2.2-4
libtool 2.4.6+42+gb88cebd5-2
libva-intel-driver 2.3.0-2
libva-mesa-driver 19.0.2-1
libva-vdpau-driver 0.7.4-4
licenses 20181104-1
linux-firmware 20190313.efd2c1c-1
linux419 4.19.34-1
linux419-nvidia 1:418.56-1
linux419-r8168 8.045.08-29
linux50 5.0.7-1
linux50-nvidia 1:418.56-1
linux50-r8168 8.045.08-5
logrotate 3.15.0-1
lsb-release 1.4-12
lvm2 2.02.184-4
m4 1.4.18-2
make 4.2.1-3
man-db 2.8.5-2
man-pages 5.00-1
manjaro-alsa 2012.11-1
manjaro-browser-settings 20181222-1
manjaro-documentation-en 20181009-1
manjaro-firmware 20160419-1
manjaro-hello 0.6.1-1
manjaro-hotfixes 2018.08-6
manjaro-kde-settings 20180902-1
manjaro-pulse 2012.11-1
manjaro-release 18.0.4-1
manjaro-settings-manager-kcm 0.5.5-7
manjaro-settings-manager-knotifier 0.5.5-7
manjaro-system 20190124-3
manjaro-wallpapers-18.0 1.4-3
mdadm 4.0-2
mediainfo 18.12-1
megasync 4.0.2-1
memtest86+ 5.01-3
mesa-demos 8.4.0-1
mesa-vdpau 19.0.2-1
mhwd 0.6.3-1
mhwd-db 0.6.3-6
milou 5.15.4-1
minecraft-launcher 2.1.2482-1
mkinitcpio-openswap 0.1.0-2
mobile-broadband-provider-info 20190116-1
modemmanager 1.10.0-1
mpv 1:0.29.1-5
ms-office-online 18.04.4-2
msr-tools 1.3-3
mtpfs 1.1-3
mupdf 1.14.0-1
mutt 1.11.4-1
nano 4.0-2
neofetch 6.0.0-1
networkmanager 1.16.0-1
networkmanager-openconnect 1.2.5dev+110+g524a2e0-2
networkmanager-openvpn 1.8.10-1
networkmanager-pptp 1.2.9dev+10+gb41b0d0-1
networkmanager-vpnc 1.2.7dev+20+gdca3aea-1
nfs-utils 2.3.3-1
noto-fonts 20190111-1
noto-fonts-emoji 20180810-2
nss-mdns 0.14.1-1
ntfs-3g 2017.3.23-3
ntp 4.2.8.p13-2
numlockx 1.2-4
nvidia-utils 1:418.56-1
octopi 0.9.0-6
octopi-cachecleaner 0.9.0-6
octopi-notifier-frameworks 0.9.0-6
octopi-repoeditor 0.9.0-6
okular 18.12.3-1
openresolv 3.9.0-2
openssh 7.9p1-1.1
os-prober 1.76-2
p7zip 16.02-5
pacman 5.1.3-1
partitionmanager 3.3.1-1
pass 1.7.3-1
patch 2.7.6-7
patchutils 0.3.4-3
pciutils 3.6.2-1
pdfgrep 2.1.2-1
perl 5.28.1-1
perl-file-mimeinfo 0.29-1
phonon-qt5-gstreamer 4.9.0-5
pkgconf 1.6.1-1
plasma-desktop 5.15.4-1
plasma-nm 5.15.4-1
plasma-pa 5.15.4-1
plasma-workspace 5.15.4-1
plasma-workspace-wallpapers 5.15.4-1
plasma5-themes-breath 0.4.0-1
poppler-data 0.4.9-1
powerdevil 5.15.4-1
powertop 2.10-1
print-manager 18.12.3-1
procps-ng 3.3.15-1.2
psmisc 23.2-1
pulseaudio-bluetooth 12.2-2
pulseaudio-ctl 1.66-1
pulseaudio-zeroconf 12.2-2
pyqt5-common 5.12.1-1
python-pillow 6.0.0-1
python-pip 19.0.3-1
python-pyqt5 5.12.1-1
python-pysmbc 1.0.15.8-2
python-reportlab 3.5.13-1
qt5-imageformats 5.12.2-1
qt5-virtualkeyboard 5.12.2-1
ranger 1.9.2-1
reiserfsprogs 3.6.27-2
rsync 3.1.3-1
ruby 2.6.2-1
s-nail 14.9.13-2
samba 4.10.2-1
screenfetch 3.8.0.r107.g522c9c0-1
sddm 0.18.1-1
sddm-breath-theme 0.4.0-1
sddm-kcm 5.15.4-1
sed 4.7-1
shadow 4.6-2
skanlite 2.1.0.1-1
sl 5.02-5
spectacle 18.12.3-1
spectre-meltdown-checker 0.37-1
splix 2.0.0-14
spotify 1:1.0.98.78-2
sshfs 3.5.1-2
st-manjaro 1:0.8.1.r3.g041912a-1
steam-manjaro 1.0.0.56-2
subversion 1.11.1-1
sudo 1.8.27-1
sysfsutils 2.1.0-10
system-config-printer 1.5.11-4
systemd-fsck-silent 239-1
systemd-kcm 1.2.1-3
systemd-sysvcompat 241.607-1
systemsettings 5.15.4-1
tar 1.32-1
telegram-desktop 1.6.3-1
terminus-font 4.47-2
texinfo 6.6-1
texlive-bibtexextra 2018.50004-1
texlive-core 2018.50036-1
texlive-fontsextra 2018.50019-1
texlive-formatsextra 2018.48634-1
texlive-games 2018.49602-1
texlive-humanities 2018.49792-1
texlive-latexextra 2018.50031-1
texlive-music 2018.49818-1
texlive-pictures 2018.50020-1
texlive-pstricks 2018.49908-1
texlive-publishers 2018.50030-1
texlive-science 2018.50013-1
thunderbird 60.6.1-2
tlp 1.2.1-1.0
tor 0.3.5.8-1
tor-browser 8.0.8-1
torsocks 2.3.0-1
ttf-bitstream-vera 1.10-12
ttf-droid 20121017-6
ttf-inconsolata 1:2.0.0.1-3
ttf-indic-otf 0.2-9
ttf-liberation 2.00.5-1
udiskie 1.7.7-1
udisks2 2.8.2-1
unarchiver 1.10.1-7
unzip 6.0-13
usb_modeswitch 2.5.2-1
usbutils 010-1
user-manager 5.15.4-1
util-linux 2.33.2-1
veracrypt 1.23-1
vi 1:070224-3
vim 8.1.1073-1
vim-plug 0.10.0-1
vlc-nightly 3.0.5v20181009-1
vulkan-intel 19.0.2-1
vulkan-radeon 19.0.2-1
wallpapers-2018 1.0-1
wget 1.20.3-1
which 2.21-3
wpa_supplicant 2:2.6-2
xdg-su 1.2.3-1
xdg-user-dirs 0.17-2
xdg-utils 1.1.3-3
xf86-input-elographics 1.4.1-8
xf86-input-evdev 2.10.6-1
xf86-input-keyboard 1.9.0-3
xf86-input-libinput 0.28.2-1
xf86-input-mouse 1.9.3-1
xf86-input-void 1.4.1-4
xf86-video-amdgpu 19.0.1-1
xf86-video-ati 1:19.0.1-1
xf86-video-intel 1:2.99.917+863+g6afed33b-1
xf86-video-nouveau 1.0.16-1
xfsprogs 4.20.0-2
xorg-server 1.20.4-1
xorg-twm 1.0.10-1
xorg-xinit 1.4.1-1
xorg-xkill 1.0.5-1
yakuake 3.0.5-1
zip 3.0-8
zsh 5.7.1-1

How i got here

sudo pacman -S neomutt
git clone https://github.com/LukeSmithxyz/mutt-wizard
cd mutt-wizard
sudo make install

mkdir -p /usr/bin cp -f bin/mw /usr/bin chmod 755 /usr/bin/mw cp -f bin/openfile /usr/bin chmod 755 /usr/bin/openfile cp -f bin/muttimage /usr/bin chmod 755 /usr/bin/muttimage cp -f bin/mailsync /usr/bin chmod 755 /usr/bin/mailsync mkdir -p /usr/share/mutt-wizard mkdir -p /usr/share/man/man1 cp -f mailcap /usr/share/mutt-wizard cp -f mutt-wizard.muttrc /usr/share/mutt-wizard cp -f domains.csv /usr/share/mutt-wizard cp -f mw.1 /usr/share/man/man1/mw.1

mw add
...

Creating profiles for profilename...DONE. muttrc created. Mailboxes detected. Setting default mailboxes for your Inbox, Sent, Drafts and Trash in mutt... Setting up your keyboard shortcuts for jumping between mailboxes... All done. You should now be able to run mbsync profilename to begin to download your mail.

mbsync profilename
neomutt
LukeSmithxyz commented 5 years ago

This wizard is for neomutt. Your errors are all related to non-vanilla-mutt settings. Try with neomutt and see if any problems persist.

Valansch commented 5 years ago

Thanks for the reply. Sorry about that, you're right. Now I installed neomutt and the errors are gone. However i still cannot send. Note: I edited my original post.

LukeSmithxyz commented 5 years ago

What is the domain name of your email? Were the server settings auto-produced by the wizard or did you have to input them manually? It might be that the SMTP server info was wrong either way.

LukeSmithxyz commented 5 years ago

Actually I should ask if you reverted sendmail to what the mutt-wizard originally produced.

mikeziri commented 5 years ago

I have the same error on macos (shame on me I know) and still couldn't figure out why. I though it was because there wasn't a muttrc setting for sendmail: set sendmail="/usr/local/bin/msmtp" note the /usr/local/bin is from brew installation still doesn't work (not in ~/.muttrc nor /usr/local/share/mutt-wizzard/.muttrc (default) nor ~/.config/mutt/muttrc

the mw isn't too friendly with macos but I got it to work. will leave it here my workarounds if anyone is struggling and want to give it a try here is my GUIDE

I assume you have brew installed

  1. after cloning this repo, edit Makefile and change the PREFIX to PREFIX = /usr/local
  2. install dependencies: brew install neomutt isync msmtp pass gpg
  3. install make install
  4. edit mw to change a few hardcoded paths vim $(which mw) find muttshare and set it to: muttshare="/usr/local/share/mutt-wizard" samething for mwconfig: mwconfig="/usr/local/share/mutt-wizard/.muttrc" 4a. on of make install commands is: cp -f mutt-wizard.muttrc $(DESTDIR)$(PREFIX)/share/mutt-wizard which, on macos doesn't create ../share/mutt-wizard/.muttrc but ../share/mutt-wizard/mutt-wizard.muttrc so you have to rename it to /usr/local/share/mutt-wizard/.muttrc
  5. about certificates: on /etc/ssl there's a cert.pem file which should be fine. I had to symlink it to /etc/ssl/certs/ca-certificates.crt so: sudo ln -s /etc/ssl/cert.pem /etc/ssl/certs/ca-certificates.crt although I found out later you don't need this as SystemCertificate is already in use.
  6. setup gpg if you haven't already in the past gpg --full-gen-key
  7. setup pass if you haven't already in the past pass init <mail>
  8. mw add and follow the program's instructions. it should fail with gmail though it was because of certificate and removed the CertificateFile entry on ~/.mbsyncrc. tried to setup an old Gmail account with no success at first. I have 2fa turned on and had to generate an "App password" as Luke mentioned. but also, had to through AuthMechs LOGIN in ~/.mbsyncrc for it to work you can also download any certificate for your connecting imaps server with mbsync-get-cert imap.gmail.com (change imap.gmail.com with yours of course). after AuthMechs LOGIN I could finally do: mbsync -l gmail with success (called my account "gmail" during mw setup)
  9. download email with: mbsync gmail
  10. run neomutt
  11. DONE

though I can't send email :P any tips?

LukeSmithxyz commented 5 years ago

I recommend both of you and anyone else who has problems to attempt to send mail directly with msmtp. This error come in mutt is based off the fact that there was some error in the send mail command so running msmtp will be more specific about the problem:

echo "test" | msmtp -a accountname your@email.addr

Note that the email won't be read in the current mw/neomutt config correctly without a header, but just see if it sends.

mikeziri commented 5 years ago

good idea. my response:

msmtp: envelope from address <from_email> not accepted by the server msmtp: server message: 530 5.7.0 Must issue a STARTTLS command first. p8sm17826413wrx.62 - gsmtp msmtp: could not send mail (account <account_name> from /Users/user/.config/msmtp/config)

also my ~/.config/msmtp/config file: account <account_name> host smtp.gmail.com port 587 from <email_addr> user <email_addr> passwordeval "pass mutt-wizard-<account_name>"

LukeSmithxyz commented 5 years ago

Eh, hmm. I suppose you could manually add tls_starttls on to ~/.config/msmtp/config, although that setting should be active by default... I suppose it's possible that it isn't on Mac.

Actually shoot, there was a hardcoded certificate name in the ~/.config/msmtp/config file, you might want to change it to the Mac version. I doubt if that would make a difference if you linked it though.

mikeziri commented 5 years ago

got it to work with gmail with these additional settings on ~/.config/msmtp/config auth login tls on tls_starttls on

as you said, the last two ar on by default. reading the manual, auth login instead of plain is the one to use with gmail at least.

thank you.

will try my luck with proton mail + bridge

mikeziri commented 5 years ago

my success was within the terminal with plaing msmtp as you suggested:

echo "test" | msmtp -a accountname your@email.addr

can't seem to send via neomutt as it doesn't set the "current" account when sending and so, msmtp says (when sending, via neomutt): msmtp: account default not found in /Users/<user>/.config/msmtp/config

should I have the config say, account default instead of my set with mw add?

LukeSmithxyz commented 5 years ago

You changed your sendmail variable above, right? That would be the problem.

It should be

set sendmail = "/usr/bin/msmtp -a ACCTNAME"

EDIT: I.e. that should be in your account-specific muttrc in the accounts/ directory.

LukeSmithxyz commented 5 years ago

@mikeziri On further reading, I think you having to say auth login might be a result of a "weird" character in your password. Seems like most of the options have to do with encoding and other people have had problems based on their particular passwords.

Did you try it with auth plain?

mikeziri commented 5 years ago

so I think I finally understood how all this programs are connected. didn't see the mutt accounts configs but now when you mentioned it.

the exit code 127 refers to the program I guess. it couldn't find /usr/bin/msmtp as brew on macos installs it in /usr/local/bin/msmtp.

as I set an override it couldn't find the account as you said, because the correct command (although with the wrong generated path) was on the accounts/config file. updating msmtp's path did the trick.

then neomutt gave me the same error as before (when running it on the cli) because I had no auth login

after reading your comment (https://github.com/LukeSmithxyz/mutt-wizard/issues/156#issuecomment-486889285) I tried with auth plainand it also works.

I still had to keep tls on but no need for tls_starttls onthough.

tnx

LukeSmithxyz commented 5 years ago

Ah! That's the problem! The msmtp location is hardcoded! Okay, this can be fixed.

Now the question is, if you have the default setting of auth on, does it work? I suspect it actually should as on is a superset of the other options.

LukeSmithxyz commented 5 years ago

I'll go ahead and ask, if you replace /usr/bin/msmtp (in the muttrc) with just msmtp, does it work on Mac OS?

mikeziri commented 5 years ago

I'll go ahead and ask, if you replace /usr/bin/msmtp (in the muttrc) with just msmtp, does it work on Mac OS?

yes it does.

it should be fine. also $(which msmtp) -a ... shoud be the same

mikeziri commented 5 years ago

Ah! That's the problem! The msmtp location is hardcoded! Okay, this can be fixed.

Now the question is, if you have the default setting of auth on, does it work? I suspect it actually should as on is a superset of the other options.

without auth directive it gives:

msmtp: envelope from address <email_from> not accepted by the server msmtp: server message: 530-5.5.1 Authentication Required. Learn more at msmtp: server message: 530 5.5.1 https://support.google.com/mail/?p=WantAuthError h12sm21367442wrq.95 - gsmtp

so auth onisn't a default here. but adding auth on instead of plain or login, works fine!

LukeSmithxyz commented 5 years ago

I mean that auth on is added automatically by mutt-wizard. Either way, it seems like your issue is resolved.

I suspect that @Valansch 's issue is him changing the smtp_url when encountering those error messages. That's what his original editted post would lead me to believe.

mikeziri commented 5 years ago

I mean that auth on is added automatically by mutt-wizard. Either way, it seems like your issue is resolved.

in which file?

LukeSmithxyz commented 5 years ago

~/.config/msmtp/config. Is that not what you were editing?

mikeziri commented 5 years ago

I see. I must've edit the file. just checked the source code and it only does it first time (if the file doesn't exist). so I must have lost those configs from $msmtp_header var.

tnx.

Valansch commented 5 years ago

@LukeSmithxyz i'm an idiot, sorry for wasting your time. I hadn't had msmtp installed, even though you clearly state it is as a dependency. Thanks for your help anyways.

An a related note: What do you think about printing a warning on execution of mw if any dependency is missing?