postfix and local delivery

Hi guys,
I’m having some troubles configuring postfix for local delivery under virtualmin on Centos 6.9

I configured some cronjobs that send email after execution, email i successfully delivered to postfix but then removed from queue. Here is my log:

Oct 3 10:21:04 apu postfix/pickup[17239]: DEBAD420CF: uid=532 from=
Oct 3 10:21:04 apu postfix/cleanup[17251]: DEBAD420CF: message-id=20171003102104.DEBAD420CF@example.com
Oct 3 10:21:04 apu postfix/qmgr[17240]: DEBAD420CF: from=root@example.com, size=6843, nrcpt=1 (queue active)
Oct 3 10:21:04 apu postfix/cleanup[17251]: ED3F2420AC: message-id=20171003102104.DEBAD420CF@example.com
Oct 3 10:21:04 apu postfix/local[17253]: DEBAD420CF: to=localuser@example.com, orig_to=, relay=local, delay=3.8, delays=3.8/0/0/0, dsn=2.0.0, status=sent (forwarded as ED3F2420AC)
Oct 3 10:21:04 apu postfix/qmgr[17240]: DEBAD420CF: removed

I’m a newbie postfix user, this is my configuration:
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
allow_percent_hack = no
broken_sasl_auth_clients = yes
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
home_mailbox = Maildir/
html_directory = no
ignore_mx_lookup_error = yes
inet_protocols = ipv4
mailbox_command = /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME
mailbox_size_limit = 0
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydestination = $myhostname, localhost.$mydomain, localhost, example.com
newaliases_path = /usr/bin/newaliases.postfix
readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES
sample_directory = /usr/share/doc/postfix-2.6.6/samples
sender_bcc_maps = hash:/etc/postfix/bcc
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtpd_client_restrictions = permit_inet_interfaces
smtpd_recipient_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
smtpd_sender_restrictions = hash:/etc/postfix/access
unknown_local_recipient_reject_code = 550
virtual_alias_maps = hash:/etc/postfix/virtual

Basically I’m trying to have a postfix server which accepts mail only from local users.

Can you help me please?

Are you saying you’re sending mail from local users to local users?

The log above indicates it’s being delivered to another server, which means one of a few things.

You’ve got example.com in your mydestination, but if you have entries in your virtual map file (e.g. if example.com is a domain in Virtualmin, and the mailbox users were created in Virtualmin), you don’t need it listed in mydestination, as well. Your hostname and DNS MX records can also cause mail to go elsewhere.

Hi Joe, thank you for your help, the “apu.example.com” is only the hostname of the server, apu.example.com is a cname record, no mx record is configured.

In my previous post the mail is sent elsewhere because I added a record on the .forward file for debugging purposes, sorry.

After removing this record the maillog is
Oct 4 07:16:05 apu postfix/pickup[13221]: 398A0420C7: uid=0 from=
Oct 4 07:16:05 apu postfix/cleanup[13513]: 398A0420C7: message-id=20171004071605.398A0420C7@apu.example.com
Oct 4 07:16:05 apu postfix/qmgr[13222]: 398A0420C7: from=root@apu.example.com, size=371, nrcpt=1 (queue active)
Oct 4 07:16:05 apu postfix/local[13515]: 398A0420C7: to=localuser@apu.example.com, orig_to=, relay=local, delay=0.5, delays=0.23/0.1/0/0.18, dsn=2.0.0, status=sent (delivered to command: /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME)
Oct 4 07:16:05 apu postfix/qmgr[13222]: 398A0420C7: removed

Thank you

So, it’s working now, yes? (I mean, I see it being delivered, so I assume that’s what you wanted.)

yes, now it works, but, to be hones, I don’t know what I changed… I only removed the entry in the .forward file, but I added the entry only because I didn’t see any mail in the local mailbox.

Anyway, thank you so much for the help