LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   qmail generating mail that sends to the wrong domain? (https://www.linuxquestions.org/questions/linux-software-2/qmail-generating-mail-that-sends-to-the-wrong-domain-313130/)

shadoxity 04-14-2005 06:21 AM

qmail generating mail that sends to the wrong domain?
 
hey all setup qmail last night, and all is working fine but i check my queue every so often and there is a couple messages (im guessing automated somewhere) that are sending to root@mail.mydomain.com instead of root@mydomain.com

please help.. thanx, also is there a way to install qmHandle so i dont have to browse to the folder then type "perl qmHandle"? thanx

[root@localhost downloads]# perl qmHandle -l
2011179 (138, R)
Return-path: anonymous@mail.mydomain.net
From: root@mail.mydomain.net (Cron Daemon)
To: root@mail.mydomain.net
Subject: Cron <root@localhost> run-parts /etc/cron.daily
Date: 14 Apr 2005 04:02:22 +1000
Size: 536 bytes

2011178 (137, R)
Return-path: root@mail.mydomain.net
From: root@mail.mydomain.net
To: root@mail.mydomain.net
Subject: LogWatch for localhost.localdomain
Date: 14 Apr 2005 04:02:06 +1000
Size: 9903 bytes

Donboy 04-14-2005 10:46 AM

These messages are being sent by cron. The messages are being addressed to simply "root" and your qmail server is appending the domain to the end. I solved this by adding a domain called "mydomain.net" (without the mail. at the beginning) and then making mail.mydomain.net forward absolutely everything to "mydomain.net". This circumvented the problem. You basically just have to pretend like you don't have a mail.yourdomain.net because all the mail from there is auto-forwarded to your other domain.

I think you want to edit your "qmHandle" script and look at the top and see if there is a shebang line. It should say...

#!/usr/bin/perl

or something similar. Just be sure this is the correct path to perl on your system. The #! are required for the script to run, only the path probably needs to be corrected.

shadoxity 04-15-2005 03:04 AM

the domain i already have is mydomain.net so should i add mail.mydomain.net and forward all that to mydomain.net?

thanx

Donboy 04-15-2005 07:37 AM

Ohhh, Ok. Nevermind. Here's a better way.

Edit your /etc/crontab. Near the top, you'll see a line like this..

MAILTO=root

Change "root" to "you@yourdomain.com" and save the file. Now emails regarding cron will be sent to that address.

You can also change your LogWatch emails too. My config file was located under /etc/log.d/logwatch.conf. There is a line about halfway down that says...

MailTo = root

Change that to...

MailTo = you@yourdomain.com

And emails will be sent to the proper address.

shadoxity 04-15-2005 09:11 AM

thanx heaps changed them around, will know if it worked by the morning :D

shadoxity 04-16-2005 12:56 AM

yep worked thanx :D


All times are GMT -5. The time now is 01:37 AM.