XMailforum is a readonly knowledge archive now.

Registering as a new user or answering posts is not possible anymore.

Might the force be with you, to find here what you are looking for.

2019-09-20 - hschneider, Admin

Cookie Disclaimer: This forum uses only essential, anonymous session cookies (xmailforum*), nothing to be scared of.

XMail Forum [Powered by Invision Power Board]
Printable Version of Topic
Click here to view this topic in its original format
XMail Forum > Documentation and Knowledge Base > Undeliverable CRON mails


Posted by: hschneider Feb 1 2004, 07:05 PM
Mails sent by the cron daemon are undeliverable, because the recipient is 'root' without any domain specification.

If you run XMail <1.17:
- Start the crontab editor with 'crontab -e'
- Add a line with your cron message recipient: 'MAILTO=user@your_domain.com'
(your_domain.com has to be a valid XMail domain)
- Exit the editor and restart the cron service.
- For details see the crontab and cron manpages.

If you run XMail >= 1.17:
- Edit your XMail startupscript in /etc/init.d/rc-6/S90xmail (or a similar path)
- Add this line after the line with MAIL_ROOT:
DEFAULT_DOMAIN=mydomain
- Enter an alias named "root" in your aliases.tab.

Posted by: vegetto34 Apr 12 2004, 08:57 AM
I'm still having problems.

I have tried the following:
DEFAULT_DOMAIN=mydomain
then
DEFAULT_DOMAIN=cchtml.com
my real domain
neither work

In aliases.tab I tried:
"*" [TAB] "root" [TAB] "webmaster@cchtml.com"
"cchtml.com" [TAB] "root" [TAB] "webmaster@cchtml.com"
"" [TAB] "root" [TAB] "webmaster@cchtml.com"

none of those work either... I still get undelieverables. What have I done wrong?

I can successfully send e-mail to root@cchtml.com which goes to the webmaster account as it should.

Posted by: hschneider Apr 12 2004, 09:41 AM
- What is your XMail version?
- Did you restart XMail after these changes ?
- Make sure, that DEFAULT_DOMAIN is exported correctly from your startup script.
- Make sure, that you have modified the correct script, there can be multiple ones per runlevel.

Posted by: vegetto34 Apr 12 2004, 08:57 PM
xmail 1.18
I stop XMail, perform the changes, and restart xmail.
I'm on RL 3... I'm not sure how to check these things on console. I can nagivate the file system, check processes, edit files, and do permissions... how do you check if it was exported?

The only place I know where the start scripts are in are /etc/init.d

On RH 9.0

Posted by: hschneider Apr 12 2004, 10:30 PM
If you type 'set' on console, then it should be listed. The correct statement should be
export DEFAULT_DOMAIN="domain.com"

Posted by: vegetto34 Apr 12 2004, 11:09 PM
That must have been it... it was not listed when I first ran "set." I then punched in the export command and DEFAULT_DOMAIN is now listed. I guess I'll see in 24 hours if it has fixed things. Thanks.

Posted by: vegetto34 Apr 14 2004, 11:09 AM
OK... something is wrong and I don't know what it is.

I set the export line, but I reconnected and noticed it was gone! Like it was only valid for my SSL session... I've noticed if I change the /etc/init.d/xmail script that it also changes it in /etc/rc.d/rc3.d/S90xmail script... so what am I missing?

I'm still getting the bounced messages because of no domain specification.

Posted by: hschneider Apr 14 2004, 11:28 AM
> ..it also changes it in /etc/rc.d/rc3.d/S90xmail script...
If you do a
ls -la /etc/rc.d/rc3.d
then you'll see, that this is only a symlink to the original script.

>I set the export line, but I reconnected and noticed it was gone!
Pls enter the export statement in /etc/profile and check again.

Posted by: vegetto34 Apr 14 2004, 01:36 PM
OK, got that done... and it now shows up on set, except they still say "no domain" in the queue. Will it fix itself on the next cron run?

Posted by: hschneider Apr 14 2004, 06:32 PM
I hope so ... wacko.gif

Posted by: vegetto34 Apr 15 2004, 02:56 PM
Hm, if I run ./00-logwatch --mailto root@cchtml.com it sends it! Otherwise it still tries <root> and it sits in the queue on the default run.

