Re: smarthost + aliases

2019-09-14 Thread Reio Remma

On 14.09.2019 3:05, Edgar Pettijohn wrote:

On Sat, Sep 14, 2019 at 12:32:22AM +0200, Thomas Schweikle wrote:

Hi!

Trying to set up opensmtpd as a simple single mta relaying all mail to a
smarthost. But ...

Config:
listen on localhost
table aliases db:/etc/aliases.db
table secrets db:/etc/smtpd.secrets.db
expire 4h


Add:

accept for local alias  deliver to mbox
accept from local for any relay via smtps+auth://gm...@smtp.gmail.com:465 auth



Hello! You may also look into forward-only if you want them to be 
forwarded to external addresses:


accept from local for local alias  forward-only

Good luck,
Reio



Re: smarthost + aliases

2019-09-13 Thread Thomas Bohl

accept from local for any relay via \
   smtps+auth://gm...@smtp.gmail.com:465 \
   as tschwei...@gmail.com \
   auth  verify


Sorry, that is obviously wrong. I misunderstood.



Re: smarthost + aliases

2019-09-13 Thread Thomas Bohl

Hello,


listen on localhost
table aliases db:/etc/aliases.db
table secrets db:/etc/smtpd.secrets.db


(Just use file. There is no gain in using Berkeley DB.)


expire 4h


accept from local for any relay via \
  smtps+auth://gm...@smtp.gmail.com:465 \
  as tschwei...@gmail.com \
  auth  verify

https://man.openbsd.org/OpenBSD-6.3/smtpd.conf#relay_via

hth



Re: smarthost + aliases

2019-09-13 Thread Edgar Pettijohn
On Sat, Sep 14, 2019 at 12:32:22AM +0200, Thomas Schweikle wrote:
> Hi!
> 
> Trying to set up opensmtpd as a simple single mta relaying all mail to a
> smarthost. But ...
> 
> Config:
> listen on localhost
> table aliases db:/etc/aliases.db
> table secrets db:/etc/smtpd.secrets.db
> expire 4h


Add:

accept for local alias  deliver to mbox
accept from local for any relay via smtps+auth://gm...@smtp.gmail.com:465 auth



> 
> aliases hold:
> root: @gmail.com
> 
> now: aliases are not used. If I change??
> accept from local for any relay via smtps+auth://gm...@smtp.gmail.com:465 auth
> 
> 
> to
> 
> accept from local for any alias  relay via smtps+auth://
> gm...@smtp.gmail.com:465 auth 
> 
> "smtpd -n"??exhausts:
> /etc/smtpd.conf:18: aliases/virtual may not be used with a relay rule
> warn: no rules, nothing to do
> 
> what i want is:
> - accept mail from local,
> - apply alias expansion so "root" -> "??@ maildomain"
> - relay the whole thing.
> 
> at the smarthost this shall look like:
> From: root??@ servername
> To: ??@ maildomain
> 
> any idea how to make it happen??with opensmtpd?
> There are lots of examples to find within the www, but non with relaying. All
> with local delivery. But I like to relay and expand aliases before!
> 
> --
> Thomas



smarthost + aliases

2019-09-13 Thread Thomas Schweikle
Hi!

Trying to set up opensmtpd as a simple single mta relaying all mail to a
smarthost. But ...

Config:
listen on localhost
table aliases db:/etc/aliases.db
table secrets db:/etc/smtpd.secrets.db
expire 4h
accept from local for any relay via smtps+auth://gm...@smtp.gmail.com:465
auth 

aliases hold:
root: @gmail.com

now: aliases are not used. If I change
accept from local for any relay via smtps+auth://gm...@smtp.gmail.com:465
auth 

to

accept from local for any alias  relay via smtps+auth://
gm...@smtp.gmail.com:465 auth 

"smtpd -n" exhausts:
/etc/smtpd.conf:18: aliases/virtual may not be used with a relay rule
warn: no rules, nothing to do

what i want is:
- accept mail from local,
- apply alias expansion so "root" -> " @ maildomain"
- relay the whole thing.

at the smarthost this shall look like:
From: root @ servername
To:  @ maildomain

any idea how to make it happen with opensmtpd?
There are lots of examples to find within the www, but non with relaying.
All with local delivery. But I like to relay and expand aliases before!

-- 
Thomas