Re: temporary block incoming messages to specific user

2022-04-20 Thread justina colmena ~biz
So the file "/var/mail/username" is a "system inbox" for the user, typically a 
flat file that will accept new mail no matter what as long as it isn't too 
large, which would indicate that the user's mailbox is full.

Some of the early text clients, mutt etc. would move any mail in the 
"/var/mail/username" inbox to a local inbox in "/home/username/Maildir" or 
"/home/username/mbox" as soon as it is seen or read from the system inbox.

Are you blocking the user from logging in, or do you just want incoming mail 
for that user to sit in the general queue until you have that person's account 
set up?

IMHO dovecot or other clients should ideally pick up any mail in the system 
inbox "/var/mail/username" and move it to a local maildir inbox in the user's 
home folder as expeditiously as possible for any further reading or sorting.

On April 20, 2022 4:39:24 AM AKDT, Marc  wrote:
>Is it possible to block incoming messages from being delivered to a specific 
>user in such a way that the MTA will try again later. I do not want these 
>message to bounce. (eg while doing some manual maintenance on the user)?
>
>
>
>
>
>
>

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.

Re: temporary block incoming messages to specific user

2022-04-20 Thread Paul Kudla (SCOM.CA Internet Services Inc.)



this is handled in a couple of different ways


please note this is only for virtual users and assumes you are running 
postfix/dovecot



through postfix (first)

see main.cf :

# SOFT BOUNCE
#
# The soft_bounce parameter provides a limited safety net for
# testing.  When soft_bounce is enabled, mail will remain queued that
# would otherwise bounce. This parameter disables locally-generated
# bounces, and prevents the SMTP server from rejecting mail permanently
# (by changing 5xx replies into 4xx replies). However, soft_bounce
# is no cure for address rewriting mistakes or mail routing mistakes.
#

soft_bounce = yes


the above option in postfix will continually try to deliver to the end 
user, if the user does not exist it will continue trying without any 
bounceback to the sender.


this was built into postfix mainly for mail migrations between servers 
where the dovecot, cyrus server upgrades etc came into play


but should work for your situation.


next on the dovecot side (user database queries)

# cat dovecot-pgsql.conf
driver = pgsql
connect = host=localhost port=5433 dbname=scom_billing user=pgsql 
password=Scom411400

default_pass_scheme = PLAIN

password_query = SELECT username as user, password FROM email_users 
WHERE username = '%u' and password <> 'alias' and status = True and 
destination = '%u'


user_query = SELECT home, uid, gid FROM email_users WHERE username = 
'%u' and password <> 'alias' and status = True and destination = '%u'


#iterate_query = SELECT user, password FROM email_users WHERE username = 
'%u' and password <> 'alias' and status = True and destination = '%u'


iterate_query = SELECT "username" as user, domain FROM email_users WHERE 
status = True and alias_flag = False



this file reflects how to query the database tables etc

note the status=true above etc, i use this to specify if the account is 
active and ok or not


if this flag is set to false, dovecot will consider this user non active 
and not allow delivery locally.


mainly used for billing but will sufice

also note i use an alias flag (from the cyrus days) to forward emails 
off to another actual active account


i am still streamlining that internally but thought i should explain why 
it is there


please note iterate_query is used for the replication users (doveadm 
user '*') query - not needed if you dont run replication but wont hurt 
anything if it is there.










Happy Wednesday !!!
Thanks - paul

Paul Kudla


Scom.ca Internet Services 
004-1009 Byron Street South
Whitby, Ontario - Canada
L1N 4S3

Toronto 416.642.7266
Main 1.866.411.7266
Fax 1.888.892.7266

On 4/20/2022 8:39 AM, Marc wrote:

Is it possible to block incoming messages from being delivered to a specific 
user in such a way that the MTA will try again later. I do not want these 
message to bounce. (eg while doing some manual maintenance on the user)?










temporary block incoming messages to specific user

2022-04-20 Thread Marc
Is it possible to block incoming messages from being delivered to a specific 
user in such a way that the MTA will try again later. I do not want these 
message to bounce. (eg while doing some manual maintenance on the user)?