In the queue manager it will not give any diagnosis to the logwatch messages that are from "<>" and to "<root>" but they will sit there in queue. It will give "NODOMAIN_CRON" to messages from "<CronDaemon>" and to "<root>"... Have I screwed something up somewhere? heh

user posted image

Posted by: hschneider Apr 15 2004, 03:08 PM
Please post me the SLOG of these messages without diagnosis.
Do you have a user named root ? If not, you should add one to your aliases.tab.


Posted by: vegetto34 Apr 16 2004, 01:58 AM
Yes, look at my first post. I created a "root" alias. Did I do that wrong? It can successfully send e-mail to root@cchtml.com as I noted... and isn't it strange there is no "diagnosis" for the two e-mails in my screenshot?

Here is the SLOG of one of the logwatch e-mails:
QUOTE
[PeekTime] 1082036045 : Thu, 15 Apr 2004 08:34:05 -0500
[PeekTime] 1082036531 : Thu, 15 Apr 2004 08:42:11 -0500
[PeekTime] 1082037046 : Thu, 15 Apr 2004 08:50:46 -0500
[PeekTime] 1082037593 : Thu, 15 Apr 2004 08:59:53 -0500
[PeekTime] 1082038172 : Thu, 15 Apr 2004 09:09:32 -0500
[PeekTime] 1082038783 : Thu, 15 Apr 2004 09:19:43 -0500
[PeekTime] 1082039442 : Thu, 15 Apr 2004 09:30:42 -0500
[PeekTime] 1082040133 : Thu, 15 Apr 2004 09:42:13 -0500
[PeekTime] 1082040873 : Thu, 15 Apr 2004 09:54:33 -0500
[PeekTime] 1082041661 : Thu, 15 Apr 2004 10:07:41 -0500
[PeekTime] 1082042497 : Thu, 15 Apr 2004 10:21:37 -0500
[PeekTime] 1082043382 : Thu, 15 Apr 2004 10:36:22 -0500
[PeekTime] 1082044314 : Thu, 15 Apr 2004 10:51:54 -0500
[PeekTime] 1082045311 : Thu, 15 Apr 2004 11:08:31 -0500
[PeekTime] 1082046372 : Thu, 15 Apr 2004 11:26:12 -0500
[PeekTime] 1082047498 : Thu, 15 Apr 2004 11:44:58 -0500
[PeekTime] 1082048688 : Thu, 15 Apr 2004 12:04:48 -0500
[PeekTime] 1082049942 : Thu, 15 Apr 2004 12:25:42 -0500
[PeekTime] 1082051277 : Thu, 15 Apr 2004 12:47:57 -0500
[PeekTime] 1082052692 : Thu, 15 Apr 2004 13:11:32 -0500
[PeekTime] 1082054203 : Thu, 15 Apr 2004 13:36:43 -0500
[PeekTime] 1082055811 : Thu, 15 Apr 2004 14:03:31 -0500
[PeekTime] 1082057516 : Thu, 15 Apr 2004 14:31:56 -0500
[PeekTime] 1082059317 : Thu, 15 Apr 2004 15:01:57 -0500
[PeekTime] 1082061230 : Thu, 15 Apr 2004 15:33:50 -0500
[PeekTime] 1082063273 : Thu, 15 Apr 2004 16:07:53 -0500
[PeekTime] 1082065443 : Thu, 15 Apr 2004 16:44:03 -0500
[PeekTime] 1082067743 : Thu, 15 Apr 2004 17:22:23 -0500
[PeekTime] 1082070187 : Thu, 15 Apr 2004 18:03:07 -0500
[PeekTime] 1082072776 : Thu, 15 Apr 2004 18:46:16 -0500
[PeekTime] 1082075526 : Thu, 15 Apr 2004 19:32:06 -0500

Posted by: hschneider Apr 16 2004, 08:07 AM
Please post your server.tab and your XMail startup script.

