Operating System - HP-UX
1820390 Members
3494 Online
109623 Solutions
New Discussion юеВ

queuing with sendmail and mailx

 
SOLVED
Go to solution
Doug_3
Frequent Advisor

queuing with sendmail and mailx

Hi, I have a standalone server not part of a domain. I set up sendmail.cf to point to the smtp server for our organization. Testing was successful using syntax (from a previous post):
sendmail -v -b8.99 -v38.99 myname@myorg.org
the email is sent immediately and relayed to our groupwise smtp and mta hosts and then to our groupwise and outlook clients.
When I use mailx it will take up to 10 minutes or so for the mail to reach the smtp server and then to our desktop client(s). The mailq command shows it sitting there quite nicely in deferred.
output: (host map: lookup (mydomain.org): deferred)

I assume my sendmail daemon is set to queue the messages up and wait a prescribed time. I looked but was unable to find (or perhaps decipher) how to manually force sendmail to submit the queued email or to restart the sendmail daemon and force it to send smtp at a faster cycle.

If the solution is to submit the email using sendmail and skipping mailx then please advise that to be the case.

Thanks in advance!
6 REPLIES 6
Bill Hassell
Honored Contributor
Solution

Re: queuing with sendmail and mailx

Assuming nothing but the relay server was changed in senddmail.cf, the message from mailx was likely queued but had a problem. You can see the status in the /var/adm/syslog/mail.log file.

Have you compared apples to apples? That is, a simple message to the same address, like this:

cat /etc/fstab | mailx me@myaddr.someplace.com
cat /etc/fstab | sendmail me@myaddr.someplace.com


Bill Hassell, sysadmin
Yang Qin_1
Honored Contributor

Re: queuing with sendmail and mailx

Hi, mailx is a interface to sendmail. Did you check /var/adm/syslog/mail.log? maybe you can find something there. Or otherwise, sendmail daemon is not running on your server and mails are delivered by a cronjob, other scheduled sendmail scripts (with something like sendmail -q).

Yang
Ivan Ferreira
Honored Contributor

Re: queuing with sendmail and mailx

You may want to try editting the /sbin/init.d/sendmail file and lower the value of the -q parameter in the sendmail command.

-q: Process saved messages in the queue at given intervals.

The default value is 30m.

You can force the queue processing with the sendmail -q command.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Doug_3
Frequent Advisor

Re: queuing with sendmail and mailx

Thank you, the mail.log shows a transient error. Perhaps someone can help lead me down the correct path?
sendmail -v -d8.99 and -d38.99 myname@myorg.org
shows this:
;; res_querydomain(IFASHP, , 1, 1)
;; res_query(IFASHP., 1, 1)
;; Querying server (# 1) address = 0.0.0.0
;; Querying server (# 1) address = 0.0.0.0
;; Querying server (# 1) address = 0.0.0.0
;; Querying server (# 1) address = 0.0.0.0
;; res_query: send error
seq_map_parse(aliases.files, )
;; res_query(16.0.1.10.in-addr.arpa, 1, 12)
;; Querying server (# 1) address = 0.0.0.0
;; Querying server (# 1) address = 0.0.0.0
;; Querying server (# 1) address = 0.0.0.0
;; Querying server (# 1) address = 0.0.0.0
;; res_query: send error
map_init(sequence:aliases.files, NULL, 0)
sequence:aliases.files NULL: valid
map_init(implicit:Alias0, /etc/mail/aliases, 0)
wrong pass (pass = 0, rebuildable = 1)
map_init(host:host, NULL, 0)
host:host NULL: valid
map_init(switch:aliases, aliases, 0)
switch_map_open(aliases, aliases, 0)
switch_map_find => 1
files
map_stack[0] = sequence:aliases.files
switch:aliases aliases: valid
map_init(dequote:dequote, NULL, 0)
dequote:dequote NULL: valid
map_init(host:resolve, NULL, 0)
host:resolve NULL: valid
map_init(sequence:aliases.files, NULL, 1)
wrong pass (pass = 1, rebuildable = 0)
map_init(implicit:Alias0, /etc/mail/aliases, 1)
impl_map_open(Alias0, /etc/mail/aliases, 0)
hash_map_open(Alias0, /etc/mail/aliases, 0)
impl_map_lookup(Alias0, @)
db_map_lookup(Alias0, @)
implicit:Alias0 /etc/mail/aliases: valid
map_init(host:host, NULL, 1)
wrong pass (pass = 1, rebuildable = 0)
map_init(switch:aliases, aliases, 1)
wrong pass (pass = 1, rebuildable = 0)
map_init(dequote:dequote, NULL, 1)
wrong pass (pass = 1, rebuildable = 0)
map_init(host:resolve, NULL, 1)
wrong pass (pass = 1, rebuildable = 0)
getcanonname(spokaneschools.org), trying dns
dns_getcanonname(spokaneschools.org, trymx=1)
dns_getcanonname: trying spokaneschools.org. (ANY)
;; res_querydomain(spokaneschools.org, , 1, 255)
;; res_query(spokaneschools.org., 1, 255)
;; Querying server (# 1) address = 0.0.0.0
;; Querying server (# 1) address = 0.0.0.0
;; Querying server (# 1) address = 0.0.0.0
;; Querying server (# 1) address = 0.0.0.0
;; res_query: send error
NO: errno=239, h_errno=2
getcanonname(spokaneschools.org), failed, stat=75
spokaneschools.org: Name server timeout
dougf@spokaneschools.org... Transient parse error -- message queued for future d
elivery
Ivan Ferreira
Honored Contributor

Re: queuing with sendmail and mailx

Your problem is your DNS configuration, configure /etc/resolv.conf file and /etc/nsswitch.conf file, for example:

/etc/resolf.conf
domain yourdomain.com
nameserver 192.168.1.1


/etc/nsswitch.conf

hosts: dns [NOTFOUND=continue] files
ipnodes: dns [NOTFOUND=continue] files
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Bill Hassell
Honored Contributor

Re: queuing with sendmail and mailx

Start by testing your DNS server:

nsquery hosts spokaneschools.org
nslookup -type=mx spokaneschools.org

nsquery tests the actual resolver tasks in detail. nslookup for the MX records determines if your DNS server has any mail delivery records for spokaneschools.org. If either of these fail, sendmail (and therefore mailx) will fail.

There are two other files to check, both in /etc/mail. sendmail.cw should have two (uncommented) lines:

localhost
yourserver

and service.switch (if it exists) should have:

hosts dns files
aliases files

After making any changes to these files, be sure to restart sendmail:

/sbin/init.d/sendmail stop
/sbin/init.d/sendmail start

Note: mailx just passes the mail to sendmail and the message is immediately sent. If something goes wrong with the address or the relay server, then the mail will be queued.


Bill Hassell, sysadmin