Fwd: Re: Mail relay

2017-12-02 Thread Rémy Silber
(Sorry I didn't realize I didn't answer on the mailing)


> So vm1 is good you are just having trouble getting V2 to relay through it.
> Correct?
>

I don't known where is the probleme.
VM1 can send mail
VM2 can send mail through gmail
but VM2 can't send mail through VM1

I made a litle change in the VM2 smtpd.conf

table secrets file:/etc/smtpd/secrets
listen on lo
accept from any for any relay via secure+auth://label@192.168.0.209:587
auth 

so i have got some interesting logs

VM2

Dec  1 09:01:07 esprit-bourse mail.info smtpd[4682]: smtp-out: Server
certificate verification failed on session 59fc89231eb7ee0b
Dec  1 09:01:07 esprit-bourse mail.info smtpd[4682]: 59fc89231eb7ee0b mta
event=error reason=AUTH not advertised
Dec  1 09:01:37 esprit-bourse mail.info smtpd[4682]: 59fc892407839642 smtp
event=connected address=local host=esprit-bourse.lan
Dec  1 09:01:37 esprit-bourse mail.info smtpd[4682]: 59fc892407839642 smtp
event=message msgid=b721bddf from= to=<
u...@gmail.com> size=397 ndest=1 proto=ESMTP
Dec  1 09:01:37 esprit-bourse mail.info smtpd[4682]: 59fc892407839642 smtp
event=closed reason=quit
Dec  1 09:01:37 esprit-bourse mail.info smtpd[4682]: 59fc892ebc3280d8 mta
event=connecting address=tls://192.168.0.209:587 host=mail.lan
Dec  1 09:01:37 esprit-bourse mail.info smtpd[4682]: 59fc892ebc3280d8 mta
event=connected
Dec  1 09:01:37 esprit-bourse mail.info smtpd[4682]: 59fc892ebc3280d8 mta
event=starttls ciphers=version=TLSv1.2, cipher=ECDHE-RSA-CHACHA20-POLY1305,
bits=256
Dec  1 09:01:37 esprit-bourse mail.info smtpd[4682]: smtp-out: Server
certificate verification failed on session 59fc892ebc3280d8
Dec  1 09:01:37 esprit-bourse mail.info smtpd[4682]: 59fc892ebc3280d8 mta
event=error reason=AUTH rejected: 421 4.3.0: Temporary failure
Dec  1 09:01:37 esprit-bourse mail.info smtpd[4682]: smtp-out: Disabling
route [] <-> 192.168.0.209 (mail.lan) for 15s
Dec  1 09:01:39 esprit-bourse mail.info smtpd[4682]: smtp-out: No valid
route for [connector:[]->[relay:192.168.0.209,port=587,starttls,smtps,
auth=secrets:label,mx],0x0]
Dec  1 09:01:48 esprit-bourse mail.info smtpd[4682]:  mta
event=delivery evpid=b721bddf79034f70 from= to=<
u...@gmail.com> rcpt=<-> source=- relay=192.168.0.209 delay=11s
result=TempFail stat=Network error on destination MXs
Dec  1 09:01:52 esprit-bourse mail.info smtpd[4682]: smtp-out: Enabling
route [] <-> 192.168.0.209 (mail.lan)

VM1
Dec  1 09:01:07 mail mail.info smtpd[2166]: 83939bc1a83150a1 smtp
event=connected address=192.168.0.254 host=192.168.0.254
Dec  1 09:01:07 mail mail.info smtpd[2166]: 83939bc1a83150a1 smtp
event=starttls ciphers="version=TLSv1.2, cipher=ECDHE-RSA-CHACHA20-POLY1305,
bits=256"
Dec  1 09:01:37 mail mail.info smtpd[2166]: 83939bc542d08fe2 smtp
event=connected address=192.168.0.205 host=192.168.0.205
Dec  1 09:01:37 mail mail.info smtpd[2166]: 83939bc542d08fe2 smtp
event=starttls ciphers="version=TLSv1.2, cipher=ECDHE-RSA-CHACHA20-POLY1305,
bits=256"
Dec  1 09:01:37 mail mail.info smtpd[2166]: 83939bc542d08fe2 smtp
event=authentication user=testm...@esprit-bourse.com result=tempfail
Dec  1 09:01:37 mail mail.info smtpd[2166]: smtp-in: Failed command on
session 83939bc542d08fe2: "AUTH PLAIN (...)" => 421 4.3.0: Temporary failure
Dec  1 09:01:37 mail mail.info smtpd[2166]: 83939bc542d08fe2 smtp
event=closed reason=disconnect


Re: Multiple relays with OpenSMTPd

2017-12-02 Thread Edgar Pettijohn
On Wed, Nov 29, 2017 at 10:12:42AM +0100, Tom Van Looy wrote:
> Hi
> 
> We use mailhog in development / testing and hook it up to postfix. It so
> that if you mail to an email address ending in .external, it will be
> relayed to a real server. And, if doesn't we relay it to mailhog.
> 
> Postfix configuration /etc/postfix/main.cf:
> 
> myhostname = myserver.mydomain.tld
> relayhost = real-smtp-relay.mydomain.tld
> smtp_generic_maps = pcre:/etc/postfix/smtp_generic_maps.pcre
> transport_maps = hash:/etc/postfix/transport
> 
> The smtp maps make sure that the .external part is stripped off.
> 
> /(.*)\.external$/ $1
> 
> The transport maps decide that .external addresses will be relayed to the
> real SMTP server and the rest will be relayed to mailhog.
> 
> .external :
> *   smtp:127.0.0.1:1025
> 
> I would like to migrate this setup to OpenSMTPd but I'm not sure if it can
> be done. I think the important part is that the PCRE trick is missing.
> 
> Or should I use a different approach?
> 
> Kind regards,
> 
> Tom Van Looy

I'm afraid you would need the PCRE magic that isn't available :( It may
be possible with the FORMAT SPECIFIERS but it would probably still be
difficult.

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