You are not logged in.

#1 2014-12-05 18:27:21

Jonhoo
Member
Registered: 2009-05-23
Posts: 118

getmail + courier-maildrop yields set_color: Could not set up terminal

I've been using getmail and maildrop for a long time, and now suddenly, I get the following output when trying to run getmail:

$ getmail
getmail version 4.46.0
Copyright (C) 1998-2012 Charles Cazabon.  Licensed under the GNU GPL version 2.
SimpleIMAPSSLRetriever:jon@eml.cc@mail.messagingengine.com:993:
Delivery error (command maildrop 5492 wrote to stderr: set_color: Could not set up terminal
set_color: Could not set up terminal
set_color: Could not set up terminal
set_color: Could not set up terminal
set_color: Could not set up terminal
set_color: Could not set up terminal
sed: -e expression #1, char 1: unknown command: `-')
  msg 15/70 (1906635 bytes), delivery error (command maildrop 5492 wrote to stderr: set_color: Could not set up terminal
set_color: Could not set up terminal
set_color: Could not set up terminal
set_color: Could not set up terminal
set_color: Could not set up terminal
set_color: Could not set up terminal
sed: -e expression #1, char 1: unknown command: `-')
...

I have not changed my terminal or shell lately (urxvt and fish respectively), nor any of my configs (posted below). I also can't find any calls to sed anywhere obvious. Does someone know what might cause this to start happening?

$ cat .getmail/getmailrc
[retriever]
type = SimpleIMAPSSLRetriever
server = imap.examplemail.com
username = me@examplemail.com
use_peek = yes
mailboxes = ('INBOX'
  , 'INBOX.Sent Items', 'INBOX.Archive'
  )

[destination]
type = MDA_external
path = /usr/bin/maildrop

[options]
read_all = no
delete = no
delivered_to = no
received = no
$ cat .mailfilter 
# <- for syntax highlighting
#logfile "$HOME/.logs/mailfilter.log"

TYPE="maildir"
GETMAIL="X-getmail-retrieved-from-mailbox:"
DEFAULT="$HOME/.mail"
SENT="$HOME/.mail/.Sent"

# filter out duplicate messages
`reformail -D 1048576 $HOME/.duplicate.cache`
if ($RETURNCODE == 0)
{
  #log "File ignored as duplicate\n"
  exit
}

if (/^$GETMAIL .*(\.|\b)sent(\.|\b)/:h)
{
  xfilter "reformail -I'$GETMAIL'"
  to $SENT
}

# ignore mailing list messages
if (/^List-Id:.*<([0-9A-Za-z_\-]+)\.+/)
{
  exit
}

if ( /^Message-ID:.*<\ *>/ )
{
  #log "Message-ID is empty\n"
}

xfilter "reformail -I'$GETMAIL'"

Offline

#2 2014-12-08 06:30:21

Jonhoo
Member
Registered: 2009-05-23
Posts: 118

Re: getmail + courier-maildrop yields set_color: Could not set up terminal

Turns out maildrop resets the shell before forking, and so tried to run bash commands through fish (which obviously fails). No idea why this problem suddenly surfaced now though. Maybe fish previously didn't complain to stderr? In any case, the solution was to add

SHELL="/bin/bash"

to my .mailfilter file.

Offline

Board footer

Powered by FluxBB