1753807 Members
7220 Online
108805 Solutions
New Discussion юеВ

sendmail

 
Ken Hare
Member

sendmail

I have been asked to convert my existing mailx script functionality to sendmail because of the need to use the -f options for authentication for active directory and then on to MS Outlook. I seem to have sendmail working ok except for one thing I cannot get to work. On the emails I receive, the 'To:' recipients do not display on the email even though all recipients receive the mail. Is there an option to allow this to happen either on the sendmail command line or within the sendmail.cf file? When using mailx, I do see the mail recipients.
2 REPLIES 2
Steven E. Protter
Exalted Contributor

Re: sendmail

Shalom,

1) Posting your email here is a spam magnet as all the spammers crawl this site for email.

2) Note that mailx uses sendmail as it's transport.

3) Posting your current script would be mighty helpful.

sendmail -t is the format you want to use if you continue to use the user unfriendly sendmail.

From the man page(those things are very helpful)


-t Read message for recipients. To:, Cc:, and Bcc: lines will be
scanned for recipient addresses. The Bcc: line will be deleted
before transmission.

sendmail -t $recipient

That is from a perl script.

Another snippet.

print MAIL "From: ${sender} \n";
print MAIL "Reply-to: $FORM{'username'} ($FORM{'realname'})\n";
print MAIL "Subject: Contact SEP \n\n";


See what you can do?

mailx [-s subject] [-c cc-addr] [-b bcc-addr] to-addr...


also from the man page. I don't think sendmail.cf is going to help here other than setting a valid domain with the Dj directive, as in Djyourdomain.com

SEP


Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Ivan Ferreira
Honored Contributor

Re: sendmail

It seems that mailx does not set the SMTP values required for that. You should try a perl script that makes direct SMTP connections. In a traditional SMTP exchange, you will see:

S: 220 www.example.com ESMTP Postfix
C: HELO mydomain.com
S: 250 Hello mydomain.com
C: MAIL FROM:
S: 250 Ok
C: RCPT TO:
S: 250 Ok
C: DATA
S: 354 End data with .
C: Subject: test message
C: From: sender@mydomain.com
C: To: friend@example.com
C:
C: Hello,
C: This is a test.
C: Goodbye.
C: .
S: 250 Ok: queued as 12345
C: QUIT
S: 221 Bye


As you can see, after the DATA command, you set the subject, from and to information, that is independent of the MAIL FROM and RCPT to commands.

Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?