What Sendmail or Procmail autocompletes local user addy?

Get answers here.

Moderators: BBear, theunknownhost, flaguy

Post Reply
User avatar
Sapphyre
Official Test Penquin
Posts: 3337
Joined: Tue Nov 19, 2002 2:50 am
Location: Canada

What Sendmail or Procmail autocompletes local user addy?

Post by Sapphyre » Mon May 09, 2011 3:14 pm

What sendmail or procmail instruction is responsible for adding/writing the "From " line (no colon-NOT the "From: " header) and what makes it different if it's root vs. a local user ? These are the first lines of the raw messages resulting from the SAME Perl script being run... it's where the problem is. This also occurs with a clone PHP script.

Same script run via command line while logged in as root - the email comes in with all headers intact, appearing just as intended using the From: that was programmed and all other headers

Code: Select all

From root@host.server.com Mon May  9 10:20:57 2011
Received: (from root@localhost)
        by host.server.com (8.14.3/8.12.10) id p49EKvjs001361;
        Mon, 9 May 2011 10:20:57 -0400
Date: Mon, 9 May 2011 10:20:57 -0400


Same script run via from website as www - the email comes in apperaing as if it's sent from somemice@host.server.com (instead of the programmed From:) and all other headers missing. They ARE in the raw message, but the addition of the > here causes most email readers to place that line and all of the rest of the headers in the body

Code: Select all

From somemice@host.server.com Mon May  9 10:21:00 2011
>From somemice  Mon May  9 10:21:00 2011
Received: (from somemice@localhost)
        by host.server.com (8.14.3/8.12.10) id p49EL0RM001396;
        Mon, 9 May 2011 10:21:00 -0400
Date: Mon, 9 May 2011 10:21:00 -0400

i.e. there's a problem with this unwanted second line that doesn't happen if root is doing it
>From somemice Mon May 9 10:21:00 2011

Anyone ?

User avatar
Arf
Official Test Penquin
Posts: 9103
Joined: Tue Apr 09, 2002 12:00 am
Location: IDAHO, USA
Contact:

Post by Arf » Mon May 09, 2011 5:04 pm

I don't think procmail is involved.

I thought in scripts, sendmail is run by www rather than the actual user (root being an exception). Try changing the valid info to some invalid user and that will indicate what your script is and is not putting into the header.

User avatar
Sapphyre
Official Test Penquin
Posts: 3337
Joined: Tue Nov 19, 2002 2:50 am
Location: Canada

Post by Sapphyre » Mon May 09, 2011 9:21 pm

I tried some debugging.
The message dispatched when root runs the script via command line get to our procmailrc as 587 bytes; while the message dispatched when run via www (clearer if I say 'on the website') (by user somemice) gets to our procmailrc as 622 bytes. I confirmed that extra line is already present so it is NOT an error in our own procmail recipes.


Setting debugging on sendmail *by adding the d flag to the call to sendmail), everything looks identical except:
- throughout, the the user is identified as root vs somemice
- obviously assigned different message id and the times differ
- getla(): 0.49 vs getla(): 1.13 (load average so not important)
- from root@localhost vs from somemice@localhost
- crackaddr (root <root>) vs crackaddr (somemice)
- crackaddr=>` root < 0x81 g>'
root <root>

vs
crackaddr=>` 0x81 g'
somemice

- Full-Name:( 0x81 x) root vs Full-Name:( 0x81 x) 0x81 x
- From person = "root" vs From person = "somemice"
- uid 0, gid 0 vs uid 995, gid 998
- home="/root", vs home="/home/somemice",


These diagnostics still don't show any details about the topmost "From " envelope line ... the one (or two) at issue :o

Where does that get created ?

Note there are "crackaddr"s in there [explains alot]; Quick, someone call the narcs!

User avatar
Arf
Official Test Penquin
Posts: 9103
Joined: Tue Apr 09, 2002 12:00 am
Location: IDAHO, USA
Contact:

Post by Arf » Tue May 10, 2011 12:23 am

This will keep you out of trouble for a while: try looking in the /etc/mail/sendmail.cf file. Grep "From" in there and you'll see some possible goodies.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest