Hi,

I am new to mail servers, and I ran into a nice tutorial from a French NGO.
However, I'd like to tweak a bit my configuration, and I cannot find a
proper way to achieve my goal: I want to discard mails whose recipient is
the address [email protected] (and [email protected] and so
on), while accepting mails to be routed to my_system_user, through a list
of aliases or virtual users. In fact, I want all the mails to go through
this system user, and to be read by a unique dovecot account (hence, I'd
say the simplest way to do is to have an unique Maildir?).

I created a thread on Stack Overflow for that matter:
https://stackoverflow.com/questions/64715521/prevent-mailing-to-my-username-in-opensmtp-config
; its content is below:

> I just set up my own mail server at home with OpenSMTP and Dovecot (I used 
> this
> tutorial
> <https://framacloud.org/fr/auto-hebergement/installation.html#courrier-%C3%A9lectronique>
> from Framasoft). I don't like the idea that people can mail to 
> *[email protected]
> <[email protected]>* or *[email protected]
> <[email protected]>* (or any other system user), although I'll use this
> only *my_system_user* account to receive my mails.
>
> That's why I added root: /dev/null and [email protected]:
> /dev/null to my /home/my_system_user/.myaliases file (+ makemap -t
> aliases ~/.myaliases). But I still receive the mails for 
> *[email protected]
> <[email protected]>*. Maybe I shouldn't go through the hassle
> of preventing this?
>
> table aliases file:/etc/aliases
> table own_aliases file:/home/my_system_user/.myaliases
>
> pki mail.my-domain.net key 
> "/etc/letsencrypt/live/mail.my-domain.net/privkey.pem"
> pki mail.my-domain.net certificate 
> "/etc/letsencrypt/live/mail.my-domain.net/cert.pem"
>
> # Deliver
> listen on lo
> listen on lo port 10029 tag DKIM
> listen on lo port 10036 tag ANTISPAM
> listen on eth0 port 25  hostname mail.my-domain.net tls pki mail.my-domain.net
> listen on eth0 port 587 hostname mail.my-domain.net tls-require pki 
> mail.my-domain.net auth
>
> accept tagged ANTISPAM for any alias <own_aliases> deliver to maildir 
> "~/Maildir"
> accept from local for local alias <aliases> deliver to maildir "~/Maildir"
> #accept from any for domain "my-domain.net" alias <own_aliases> deliver to 
> maildir "~/Maildir"
>
> # antispam
> accept from any for domain "my-domain.net" relay via smtp://127.0.0.1:10035
>
> # Relay
> # dkim tagged can be sent
> accept tagged DKIM for any relay hostname mail.my-domain.net
> # if not dkim tagged, send it to dkimproxy
> accept from local for any relay via smtp://127.0.0.1:10028 hostname 
> mail.my-domain.net
>
> In my search, I found out that virtual users could be a solution (source)
> <http://z5t1.com:8080/cucumber/cucumber-1.1/source/net-extra/opensmtpd/doc/example1.html#stats>,
> but it seems overkill to me (setting up a new *vmail* user, new password
> table, new services...): I have only one repicient account with multiple
> (~10) aliases.
>

Any help is appreciated!
Best regards,

choumat

Reply via email to