DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD General

OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 2 Weeks Ago
danano danano is offline
New User
 
Join Date: Dec 2024
Posts: 2
Question OpenSMTPd filter - rewrite rctp

hey! i am struggeling to implement a simple rcpt rewrite with opensmtpd

context:
a few machines in my lan network.
they send mail using ssmtp to a central relay.
the central relay runs opensmtpd.
accepts mail from all internal hosts without auth.
relays mail to an official smtp server in internet with auth.
i want it to rewrite all internal addresses to my real email.

so recipients that are used quite often are
- localuser@host.lan.mydomain.tld
- root@host.lan.mydomain.tld

the opensmtpd host is igel-2 and sends mail as well to
- root@igel-2.lan.mydomain.tld

config:
Code:
#$OpenBSD: smtpd.conf,v 1.14 2019/11/26 20:14:38 gilles Exp $
 
# This is the smtpd server system-wide configuration file.
# See smtpd.conf(5) for more information.
 
table aliases file:/etc/mail/aliases
table secrets file:/etc/mail/secrets
table rcpt { "@lan.mydomain.tld" }
 
# Relay all mail via Hostpoint's SMTP server using authentication
action "relay" relay host smtps://sharedhostingsmtpuser@smtp.sharedhoster.com auth <secrets>
 
# define filter
filter "rewrite-to" phase rcpt-to match rcpt-to <rcpt> rewrite "mail@mydomain.tld"
 
# build chain
filter "incoming_chain" chain {rewrite-to}
 
# catch all
match from any for any action "relay"
 
listen on socket
listen on all filter "incoming_chain"
problems:
no rewriting of recipients is happening.
i do not understand why, spend hours reading the man page.
i would be grateful to get some help.
Reply With Quote
  #2   (View Single Post)  
Old 2 Weeks Ago
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 8,077
Default

Hello, and welcome!

This is a guess on my part, but your table <rcpt> content is not in the expected format of userid@domain, and that may be why the filter never matches.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
OpenSMTPD rewrite sender of relayed mail to virtual entry discostew OpenBSD General 8 3rd June 2021 01:42 AM
Need help with httpd rewrite rule notooth OpenBSD Packages and Ports 2 15th September 2019 08:42 PM
PDF/Postscript -> print filter -> Print Queue Filter shep Programming 6 24th December 2018 03:33 PM
fdisk -B does not rewrite the mbr kasse NetBSD General 0 25th November 2008 11:07 PM


All times are GMT. The time now is 07:29 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick