1832227 Members
2782 Online
110041 Solutions
New Discussion

sendmail question

 
Rusty Sapper
Frequent Advisor

sendmail question

I'd like to know the correct syntax for listing multiple recipients for sendmail.

My problem is that when a specify 1 recipient, sendmail is successful. However, as soon as I add a second recipient, both get queued.'
output:
recip1@company.com... queued
recip2@company.com... queued


I've tried on the commandline, I've tried using the -t and using an input file, I've also created an alias. The alias works if ther is only one user in the group, but when I add a second, they get queued.


TIA


-Rusty
14 REPLIES 14
Helen French
Honored Contributor

Re: sendmail question

I would just use the simple mailx command if it's just a small number of users:

# mailx -s "Subject" user1@domain.com user2@domain.com < /tmp/mail_content_file
Life is a promise, fulfill it!
Michael Steele_2
Honored Contributor

Re: sendmail question

cat file | mailx -s "subject" him@your_place.com her@her_place.com them@their_place.com us@our_place.com
Support Fatherhood - Stop Family Law
Geoff Wild
Honored Contributor

Re: sendmail question

Can you send to both recipients - individually?

From sendmail FAQ:

If a mail message is temporarily undeliverable, it is queued and delivery is attempted later. If the message is addressed to multiple recipients, it is queued only for those recipients to whom delivery is not immediately possible.

That works with latest version...

What version of sendmail are you using:

echo \$Z | /usr/sbin/sendmail -bt -d




Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Rusty Sapper
Frequent Advisor

Re: sendmail question

sendmail version 8.9.3

yes, the mail is successfull when sent individually to the two recipients, but get queued when send as multiple recipients of the same mail.

the mailx had the same result.



-Rusty
John Meissner
Esteemed Contributor

Re: sendmail question

cat file | mailx -s "subject" -r return-address send-to send-to send-to

so it could be

cat file | mailx -s "subject" friend1@work.com friend2@work.com firend3@work.com

the -r option is optional
All paths lead to destiny
Steven E. Protter
Exalted Contributor

Re: sendmail question

What happens when you use elm

Yet Another Sendmail Diagnostic command.

/usr/sbin/sendmail -v -d8.99 -d38.99 stevenprotter@juf.org dovidgrinker@juf.org

If you use those email addreses, I'll have to flame you.

More help.
mailq

sendmail -q

The diag command above should get you enough to make modifications to setup.

If any of the above answers have been useful, please submit points to my collegues.

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
Geoff Wild
Honored Contributor

Re: sendmail question

What happens when you do this:

echo 'To: recip1@company.com, recip2@company.com' | sendmail -t -v -oem


Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Rusty Sapper
Frequent Advisor

Re: sendmail question

Geoff,
I get the same return

recip1@company.com... queued
recip2@company.com... queued

but individually they work.

very confusing.

-Rusty
Geoff Wild
Honored Contributor

Re: sendmail question

Can you provide the output of my last commnad?

Also,
grep Mlocal /etc/mail/sendmail.cf

Should look like:
Mlocal, P=/usr/bin/rmail, F=lsDFMAw5:/|@qm9, S=10/30, R=20/40,

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Rusty Sapper
Frequent Advisor

Re: sendmail question

the grep produced...
Mlocal, P=/usr/bin/rmail, F=lsDFMAw5:/|@qm9, S=10/30, R=20/40

the only output from your previous command was:

recip1@company.com... queued
recip2@company.com... queued

when I run it with the single recipient I get onn the verbose and debug info, but multiple only returns the queues messages.

-Rusty
Geoff Wild
Honored Contributor

Re: sendmail question

There is definatley something wrong....I get this:
echo 'To: recip1@company.com, recip2@company.com' | sendmail -t -v -oem
recip2@company.com,recip1@company.com... Connecting to myserver.internal.net. via relay...
220 myserver.mydomain.ca ESMTP Server (Microsoft Exchange Internet Mail Service 5.5.2653.13) ready
>>> EHLO system1.internal.net
250-myserver.mydomain.ca Hello [system1.internal.net]
250-XEXCH50
250-HELP
250-ETRN
250-DSN
250-SIZE 0
250-AUTH LOGIN
250 AUTH=LOGIN
>>> MAIL From: SIZE=43
250 OK - mail from ; can accomodate 43 bytes
>>> RCPT To:
250 OK - Recipient
>>> RCPT To:
250 OK - Recipient
>>> DATA
354 Send data. End with CRLF.CRLF
>>> .
250 OK
recip1@company.com,recip2@company.com... Sent (OK)
Closing connection to system1.internal.net.
>>> QUIT
221 closing connection

Any chance you can post your sendmail.cf???


Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Rusty Sapper
Frequent Advisor

Re: sendmail question

Here you go. we are using a smart relay which is configured in the hosts file as our environment does not use DNS.


-Rusty


Geoff Wild
Honored Contributor

Re: sendmail question

Well...the only difference I see is:

O RefuseLA=55

We don't use that....

It makes sendmail stop accepting connections if the load average is x or above.

Just curious - can you comment it out - reload sendmail daemon - then try your multiple recipient again? I'm pretty sure this won't affect it - but it's worth a try...

Rgds...Geoff


Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
someone_4
Honored Contributor

Re: sendmail question

Hi rusty..
How about this ..

have a file lets call it mail.file that looks like so.

To: one@two.com,one1@other.com
From: you@here.com
Subject:test mail
your message starts here ..

then to send the file do

cat mail.file | sendmail -tv

that will send out mail.file to whereever you want to go. If you have issues post the output you get. If it works just use

cat mail.file | sendmail -t

to take it out of verbose mode.

Here is what -t does:

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

Good luck

Richard