# Postfix and SMTP Auth

## JohnMac

Hi,

I search but couldn't find an answer to this problem I'm having.

I want to be able to send e-mails when I'm not home using my server.  I am running Postfix and supposedly needed SASL and used the config from the sample-auth.cf file in /etc/postfix/samples.  I followed all that info and it worked for bit, but now its broken again.  I am trying to use pwcheck so I can just use the normal passwd file and don't need to setup all the users in a different file.

This is really really annoying and I just want it to work.  Also TLS would be nice but just normal SMTP Auth would be cool to get the job done.

I'm using Postfix+Courier-IMAP, but I don't care what I use as long as it works.  So the simplest setup for SMTP, SMTP Auth w/TLS, IMAP w/SSL would be great.

Thanks,

-JohnMac

----------

## mglauche

ok, in postfix/main.cf set (warning, from postfix 1.0.3):

smtpd_sasl_auth_enable = yes

smtpd_recipient_restrictions = permit_mynetworks permit_sasl_authenticated check

_relay_domains reject_unauth_destination reject

/usr/lib/sasl/postfix.conf (important ! sasl has configuration per app):

pwcheck_method: passwd

(insert "PAM", "sasldb", "kerberos_v4", "passwd", and "shadow" here)

test it with telnet localhost 25:

Trying 127.0.0.1...

Connected to localhost.localdomain.

Escape character is '^]'.

220 pinatubo ESMTP Postfix

ehlo localhost

250-pinatubo

250-PIPELINING

250-SIZE 10240000

250-ETRN

250-AUTH PLAIN LOGIN DIGEST-MD5 CRAM-MD5

250 8BITMIME

important is, that you get that AUTH line, if not, postfix is not compiled in the right way ....

----------

## nbensa

 *mglauche wrote:*   

> important is, that you get that AUTH line, if not, postfix is not compiled in the right way ....

 

Hmm, AFAICS, Postfix ebuild doesn't use SASL (please correct me if I'm wrong.) OP will need to tweak the ebuild or compile Postfix himself.

HTH,

Norberto

----------

## mglauche

it depends on your use settings. (just checked  :Razz: ) 

IIRC a of 1.0.x SASL was the only way to get SMTP AUTH into postfix (and sendmail), don't think they did change that ...

so append "sasl" to your use settings ...

----------

## JohnMac

Jul 30 10:07:54 [postfix/smtpd] warning: SASL authentication failure: Password verification failed

Jul 30 10:07:54 [postfix/smtpd] warning: unknown[129.21.14.26]: SASL PLAIN authentication failed

Thats what I get when attempting to send a message with SMTP Auth after following the directions in this thread.

Any ideas?  I tried touching the db file but it should even be looking for the a db since I just want it to use pam or what ever would use the normal userdb.

-JohnMac

----------

## mglauche

aaah ... that brings memorys back  :Razz: 

I think your problem is, that the postfix (more the smtp daemon) runs in a chroot() envrioment, and that it can't access /etc/passwd or /etc/sasldb from within. 

You can fix that with making hard links (which of course compromise security a bit, but don't know another way ...)

----------

