Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

sendmail *grumble*

by PyroX (Pilgrim)
on Nov 20, 2001 at 03:28 UTC ( #126419=perlquestion: print w/replies, xml ) Need Help??
PyroX has asked for the wisdom of the Perl Monks concerning the following question:

Ok guys, I have 2 linux machines, I want my perl script on one machine to email me a message. Ok, no problem. Did that. I want sendmail to take this message and send it to the other linux machine, which is set up to relay from this machine, still ok, the perl script told sendmail to use ther other machine as its mail server. NOW HERE IS WHERE IS ALL FALLS APART.

I am watching the log on the 2nd machine, it accepts the message to be relayed, but then queued it. Every time! stat=queued.

I realize this is a perl area, and this problem involves sendmail, but does anyone know what is going wrong? I checked several times, sendmail is started with -bd -q so it is running and is supposed to be forking a child to send the queued messages, but it never does. It is not sending the mail on.

ALSO, is there some way that I can force it to send all queued messages?


Replies are listed 'Best First'.
Re: sendmail *grumble*
by perigeeV (Hermit) on Nov 20, 2001 at 04:37 UTC

    sendmail -q

    from the command line causes it to process the queue once, then exit. Add the -v switch to make sendmail chattier while it does it. Normally a sendmail daemon only queues under difficulty, it should process the mail immediately without queuing unless it has been configured to do so. You can add a time argument to -q:

    sendmail -q1h

    processes the queue every hour.

    Check out for further documentation. You may have to invoke the -d debugging switch to see what sendmail sees.

Re: sendmail *grumble*
by BigJoe (Curate) on Nov 20, 2001 at 19:49 UTC
    PyroX, when you run your script do you see a child sendmail process recieve the mail? If so does it go away after a few seconds? If it doesn't that would signify that something is keeping the connection open. You may want to look at the script that is sending the mail or at the local server. There is a setting in the (about line 303 depending on what is compiled into it) that looks like this:
    O SuperSafe=True
    If you change it to false it will not queue your mail. It will start relaying it as soon as it starts recieving it. You will probably not want to do this if the machine is on a public network.


    Learn patience, you must.
    Young PerlMonk, craves Not these things.
    Use the source Luke.
Re: sendmail *relief*
by PyroX (Pilgrim) on Nov 21, 2001 at 04:27 UTC
    Thanks guys, you both helped me get this worked out quickly.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://126419]
Approved by root
[Corion]: Maybe doing a double-fork (daemonizing) can make go that information away, but maybe not
[Corion]: But I think my knowledge of unix/Linux datastructures is several decades out of date, so I don't really know what information it keeps on processes
[oiskuu]: The useful bits that relate to your process can be found under /proc/self. What information are you thinking of? Tty name?
[tye]: I just daemonized and getlogin() still knew who I had been.
[tye]: perhaps loginuid ? Not that I concede that something not being in /proc means it is not useful.
[Corion]: tye: That's really interesting, but maybe it is because getlogin() returns the name, or the uid, so if that user has been replaced by another user with the same uid in the meantime, that's no problem to the system...
[davido]: or on ubuntu /var/run/utmp
[Corion]: Otherwise, I would imagine that a user with a process still alive would lock that information in memory.
[davido]: so last -f /var/run/utmp on ubuntu provides similar (though more verbose) info
[oiskuu]: glibc getlogin just does ttyname() and falls back on getutline(); it's not security related at all. (reminds me of sendmail and remote finger services of the naive early spam era)

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (8)
As of 2017-06-23 19:36 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (554 votes). Check out past polls.