Thanks for all the ideas! I wanted to address the 'root' of the problem (so 
sorry!) so rather than adjusting the parameters of the mail senders, I ended up 
creating a '/etc/postfix/myrecipientmap' file and populated it with the 
following:
@subdomain.domain.com     @domain.com

Then I added a line in main.cf pointing to this file:
recipient_canonical_maps = hash:/etc/postfix/myrecipientmap

And issued a 'postmap /etc/postfix/myrecipientmap' command to pick it up. Might 
have done postfix reload or systemctl restart postfix a couple times to try to 
resolve the following.

Messages are now being sent correctly; however, I still have a handful of 
messages in the queue which are trying to send to [email protected]. I 
tried flushing/reprocessing them with 'postqueue -f' but they're still stuck:

B018F813A81    2359 Wed Jul  7 14:44:08  MAILER-DAEMON
(delivery temporarily suspended: connect to sub.domain.com[[primary_DNS]]:25: 
Connection timed out)
                                         [email protected]

3116A8053E2     533 Tue Jul  6 12:58:13  [email protected]
(delivery temporarily suspended: connect to sub.domain.com[[primary_DNS]]:25: 
Connection timed out)
                                         [email protected]

38BEC80AA6F    2382 Tue Jul  6 13:07:15  MAILER-DAEMON
(delivery temporarily suspended: connect to sub.domain.com[[primary_DNS]]:25: 
Connection timed out)
                                         [email protected]

D18B980AA71    2378 Tue Jul  6 13:05:34  MAILER-DAEMON
(delivery temporarily suspended: connect to sub.domain.com[[primary_DNS]]:25: 
Connection timed out)
                                         [email protected]

4D6878069D4   17640 Mon Jul  5 04:21:45  MAILER-DAEMON
(delivery temporarily suspended: connect to sub.domain.com[[primary_DNS]]:25: 
Connection timed out)
                                         [email protected]

CB904807977   14776 Sun Jul  4 03:46:41  MAILER-DAEMON
(delivery temporarily suspended: connect to sub.domain.com[[primary_DNS]]:25: 
Connection timed out)
                                         [email protected]

C9D1E8069C4   11110 Sat Jul  3 03:31:40  MAILER-DAEMON
(delivery temporarily suspended: connect to sub.domain.com[[primary_DNS]]:25: 
Connection timed out)
                                         [email protected]

-- 147 Kbytes in 16 Requests.

________________________________
From: [email protected] <[email protected]> on 
behalf of Bernardo Reino <[email protected]>
Sent: Wednesday, July 7, 2021 11:43 AM
To: [email protected] <[email protected]>
Subject: Re: logwatch sending to [email protected]

On Wed, 7 Jul 2021, Mike Hughes wrote:

> I just noticed that we have a bunch of undeliverable messages piling up in the
> queue. I have root defined in aliases for another address, which works when
> sending to [email protected]. However, since the FQDN in main.cf is defined as
> host.subdomain.domain.com it's appending the whole string.
>
> What's the most stable way to encourage everything to go to [email protected]
> instead? Thanks!

You could explicitly set the destination e-mail (use "--mailto user@domain").

Otherwise logwatch will use whatever is in $MAILTO if defined (you can define it
in your crontab if you run logwatch from cron).

As a last resort, logwatch will send to "root", which is probably what happens
in your case, and any subsequent modification requires Postfix.

But I'd recommend just using logwatch's "--mailto" option.

Cheers,
Bernardo

Reply via email to