[pfx] Re: Is there a way to just quickly deliver "everything" to a file somewhere

2024-04-13 Thread Viktor Dukhovni via Postfix-users
On Sat, Apr 13, 2024 at 11:14:34AM -0400, Dan Mahoney wrote:

> >>>   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’ve dropped this in, changing only 12345 to the “nobody” UID (65534 on BSD), 
> rather than a UID that doesn’t exist.
> 
> This fails for me with:
> 
> postfix/virtual[3806]: fatal: bad string length 0 < 1: virtual_mailbox_base =
> 
> I’ve chown'd /var/spool/virtual/allmail to that UID/GID of course.

Indeed, you need:

virtual_mailbox_base = /var/spool/virtual
virtual_mailbox_maps = static:allmail/

A detail I overlooked.

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


[pfx] Re: Is there a way to just quickly deliver "everything" to a file somewhere

2024-04-13 Thread Dan Mahoney via Postfix-users


> On Apr 11, 2024, at 08:35, Viktor Dukhovni via Postfix-users 
>  wrote:
> 
> 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 
>>> mailto: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.

I’ve dropped this in, changing only 12345 to the “nobody” UID (65534 on BSD), 
rather than a UID that doesn’t exist.

This fails for me with:

postfix/virtual[3806]: fatal: bad string length 0 < 1: virtual_mailbox_base =

I’ve chown'd /var/spool/virtual/allmail to that UID/GID of course.

What am I missing?

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


[pfx] Re: Is there a way to just quickly deliver "everything" to a file somewhere

2024-04-11 Thread Viktor Dukhovni via Postfix-users
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 
> >  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


[pfx] Re: Is there a way to just quickly deliver "everything" to a file somewhere

2024-04-11 Thread Alexander Leidinger via Postfix-users

Am 2024-04-11 05:39, schrieb Dan Mahoney via Postfix-users:

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?


Would this work for your use case?

https://serverfault.com/questions/219173/configure-postfix-to-filter-email-into-hold-queue


Bye,
Alexander.

--
http://www.Leidinger.net alexan...@leidinger.net: PGP 0x8F31830F9F2772BF
http://www.FreeBSD.orgnetch...@freebsd.org  : PGP 0x8F31830F9F2772BF


signature.asc
Description: OpenPGP digital signature
___
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org


[pfx] Re: Is there a way to just quickly deliver "everything" to a file somewhere

2024-04-10 Thread Dan Mahoney via Postfix-users


> On Apr 2, 2024, at 10:52, Viktor Dukhovni via Postfix-users 
>  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?
> 
># 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?

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


[pfx] Re: Is there a way to just quickly deliver "everything" to a file somewhere

2024-04-02 Thread Viktor Dukhovni via Postfix-users
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?

# 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

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


[pfx] Re: Is there a way to just quickly deliver "everything" to a file somewhere

2024-04-02 Thread Wietse Venema via Postfix-users
Dan Mahoney via Postfix-users:
> 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?

The local delivery agent comes to mind. It delivers to files or maildirs

- It is the default setting for "local_transport".

- It delivers by default to the system mail spool directory
https://www.postfix.org/postconf.5.html#mail_spool_directory

- It can deliver to the user's home directry
https://www.postfix.org/postconf.5.html#home_mailbox

And it can deliver to any file that is writable by the default user
https://www.postfix.org/aliases.5.html
https://www.postfix.org/postconf.5.html#default_privs
https://www.postfix.org/local.8.html

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


[pfx] Re: Is there a way to just quickly deliver "everything" to a file somewhere

2024-04-02 Thread Benny Pedersen via Postfix-users

Dan Mahoney via Postfix-users skrev den 2024-04-02 10:14:

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?


https://unix.stackexchange.com/questions/132654/how-to-make-postfix-create-maildir

note Maildir is storing in mbox file, while Maildir/ does store in 
maildir


postfix does not need external tools to do it on its own, but why not 
just lmtp ?

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