I have two problems related to Postfix.
- I have 4 local mailboxes on my mail server :
The mail is fetched via fetchmail and is split from the catchall mailbox [email protected] to local mailboxes.Everything that is not addressed to qaz, yhj and qwe should go to other.
I also have redirections set up on some addresses that are sent to qwe, but the forwarded emails come addressed as to the local admin of the given system
e.g. [email protected] forwards the email to qwe and comes as addressed to [email protected].
I would like such emails to also fall into the [email protected] mailbox
but there are quite a lot of such addresses, some of which I do not remember. I would like each of these other emails to go to mailbox other .
The second problem is that I also have remote boxes on the same example.com domain that are not locally on the server.
When you try to send an e-mail to [email protected] which is a remote mailbox, the mail is automatically saved in the local other mailbox (I would like it to be automatically sent outside of local mailboxes).
main.cf
inet_interfaces = all
inet_protocols = ipv4
myhostname = mail.example.com
mydomain = example.com
myorigin = $mydomain
mydestination = localhost.local, localhost, $mydomain, example.com
mynetworks = 127.0.0.0/8
message_size_limit = 40960000
relay_domains =
local_transport = lmtp:unix:private/dovecot-lmtp
local_recipient_maps = $virtual_mailbox_maps
virtual_transport = dovecot
virtual_uid_maps = static:8
virtual_gid_maps = static:8
virtual_minimum_uid = 8
virtual_mailbox_base = /SRV/Maildir/mailboxes
virtual_mailbox_domains = pgsql:/SRV/Maildir/postfix/virtual_box_domain.cf
virtual_mailbox_maps = pgsql:/SRV/Maildir/postfix/virtual_box_box.cf
#virtual_alias_maps = pgsql:/SRV/Maildir/postfix/virtual_box_alias.cf
virtual_alias_maps = hash:/etc/postfix/virtual
virtual_mailbox_limit = 512000000
queue_directory = /var/spool/postfix
smtpd_sasl_auth_enable = yes
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_recipient_restrictions =
reject_unauth_pipelining,
reject_non_fqdn_recipient,
reject_unknown_recipient_domain,
permit_mynetworks,
permit_sasl_authenticated,
reject_unauth_destination,
reject_unknown_helo_hostname,
reject_non_fqdn_helo_hostname,
permit
smtpd_sasl_security_options = noanonymous
smtpd_sasl_tls_security_options =
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_auth_enable = yes
smtp_sasl_security_options = noanonymous
smtp_use_tls = yes
relayhost = [example.example.com]:587
virtual
[email protected] [email protected]
[email protected] [email protected]
[email protected] [email protected]
[email protected] [email protected]
@example.com [email protected]
fetchmailrc
set daemon 60
set no bouncemail
set postmaster [email protected]
poll example.example.com with proto imap port 993
envelope "Delivered-To:"
localdomains example.com
user "[email protected]" with pass "secret" is * here smtp localhost
keep
ssl
sslproto tls1.2+
I tried changing mydestination from mydestination = localhost.local, localhost, $mydomain, example.com to mydestination =
While mail is sent outside local mailboxes, there is a problem with looping mails on the mailbox from which e-mails are downloaded via fetchmail.
Then there are also problems with forwarding emails locally, e.g. from the [email protected] mailbox to [email protected].
I also tried adding to virtual_alias_maps virtual-regexp :
/.+@(.+)/ [email protected]
It is known that when trying to send to external addresses in domain example.com it ended up saving all emails in [email protected]