Posted by: vegetto34 Apr 16 2004, 10:33 AM
server.tab
QUOTE
"RootDomain" "cchtml.com"
"SmtpServerDomain" "cchtml.com"
"POP3Domain" "cchtml.com"
"HeloDomain" "cchtml.com"
"PostMaster" "webmaster@cchtml.com"
"ErrorsAdmin" "webmaster@cchtml.com"
#"TempErrorsAdmin" "send-failures@cchtml.com"
#"DefaultSMTPGateways" "192.168.1.2,192.168.1.15"
"RemoveSpoolErrors" "0"
#"DisableEmitAuthUser" "1"
#"NotifyMsgLinesExtra" "8"
#"NotifySendLogToSender" "0"
#"NotifyTryPattern" "1"
"MaxMTAOps" "16"
"ReceivedHdrType" "0"
"FetchHdrTags" "+X-Deliver-To,+Received,To,Cc"
#"SmtpMsgIPBanSpammers" "550 Denied due inclusion of your IP in our spam lists"
#"SmtpMsgIPBanSpamAddress" "550 Denied due inclusion of your email address in our spam lists"
#"SmtpMsgIPBanMaps" "550 Denied due inclusion of your IP in the following map"
#"CustomSMTPMessage" "Please open http://www.cchtml.com/smtp_errors.html to get more information about this error"
#"MaxMessageSize" "20000"
#"EnableAuthSMTP-POP3" "0"
#"Pop3SyncErrorAccount" "psync-errors@cchtml.com"
"AllowNullSender" "1"
#"AllowSmtpVRFY" "1"
#"AllowSmtpETRN" "1"
#"SmtpMinDiskSpace" "100000"
#"SmtpMinVirtMemSpace" "64000"
#"Pop3MinVirtMemSpace" "64000"
#"CustMapsList" "list.dsbl.org.:1,blackholes.mail-abuse.org.:1,dialups.mail-abuse.org.:0"
#"SMTP-RDNSCheck" "1"
#"CheckMailerDomain" "1"
#"SmartDNSHost" "dns.home.bogus.net:tcp,192.168.1.1:udp"
#"DynDnsSetup" "www.dns4ever.com,80,/sys/u.cgi?d=MYDOMAIN&u=MYUSERNAME&p=MYPASSWORD&i=%s"
#"DynDnsSetup" "members.dyndns.org,80,/nic/dyndns?action=edit&started=1&hostname=YES&host_id=yourhost.ourdomain.ext&myip=%s&wildcard=OFF&mx=mail.exchanger.ext&backmx=NO,foouser,foopasswd"
#"SmtpConfig" "mail-auth"
#"SmtpConfig-192.168.0.1" "mail-auth"
"DefaultSmtpPerms" "MRVZ"

I tried uncommenting "AllowNullSender" and that did nothing.

xmail start-up script
QUOTE
#!/bin/sh
#
# skeleton example file to build /etc/init.d/ scripts.
#  This file should be used to construct scripts for /etc/init.d.
#
#  Written by Miquel van Smoorenburg <miquels@cistron.nl>.
#  Modified by Davide Libenzi <davidel@xmailserver.org>
#
# Version: @(#)skeleton  1.8  03-Mar-1998  miquels@cistron.nl
#

XMAIL_ROOT=/var/MailRoot
DEFAULT_DOMAIN="cchtml.com"
XMAIL_CMD_LINE=""
PATH=$XMAIL_ROOT/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=$XMAIL_ROOT/bin/XMail
NAME=XMail
DESC="XMail server"

test -f $DAEMON || exit 0

set -e
ulimit -c 20000

start_xmail()
{
    MAIL_ROOT=$XMAIL_ROOT
export MAIL_ROOT
    MAIL_CMD_LINE=$XMAIL_CMD_LINE
export MAIL_CMD_LINE
    $DAEMON
    while [ ! -f /var/run/$NAME.pid ]
    do
        sleep 1
    done
}

stop_xmail()
{
if [ -f /var/run/$NAME.pid ]
then
    echo `date` > $XMAIL_ROOT/.shutdown
        kill -INT `cat /var/run/$NAME.pid`
    while [ -f $XMAIL_ROOT/.shutdown ]
    do
        sleep 1
    done
fi
}


case "$1" in
  start)
      echo -n "Starting $DESC: "
      start_xmail
      echo "$NAME.[" `cat /var/run/$NAME.pid` "]"
