On Wed, Apr 10, 2024 at 11:39:24PM -0400, Dan Mahoney via Postfix-users wrote:

> > On Apr 2, 2024, at 10:52, Viktor Dukhovni via Postfix-users 
> > <postfix-users@postfix.org> wrote:
> > 
> > On Tue, Apr 02, 2024 at 04:14:29AM -0400, Dan Mahoney via Postfix-users 
> > wrote:
> >> Hey there all,
> >> 
> >> I’m setting up a staging version of dayjob’s ticket system, and we’d 
> >> basically like postfix to still function, but instead of touching the 
> >> internet at all, just deliver everything to a single file (or a maildir, I 
> >> suppose), regardless of if a file is invoked via sendmail, or a port 25 
> >> connection.  I’d like nothing to leave the box.
> >> 
> >> Is there some kind of transport hack I can use for this?

Complete recipe was posted, quoted below:

> >    # No local(8) delivery
> >    #
> >    alias_database =
> >    mydestination =
> >    local_transport = error:5.1.2 Mailbox unavailable
> > 
> >    # No locally hosted domains, but you may want to set one of these
> >    # non-empty to accept mail over SMTP, if mail comes in from outside,
> >    # but this could also be via submission, permit_mynetworks, ...
> >    #
> >    relay_domains =
> >    virtual_alias_domains =
> >    virtual_mailbox_domains =
> > 
> >    # Collapse all recipients to a single address, delivered to a single
> >    # maildir.
> >    #
> >    enable_original_recipient = no
> >    virtual_alias_maps = static:allmail@$mydomain
> >    default_transport = virtual
> >    virtual_mailbox_maps = static:/var/spool/virtual/allmail/
> >    virtual_uid_maps = static:12345
> >    virtual_gid_maps = static:12345
> 
> I guess I missed something. — I also want it to null route (or route
> to a maildir) all *outbound* mail — so we can examine what our ticket
> system *would* send, is there something in here to do that, or is the
> above only for inbound?

I see no disclaimer that this would only cover "inbound" or "outbound"
mail.  Rather, I see "default_transport = virtual", which sends *all*
mail to the maildir.  Once mail is in the queue it is simply mail to be
delivered, there is no "inbound" or "outbound" when making transport
decisions.

What the recipe comments doe is that the above configuration does not
accept any inbound mail as written, you'd need to allow some clients to
inject mail via SMTP either to "inbound" domains, by e.g. adding some to
"virtual_alias_domains" or "virtual_mailbox_domains" (same result either
way).  Or via "smtpd_recipient_restrictions" to allow some clients to
send mail (just adding them to "mynetworks" would typically suffice).

Your reluctance to test this is puzzling.  Read it, try to understand
it, test it, tweak as needed, repeat.

-- 
    Viktor.
_______________________________________________
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org

Reply via email to