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 -> Sendmail.xmail From Cron

Reply to this topicStart new topicStart Poll

> Sendmail.xmail From Cron, seems to "freeze" or something
ciuly
Posted: Jun 13 2011, 10:52 PM
Quote Post


Member
***

Group: Members
Posts: 62
Member No.: 1843
Joined: 29-November 05



This is an old issue, I just now am getting to dig into it properly.

I'm running xmail 1.26 on centos (it's an upgrade). Everything is working fine except getting email from cron for jobs that output stuff (I am getting the daily logwatch which contains the jobs ran and "MAIL sending errors X Time(s)", where X varies (today, that X is going to be very high))

my related setup for the scripts:
CODE

[root@Impuls pinger]# ll /usr/lib/sendmail
lrwxrwxrwx 1 root root 30 Jan 21  2010 /usr/lib/sendmail -> /etc/alternatives/mta-sendmail
[root@Impuls pinger]# ll /etc/alternatives/mta-sendmail
lrwxrwxrwx 1 root root 26 Jun  9  2010 /etc/alternatives/mta-sendmail -> /usr/lib/sendmail.sendmail
[root@Impuls pinger]# ll /usr/lib/sendmail.sendmail
lrwxrwxrwx 1 root root 16 Jun  9  2010 /usr/lib/sendmail.sendmail -> ../sbin/sendmail
[root@Impuls pinger]# ll /usr/sbin/sendmail
lrwxrwxrwx 1 root root 27 Jan 30  2010 /usr/sbin/sendmail -> /usr/sbin/sendmail.xmail.sh
[root@Impuls pinger]# ll /usr/sbin/sendmail.xmail.sh
-rwxr-xr-x 1 root root 132 Jan 19  2006 /usr/sbin/sendmail.xmail.sh
[root@Impuls pinger]# ll /usr/sbin/sendmail.xmail
-rwsr-sr-x 1 root root 18484 Jan 30  2010 /usr/sbin/sendmail.xmail  (note the +s is in place as needed)
[root@Impuls pinger]# ll /var/MailRoot/bin/sendmail
-rwxr-xr-x 1 root root 14324 Jan 30  2010 /var/MailRoot/bin/sendmail

(this is smaller than sendmail.xmail, not sure if it's right)
CODE

[root@Impuls pinger]# cat /usr/sbin/sendmail.xmail.sh
#!/bin/sh
export DEFAULT_DOMAIN="ciuly.com"
if [ -z $MAIL_ROOT ]; then
export MAIL_ROOT=/var/MailRoot
fi
/usr/sbin/sendmail.xmail $*
[root@Impuls pinger]#


now, when the cron runs the job (it's just a script that verifies if the actual job is running and if not it starts it, outputting that it did so), things will look like this (pstree output):
CODE

    ├─crond─┬─crond─┬─gpinger.chk
    │       │       └─sendmail───sendmail.xmail
    │       └─crond─┬─ipinger.chk
    │               └─sendmail───sendmail.xmail

and the jobs:
CODE

[root@Impuls pinger]# ps -Af | grep ping
root     15141 15140  0 00:11 ?        00:00:00 [gpinger.chk] <defunct>
root     15150     1  0 00:11 ?        00:00:00 /usr/bin/php /www/pinger/pinger.php 1
root     15163 15162  0 00:12 ?        00:00:00 [ipinger.chk] <defunct>
root     15172     1  0 00:12 ?        00:00:00 /usr/bin/php /www/pinger/pinger.php 2


I looked in the xmail logs but I didn't even find anything in the logs (smtp, for these emails, so it appears it is not getting anywhere.

I made a small test script and logged parameters to file in sendmail.xmail.sh resulting in
CODE

-FCronDaemon -i -odi -oem -oi -t


what's missing/wrong?

thanks.


--------------------
I hate looking up all this information every time I create a new topic so here goes:
I'm running XMail v 1.26 on linux centos 5 CLI-only kernel 2.6.18-194.32.1.el5 with filters.out having one filter, filters.post-data having 5 custom filters (first one SA), filters.pre-data having 2 custom filters and SA v 3.3.1 running on Perl v 5.8.8 with a weekly crontab entry for sa-update
PMUsers WebsiteYahoo
Top
ciuly
Posted: Jun 16 2011, 10:27 PM
Quote Post


Member
***

Group: Members
Posts: 62
Member No.: 1843
Joined: 29-November 05



Managed to finally track it down, after reading this message here: http://permalink.gmane.org/gmane.mail.xmail.general/5046
basically I experimented with tweaking the command line parameters and by mistake, at a given point I wrote the newargs expression wrong (I had some debug stuff in place), resulting in a singular word, which raised an error in the mailer daemon of a non-existing account.
so in the end I ended up with the following sendmail.xmail.sh
CODE

#!/bin/sh
export DEFAULT_DOMAIN=mydomain.tld
if [ -z $MAIL_ROOT ]; then
 export MAIL_ROOT=/var/MailRoot
fi

iscron=`echo $* | grep FCronDaemon`
if [ -n "$iscron" ]
then
 /usr/sbin/sendmail.xmail root
else
 /usr/sbin/sendmail.xmail $*
fi


--------------------
I hate looking up all this information every time I create a new topic so here goes:
I'm running XMail v 1.26 on linux centos 5 CLI-only kernel 2.6.18-194.32.1.el5 with filters.out having one filter, filters.post-data having 5 custom filters (first one SA), filters.pre-data having 2 custom filters and SA v 3.3.1 running on Perl v 5.8.8 with a weekly crontab entry for sa-update
PMUsers WebsiteYahoo
Top
0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)
0 Members:
« Next Oldest | XMail Server | Next Newest »

Reply to this topicStart new topicStart Poll