# lmtp: permission denied

## someone12345

Hi!

I've some permission problem which I don't quite understand:

connect to /usr/lib/postfix/lmtp[/usr/lib/postfix/lmtp]: Permission denied

# ls -l /usr/lib/postfix/lmtp

-rwxr-xr-x  1 root root 239056 Feb  4 13:15 /usr/lib/postfix/lmtp

# id postfix

uid=207(postfix) gid=207(postfix) groups=207(postfix),12(mail)

Looks quite alright, doesn't it? And actually when loggin as postfix I can manually execute lmtp.

----------

## magic919

How are you invoking this command?

----------

## someone12345

 *magic919 wrote:*   

> How are you invoking this command?

 

Well...I don't know actually  :Smile:  It's postfix that's invoking it...

Meanwhile after spending some time playing and trying I get this:

Feb  4 18:17:00 server master[1853]: fatal: master_spawn: exec /usr/lib/postfix/lmtp: Permission denied

Feb  4 18:17:01 server postfix/master[29605]: warning: process /usr/lib/postfix/lmtp pid 1853 exit status 1

Feb  4 18:17:01 server postfix/master[29605]: warning: /usr/lib/postfix/lmtp: bad command startup -- throttling

----------

## magic919

Ok.  So you have defined a transport in Postfix to use it.

Can you post the bottom bits of /etc/postfix/master.cf.  Feel free to lose all the comments.

----------

## someone12345

```

# postconf  -n

alias_database = hash:/etc/mail/aliases

alias_maps = hash:/etc/mail/aliases

command_directory = /usr/sbin

config_directory = /etc/postfix

daemon_directory = /usr/lib/postfix

debug_peer_level = 2

home_mailbox = .maildir/

html_directory = /usr/share/doc/postfix-2.2.5/html

mail_owner = postfix

mailbox_command = /usr/lib/cyrus/deliver

mailbox_size_limit = 0

mailbox_transport = lmtp:unix:/usr/lib/postfix/lmtp

mailq_path = /usr/bin/mailq

manpage_directory = /usr/share/man

myhostname = server.localdomain

newaliases_path = /usr/bin/newaliases

queue_directory = /var/spool/postfix

readme_directory = /usr/share/doc/postfix-2.2.5/readme

relayhost = mail.nitwit.de

sample_directory = /etc/postfix

sendmail_path = /usr/sbin/sendmail

setgid_group = postdrop

smtp_sasl_auth_enable = yes

smtp_sasl_password_maps = hash:/etc/postfix/saslpass

smtp_sasl_security_options = noanonymous

unknown_local_recipient_reject_code = 550

```

```

# grep -E "^[^#]+" /etc/postfix/master.cf

smtp      inet  n       -       n       -       -       smtpd

pickup    fifo  n       -       n       60      1       pickup

cleanup   unix  n       -       n       -       0       cleanup

qmgr      fifo  n       -       n       300     1       qmgr

tlsmgr    unix  -       -       n       1000?   1       tlsmgr

rewrite   unix  -       -       n       -       -       trivial-rewrite

bounce    unix  -       -       n       -       0       bounce

defer     unix  -       -       n       -       0       bounce

trace     unix  -       -       n       -       0       bounce

verify    unix  -       -       n       -       1       verify

flush     unix  n       -       n       1000?   0       flush

proxymap  unix  -       -       n       -       -       proxymap

smtp      unix  -       -       n       -       -       smtp

relay     unix  -       -       n       -       -       smtp

        -o fallback_relay=

showq     unix  n       -       n       -       -       showq

error     unix  -       -       n       -       -       error

discard   unix  -       -       n       -       -       discard

local     unix  -       n       n       -       -       local

virtual   unix  -       n       n       -       -       virtual

lmtp      unix  -       -       n       -       -       lmtp

anvil     unix  -       -       n       -       1       anvil

scache    unix  -       -       n       -       1       scache

maildrop  unix  -       n       n       -       -       pipe

  flags=DRhu user=vmail argv=/usr/local/bin/maildrop -d ${recipient}

old-cyrus unix  -       n       n       -       -       pipe

  flags=R user=cyrus argv=/cyrus/bin/deliver -e -m ${extension} ${user}

cyrus     unix  -       n       n       -       -       pipe

  user=cyrus argv=/cyrus/bin/deliver -e -r ${sender} -m ${extension} ${user}

uucp      unix  -       n       n       -       -       pipe

  flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)

ifmail    unix  -       n       n       -       -       pipe

  flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)

bsmtp     unix  -       n       n       -       -       pipe

  flags=Fq. user=foo argv=/usr/local/sbin/bsmtp -f $sender $nexthop $recipient

```

----------

## magic919

okay.  Using Cyrus to deliver (which I don't..) I'd expect to see mailbox_transport = cyrus and comment out mailbox_command.

It 'knows' how to call cyrus as it's defined in your master.cf.

That's my 2p.

----------

## someone12345

 *magic919 wrote:*   

> okay.  Using Cyrus to deliver (which I don't..) I'd expect to see mailbox_transport = cyrus and comment out mailbox_command.

 

Hmm. Well, at least no errors show up in the log no more. But no mail as well...and I couldn't find any file in /var/spool/postfix/defer[red]. Seemed like the argv in master.cf is wrong when emerging postfix:

Feb  4 19:13:25 server pipe[5774]: fatal: pipe_comand: execvp /cyrus/bin/deliver: No such file or directory

Feb  4 19:13:25 server postfix/smtpd[5767]: disconnect from localhost[127.0.0.1]

Feb  4 19:13:26 server postfix/pipe[5773]: 96D2EFB843: to=<tcn@localhost.server.localdomain>, orig_to=<tcn@localhost>, r

elay=cyrus, delay=1, status=bounced (Command died with status 1: "/cyrus/bin/deliver")

So, I fixed it - and got:

Feb  4 19:15:51 server postfix/pipe[5917]: 77FC8FB8E9: to=<tcn@localhost.server.localdomain>, orig_to=<tcn@localhost>, r

elay=cyrus, delay=0, status=deferred (temporary failure. Command output: couldn't connect to lmtpd: Connection refused_

421 4.3.0 deliver: couldn't connect to lmtpd_ )

Hm, some auth related? I didn't configure anything regarding auth and lmtp which I probably should have  :Smile: 

----------

## magic919

There's not usually any auth with lmtp.  Did you change the master.cf to /usr/lib/cyrus/deliver then?  Not sure exactly what you've changed.

----------

## someone12345

yes, /usr/lib/cyrus/deliver

----------

## someone12345

No idea?  :Sad: 

----------

## magic919

I'm not understanding why you still have lmtp errors.  There's no lmtp meant to be going on with Postfix now.  Doesn't add up.  You did reload Postfix after taking it out??

----------

## someone12345

yes, sure  :Sad: 

----------

## magic919

Hmm. I'm lost.  Wanna stick up the current confs, as you did above.  The truth must be out there  :Smile: 

----------

## someone12345

It works!  :Very Happy:  Dunno what went wrong yesterday...

But I'm wondering where the "localhost" does come from:

to=<tcn@localhost.server.localdomain>, orig_to=<tcn@localhost>,

relay=cyrus, delay=0, status=sent (server.localdomain)

I configured postfix myhostname = server.localdomain.

----------

## magic919

The localhost is part of the default for mydestination parameter in Postfix.  A quick postconf mydestination will show this.

----------

