Sendmail "from" is not from the userID sending


 
Thread Tools Search this Thread
Operating Systems AIX Sendmail "from" is not from the userID sending
# 1  
Old 09-09-2015
Sendmail "from" is not from the userID sending

On one of my servers (AIX 7.1 sendmail=V10/Berkeley) When I login and sudo su to a serviceID and send a test email, the from header shows as being from my loginID and not the serviceID. I have a second server (AIX 6.1 sendmail=V9/Berkeley) where following the same steps the email head has the service ID as the "from:" info. I have compared the sendmail.cf files for both servers and have attempted to mitigate the differences (setting local host on the V10 server). I also attempted to insert a couple of lines from the V9 file into the V10 file that were not present but sendmail didn't like the older syntax.
code added:
Code:
# Added for AIX the next 2 lines
R</C=$+>                $@<@$j.>:/C=$1
R/C=$+<@$+>             $@<@$j.>:/C=$1


Last edited by vbe; 09-09-2015 at 02:21 PM.. Reason: code tags
# 2  
Old 09-10-2015
There is the "From " envelope (first line) and the "From: " in the header.
Both values should be constructed from the $g macro that should be the effective user ID (where sudo/su switches to):
Code:
O UnixFromLine=From $g $d

Code:
H?F?From: $?x$x <$g>$|$g$.

These 2 Users Gave Thanks to MadeInGermany For This Post:
# 3  
Old 09-10-2015
Thanks MadeInGermany. Both of my sendmail.cf files have both of those bits of code.

To be clear: the desired behavior is for the email to arrive from the serviceID/appID that was sudo su'd to. Not the human userID sudo su'd from. i.e. if I login as lcarpenter and sudo su - orainst1 and then send an email... the from information in the email should only indicate "orainst1".
# 4  
Old 09-11-2015
How do you send the test mail?
Try this one, with only sendmail and verbose
Code:
echo "hello world" | /usr/lib/sendmail -v yourrecipient@youraddress

Any error message?
Any difference in the received mails!
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. AIX

Apache 2.4 directory cannot display "Last modified" "Size" "Description"

Hi 2 all, i have had AIX 7.2 :/# /usr/IBMAHS/bin/apachectl -v Server version: Apache/2.4.12 (Unix) Server built: May 25 2015 04:58:27 :/#:/# /usr/IBMAHS/bin/apachectl -M Loaded Modules: core_module (static) so_module (static) http_module (static) mpm_worker_module (static) ... (3 Replies)
Discussion started by: penchev
3 Replies

2. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies

3. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

4. Red Hat

Nagios is sending "Service Alert: CentOS 5/HTTP is WARNING"

Hello All, I have setup Nagios 3.2.3 on CentOS release 5.7 (Final) with the default config files and added 1 host to it and it is sending "Service Alert: CentOS 5/HTTP is WARNING" frequently, how do you fix this one? what are the additional files that need to be added so that I can monitor the... (0 Replies)
Discussion started by: lovesaikrishna
0 Replies

5. UNIX for Advanced & Expert Users

Sendmail: how to restrict delivery based on "to" or "from"?

Hello, I manage a large sendmail server that handles more than 20,000 pieces of mail per day. It's a bit unusual in that all this mail is only being sent to and from 4 local accounts. (It's an automated transaction processing system, whereby users submit a transaction via email attachment). ... (2 Replies)
Discussion started by: lupin..the..3rd
2 Replies

6. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

7. UNIX for Dummies Questions & Answers

Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`"

Hi Friends, Can any of you explain me about the below line of code? mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'` Im not able to understand, what exactly it is doing :confused: Any help would be useful for me. Lokesha (4 Replies)
Discussion started by: Lokesha
4 Replies

8. AIX

Issues with "SU - userid -c command" on system reboot

Hi All! My db2 is started in the AIX /etc/inittab on systemreboot as follows db3:2:once:su - db2inst3 -c db2start >/dev/console 2>1 I changed the .profile of db2inst3 to put an alias to the db2start command as follows alias db2start="/usr/bin/ksh /home/db2inst3/sample/db2start.ksh" When... (1 Reply)
Discussion started by: voorkey
1 Replies

9. UNIX for Advanced & Expert Users

Question on UserID with "root" priviledges

I know we can create a normal UserID with "root" priviledges by assigning the user into the "root" group. As such, everything that is modified by the UserID will also contain "root" as the group and ID. This is return causes less tracability on who made the change onto a certain file, etc. My... (3 Replies)
Discussion started by: Alvin
3 Replies
Login or Register to Ask a Question