![]() |
|
OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below. |
![]() |
|
Thread Tools | Display Modes |
|
|||
![]()
Hi DaemonForums!
The "as" keyword in OpenSMTPD smtpd.conf on the "relay via" directive allows you to change either the user, the domain, or whole email address of the sender on relayed email. This is great, however I would really like it to change the sender to the final expanded virtual address for the domain.. For example: Code:
/etc/mail/smtpd.conf: accept from any sender foo@bar.com for any recipient relay-recipient@externaldomain.com relay via secure+auth://myispuser@smtp.myisp.net auth <credentials> as '@mail.mydomain.com' hostname mail.mydomain.com With virtual table entry: Code:
/etc/mail/virtuals: virtual-address@mydomain.com localuser,relay-recipient@externaldomain.com However what I'd really like it to do is rewrite the sender as "virtual-address@mydomain.com" when relaying to "relay-recipient@externaldomain.com. I can't think of any reason why this _couldn't_ be done, I'm just not sure smtpd.conf currently has the syntax to pull this off. Can anyone think of a creative way to achieve this with current smtpd.conf syntax / virtual table entries? Thank you for all of your help! Cheers, discostew Code:
uname -a OpenBSD myserver@mydomain.com 6.1 GENERIC.MP#20 amd64 Last edited by discostew; 26th May 2021 at 08:59 PM. |
|
|||
![]() Quote:
![]() I only started using OpenSMTP a couple of weeks ago, so I am unable to help you with this.
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump |
|
|||
![]()
Thank you for the very quick reply J65nko / jggimi!
Yes, sadly it is 6.1.. I setup this machine before starting medical school to handle my email, and now that I'm finished (4 years later) I finally have a bit of time to spend tweaking / upgrading things. I have a few other machines upgraded to 6.8, but haven't taken a stab at this one quite yet. I did plan on doing some upgrades with this time off - looking through the smtpd.conf 6.9 man page I'm having trouble finding the new syntax for the previous "as" directive for "relay via".. Do you know what syntax replaced this functionality, or perhaps it's been taken out? |
|
|||
![]()
My impression is that you have to write or use a filter to do the rewriting.
I am not sure whether something like this could be useful and/or adapted to your situation : https://github.com/jirutka/opensmtpd...r-rewrite-from There are a couple of other filters listed at https://github.com/topics/opensmtpd-filter
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump Last edited by J65nko; 26th May 2021 at 11:32 PM. |
|
||||
![]()
The restructuring of smtpd(8)'s process management resulted in the match/action grammar now used in smtpd.conf(5). "Relay via" is now a choice of options to the relay delivery method which is selected via an action. Rewriting is supported through mail filtering, as J65nko noted. See the MAIL FILTERING section of an up-to-date smtpd.conf(5).
|
|
|||
![]()
Thank you both J65nko and jggimi! I will upgrade this machine, convert to the new smtpd.conf, and try out the new mail filtering syntax.
Thank you again! |
|
|||
![]()
Going from 6.1 to 6.9 means 8 upgrades. A lot of work, but for many Asians the number '8' brings good luck ;-)
Wouldn't be easier to do a fresh install of 6.9 on another VPS?. You then can test and play around with the filter/rewrite stuff and when that works, move the data, mailboxes etc from the existing 6.1 system to the new 6.9.
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump |
|
|||
![]()
Thank you J65nko - I will start from a fresh install, do some testing, and migrate my configuration over once everything looks good. I agree 8 upgrades does seem like an arduous / time consuming task
|
![]() |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Need help with httpd rewrite rule | notooth | OpenBSD Packages and Ports | 2 | 15th September 2019 08:42 PM |
OpenSMTPd will be the default Mail Transfer Agent in OpenBSD 5.6 | jggimi | OpenBSD General | 5 | 17th March 2014 04:09 PM |
OpenSMTPD incoming mail server | gpatrick | OpenBSD General | 2 | 9th August 2011 10:19 AM |
Virtual domains on multiple mail servers running Exim4 as MTA | satimis | General software and network | 10 | 27th November 2008 02:42 PM |
fdisk -B does not rewrite the mbr | kasse | NetBSD General | 0 | 25th November 2008 11:07 PM |