PROBLEM
I need a catchall on my Atmail Server + WebMail system for nonexistent users.
ENVIRONMENT
- On-Premise Server + WebMail Installations: Version 6.0 and 7.0
CAUSE
Should you want to have a catchall email address for emails addressed to users who do not exist, just do the following:
RESOLUTION
- Open up /usr/local/atmail/mailserver/configure
- Find this line
mysql_user:
driver = accept
condition = ${lookup mysql {SELECT Account from UserSession WHERE Account='${local_part}@${domain}'} }
retry_use_local_part
transport=mysql_delivery - Add below it
mysql_nonuser:
driver = accept
condition = !${lookup mysql {SELECT Account from UserSession WHERE Account='${local_part}@${domain}'} }
# retry_use_local_part
transport=mysql_nonuser_delivery - Then find the following
mysql_autoreply:
driver = autoreply
headers = Content-Type: text/plain; charset=utf-8
to = ${sender_address}
from = ${sender_address}
reply_to = "${local_part}@${domain}"
subject = "AutoReply from ${local_part}@${domain}"
text = ${lookup mysql {MYSQL_AUTOREPLY}{$value}}
once = ${lookup mysql{SELECT concat(MailDir, "/autoreply.db") from Users where Account='${local_part}@${domain}'}}
once_repeat = 1d
once_file_size = 500K - Add below it
mysql_nonuser_delivery:
⚠You must first create an account that will receive the archive logs. Replace user@foo.com with the user that will recieve the messages, and u/s the first 2 letter prefix of the account.
driver = appendfile
maildir_format
mode = 0660
mode_fail_narrower = false
envelope_to_add = true
return_path_add = true
directory = /usr/local/atmail/users/u/s/user@foo.com -
Restart Atmail Services
/etc/init.d/atmailserver restart
Comments