;;
  stop)
      echo -n "Stopping $DESC: "
      stop_xmail
      echo "$NAME."
;;
  #reload)
#
# If the daemon can reload its config files on the fly
# for example by sending it SIGHUP, do it here.
#
# If the daemon responds to changes in its config file
# directly anyway, make this a do-nothing entry.
#
# echo "Reloading $DESC configuration files."
# start-stop-daemon --stop --signal 1 --quiet --pidfile \
# /var/run/$NAME.pid --exec $DAEMON
  #;;
  restart|force-reload)
#
# If the "reload" option is implemented, move the "force-reload"
# option to the "reload" entry above. If not, "force-reload" is
# just the same as "restart".
#
echo -n "Restarting $DESC: "
stop_xmail
sleep 1
start_xmail
        echo "$NAME.[" `cat /var/run/$NAME.pid` "]"
;;
  *)
N=/etc/init.d/$NAME
# echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
echo "Usage: $N {start|stop|restart|force-reload}" >&2
exit 1
;;
esac

exit 0

I cannot send an e-mail to my server to "root" as it will spit an error saying check my forward address.

Posted by: hschneider Apr 16 2004, 10:49 AM
This needs to be
export DEFAULT_DOMAIN="cchtml.com"

instead of only
DEFAULT_DOMAIN="cchtml.com"

Pls restart XMail after changes.

Posted by: vegetto34 Apr 16 2004, 10:57 AM
Edited it and that didn't do anything. Flushed queue, unfroze queue... still stuck messages. DEFAULT_DOMAIN was already listed on "set" through the change in profile and it is still there on set.

Do you know anyone else with RedHat 9 that's done this? It must have been something I did, whatever that was, because this seems like such a simple fix.

Posted by: hschneider Apr 16 2004, 11:01 AM
Maybe something system specific. Please try this:

QUOTE

- Start the crontab editor with 'crontab -e'
- Add a line with your cron message recipient: 'MAILTO=user@your_domain.com'
(your_domain.com has to be a valid XMail domain)
- Exit the editor and restart the cron service.
- For details see the crontab and cron manpages.

Posted by: atomant Apr 16 2004, 07:05 PM
For DEFAULT_DOMAIN to work you need to put it in /usr/sbin/sendmail.sh script line:
export DEFAULT_DOMAIN=mydomain

This way it works 100 % (tested).

Posted by: vegetto34 Apr 17 2004, 05:18 AM
OK I put it in sendmail.sh, but it was a new file... was it supposed to already be there?

I see a sendmail.xmail.sh file... should I edit that one?

Do I need to do anything special? Reboot? Restart xmail? Or will it work next time Cron runs in 4 hours?

Posted by: atomant Apr 17 2004, 07:26 AM
Yes, you edit sendmail.xmail.sh. It contains only a few lines. You don't need to restart xmail. Just wait for the next cron to run or run it manually.

Posted by: vegetto34 Apr 17 2004, 12:09 PM
QUOTE (atomant @ Apr 17 2004, 07:26 AM)
Yes, you edit sendmail.xmail.sh. It contains only a few lines. You don't need to restart xmail. Just wait for the next cron to run or run it manually.

Success! That finally did it. Man what a piece of work. Was this RH9 exclusive?

I noticed in the crontab file there is a MAILTO line... would it not be possible to allievate all of this mess and say just change it from "root" to "root@domain.com" ? Or if you don't want e-mails just take out "root" and leave it "".

Posted by: atomant Apr 17 2004, 12:17 PM
No, this was not RH9 exclusive, I have RH8 and this is for all *nix.

Yes, you could change MAILTO in crontab or just remove BUT where is the beauty of fixing it to quckly. biggrin.gif

Well, default domain has it's advantages: if you want to send a mail with the /usr/bin/mail than it will add a domain to a username which is very nice because some mailservers rejects sender without a domain.

Posted by: vegetto34 Jun 7 2004, 06:47 AM
I had to edit the sendmail.xmail.sh again after upgrading to 1.20 as it appears that file got wiped and I was getting sending errors on my Cron runs.

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)