On Sat, Jan 18, 2014 at 12:12:36PM +0000, Danny Roberts wrote:
> Minus comments I have the following lines in /etc/opensmtp/smtp.conf:
> 
> pki mail.thefallenphoenix.net certificate
> "/etc/pki/tls/certs/mail.thefallenphoenix.net.crt"
> pki mail.thefallenphoenix.net key
> "/etc/pki/tls/private/mail.thefallenphoenix.net.key"
> 
> listen on 95.85.28.67 tls pki mail.thefallenphoenix.net
> 
> table aliases file:/etc/aliases
> 
> accept from any for domain "thefallenphoenix.net" alias <aliases> deliver
> to maildir mail
> accept for local alias <aliases> deliver to maildir mail
> accept for any relay
> 
> With this config I can receive emails from remote and local users. However
> I am not sure how to set-up authentication so that I can send email from my
> domain to any other (e.g. gmail).
> 
> In the past I've used exim and set it up to authenticate against Dovecot.
> Ideally I'd like to be able to do the same or perhaps use the /etc/passwd
> file for authentication. Can anyone explain how to force authentication
> when I'm sending a mail?
> 
> I am using OpenSMTPD 5.4.1p1 on CentOS 6.4 x64.
> 

Hi,

If you just turn:

> listen on 95.85.28.67 tls pki mail.thefallenphoenix.net

into

> listen on 95.85.28.67 tls pki mail.thefallenphoenix.net auth-optional

without touching any other rule, you will require authentication before
relaying to outside domains.

This works because once you authenticate, you are considered a local user
and you will match the following rule:

> accept for any relay 



As for the auth database, by default opensmtpd uses the system database
so if you're authenticating from /etc/passwd, it'll work out of the box
otherwise you will need to use a table that shares the auth data with
Dovecot. You can use any backend for that, table_passwd is the simplest
as you simply create a passwd-style file:

   user:encryptedpasswd:uid:gid:gecos:home:shell

and use:

   table myusers passwd:/path/to/your/file

and setup dovecot to use the same file


-- 
Gilles Chehade

https://www.poolp.org                                          @poolpOrg

-- 
You received this mail because you are subscribed to misc@opensmtpd.org
To unsubscribe, send a mail to: misc+unsubscr...@opensmtpd.org

Reply via email to