Command line question?

  • Follow


Is there a switch or a way to put the recipient on the command line and 
to get that to show in the envelope?  I don't want to use the -t switch 
because this will be used for a CGI script and I want to limit the 
options for spammers.  When my CGI script sends mail, it shows as coming 
from www-data.

Thanks,

-- 

Knute Johnson
email s/nospam/knute2009/

--
Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
	     ------->>>>>>http://www.NewsDemon.com<<<<<<------
Unlimited Access, Anonymous Accounts, Uncensored Broadband Access
0
Reply nospam8071 (917) 2/26/2009 6:01:45 PM

Knute Johnson <nospam@rabbitbrush.frazmtn.com> wrote:

> Is there a switch or a way to put the recipient on the command line
> and to get that to show in the envelope?  I don't want to use the -t
> switch because this will be used for a CGI script and I want to limit
> the options for spammers.  When my CGI script sends mail, it shows as
> coming from www-data.

sendmail -f_envelope_sender_ -oi [other options] -- recipient1 recipient2 ...

-f  - set envelope sender
-oi - do not treat single dot line as end of message 
      (no leading dot conversions)
--  - can be used to clearly separate options and recipients

-- 
[pl>en Andrew] Andrzej Adam Filip : anfi@onet.eu : anfi@xl.wp.pl
Open-Sendmail: http://open-sendmail.sourceforge.net/
"They are both businesses - if you have given them enough money, 
I'm sure they'll do whatever the hell you ask:->"
  -- David Welton
0
Reply anfi2 (1412) 2/26/2009 6:12:25 PM


Andrzej Adam Filip wrote:
> Knute Johnson <nospam@rabbitbrush.frazmtn.com> wrote:
> 
>> Is there a switch or a way to put the recipient on the command line
>> and to get that to show in the envelope?  I don't want to use the -t
>> switch because this will be used for a CGI script and I want to limit
>> the options for spammers.  When my CGI script sends mail, it shows as
>> coming from www-data.
> 
> sendmail -f_envelope_sender_ -oi [other options] -- recipient1 recipient2 ...
> 
> -f  - set envelope sender
> -oi - do not treat single dot line as end of message 
>       (no leading dot conversions)
> --  - can be used to clearly separate options and recipients
> 

Thanks.  That has a couple of problems, first it supercedes -F and it 
causes a X-Authentication warning to be put in the mail.  I guess I'm 
just not going to be able to make that work.

-- 

Knute Johnson
email s/nospam/knute2009/

--
Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
	     ------->>>>>>http://www.NewsDemon.com<<<<<<------
Unlimited Access, Anonymous Accounts, Uncensored Broadband Access
0
Reply nospam8071 (917) 2/27/2009 1:50:41 AM

Knute Johnson wrote:


>> sendmail -f_envelope_sender_ -oi [other options] -- recipient1 recipient2

> Thanks.  That has a couple of problems, first it supercedes -F and it
> causes a X-Authentication warning to be put in the mail.

Both of those are easy to fix.  You can set the full name of the sender
by including an appropriate From: header in your message body, and you can
stop the X-Authentication-Warning (if it really bothers you) by adding
www-data to the "t" set, often initialized from the contents of
/etc/mail/trusted-users.

Another option is to forget about invoking Sendmail and just use an SMTP
client library to send via SMTP over 127.0.0.1.  That way, you can control
everything.

Somewhat OT: Isn't issuing an X-Authentication-Warning a bit silly?
Considering that you can fake anything by running an SMTP session, the
X-Authentication-Warning header seems quaint and anachronistic.

Regards,

David.
0
Reply dfs6 (705) 2/27/2009 2:01:55 AM

Knute Johnson <nospam@rabbitbrush.frazmtn.com> wrote:

> Andrzej Adam Filip wrote:
>> Knute Johnson <nospam@rabbitbrush.frazmtn.com> wrote:
>>
>>> Is there a switch or a way to put the recipient on the command line
>>> and to get that to show in the envelope?  I don't want to use the -t
>>> switch because this will be used for a CGI script and I want to limit
>>> the options for spammers.  When my CGI script sends mail, it shows as
>>> coming from www-data.
>>
>> sendmail -f_envelope_sender_ -oi [other options] -- recipient1 recipient2 ...
>>
>> -f  - set envelope sender
>> -oi - do not treat single dot line as end of message       
>>       (no leading dot conversions)
>> --  - can be used to clearly separate options and recipients
>>
>
> Thanks.  That has a couple of problems, 
> 1) first it supercedes -F and 
> 2) it causes a X-Authentication warning to be put in the mail.  
>
> I guess I'm just not going to be able to make that work.

"2" can be turned off by removing "authwarnings" from "PrivacyOptions".
"authwarnings" may be "bundled" in another option e.g. "goaway".

Remember that sendmail-8.12+ uses two *.cf files: sendmail.cf and
submit.cf. As I understand your situation the warnings are generated by
submit.cf.

-- 
[pl>en Andrew] Andrzej Adam Filip : anfi@onet.eu : anfi@xl.wp.pl
Open-Sendmail: http://open-sendmail.sourceforge.net/
If God wanted us to be brave, why did he give us legs?
  -- Marvin Kitman
0
Reply anfi2 (1412) 2/27/2009 7:27:01 AM

"David F. Skoll" <dfs@roaringpenguin.com> wrote:
> [...]
> Somewhat OT: Isn't issuing an X-Authentication-Warning a bit silly?
> Considering that you can fake anything by running an SMTP session, the
> X-Authentication-Warning header seems quaint and anachronistic.

It is "the tradition" - "Do not fix what is not broken" ;-)

-- 
[pl>en Andrew] Andrzej Adam Filip : anfi@onet.eu : anfi@xl.wp.pl
Open-Sendmail: http://open-sendmail.sourceforge.net/
People who are funny and smart and return phone calls get much better
press than people who are just funny and smart.
  -- Howard Simons, "The Washington Post"
0
Reply anfi2 (1412) 2/27/2009 7:37:50 AM

On 02/27/09 01:37, Andrzej Adam Filip wrote:
> "Do not fix what is not broken"

If it is not broken,
do not fix it,
/optimize/ it.



Grant. . . .
0
Reply gtaylor (1357) 2/27/2009 2:59:51 PM

David F. Skoll wrote:
> Knute Johnson wrote:
> 
> 
>>> sendmail -f_envelope_sender_ -oi [other options] -- recipient1 recipient2
> 
>> Thanks.  That has a couple of problems, first it supercedes -F and it
>> causes a X-Authentication warning to be put in the mail.
> 
> Both of those are easy to fix.  You can set the full name of the sender
> by including an appropriate From: header in your message body, and you can
> stop the X-Authentication-Warning (if it really bothers you) by adding
> www-data to the "t" set, often initialized from the contents of
> /etc/mail/trusted-users.

I added, FEATURE(`use_ct_file')dnl to my sendmail.mc file, I put 
www-data in the /etc/mail/trusted-users file and restarted sendmail.  It 
still puts the X-Auth warning in the header.  I went through the docs 
very carefully and I don't think it should still print the warning.

> Another option is to forget about invoking Sendmail and just use an SMTP
> client library to send via SMTP over 127.0.0.1.  That way, you can control
> everything.
> 
> Somewhat OT: Isn't issuing an X-Authentication-Warning a bit silly?
> Considering that you can fake anything by running an SMTP session, the
> X-Authentication-Warning header seems quaint and anachronistic.

That's actually not a bad idea.  Just stop using sendmail in the CGI 
scripts altogether.

Thanks,

-- 

Knute Johnson
email s/nospam/knute2009/

--
Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
	     ------->>>>>>http://www.NewsDemon.com<<<<<<------
Unlimited Access, Anonymous Accounts, Uncensored Broadband Access
0
Reply nospam8071 (917) 2/27/2009 5:23:18 PM

Andrzej Adam Filip wrote:
> Knute Johnson <nospam@rabbitbrush.frazmtn.com> wrote:
> 
>> Andrzej Adam Filip wrote:
>>> Knute Johnson <nospam@rabbitbrush.frazmtn.com> wrote:
>>>
>>>> Is there a switch or a way to put the recipient on the command line
>>>> and to get that to show in the envelope?  I don't want to use the -t
>>>> switch because this will be used for a CGI script and I want to limit
>>>> the options for spammers.  When my CGI script sends mail, it shows as
>>>> coming from www-data.
>>> sendmail -f_envelope_sender_ -oi [other options] -- recipient1 recipient2 ...
>>>
>>> -f  - set envelope sender
>>> -oi - do not treat single dot line as end of message       
>>>       (no leading dot conversions)
>>> --  - can be used to clearly separate options and recipients
>>>
>> Thanks.  That has a couple of problems, 
>> 1) first it supercedes -F and 
>> 2) it causes a X-Authentication warning to be put in the mail.  
>>
>> I guess I'm just not going to be able to make that work.
> 
> "2" can be turned off by removing "authwarnings" from "PrivacyOptions".
> "authwarnings" may be "bundled" in another option e.g. "goaway".
> 
> Remember that sendmail-8.12+ uses two *.cf files: sendmail.cf and
> submit.cf. As I understand your situation the warnings are generated by
> submit.cf.
> 

OK, that could be why having FEATURE(use_ct_file) in sendmail.mc isn't 
working.  I'll play with that, thanks.

-- 

Knute Johnson
email s/nospam/knute2009/

--
Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
	     ------->>>>>>http://www.NewsDemon.com<<<<<<------
Unlimited Access, Anonymous Accounts, Uncensored Broadband Access
0
Reply nospam8071 (917) 2/27/2009 5:25:19 PM

Knute Johnson <nospam@rabbitbrush.frazmtn.com> wrote:

> David F. Skoll wrote:
>> Knute Johnson wrote:
>>
>>
>>>> sendmail -f_envelope_sender_ -oi [other options] -- recipient1 recipient2
>>
>>> Thanks.  That has a couple of problems, first it supercedes -F and it
>>> causes a X-Authentication warning to be put in the mail.
>>
>> Both of those are easy to fix.  You can set the full name of the sender
>> by including an appropriate From: header in your message body, and you can
>> stop the X-Authentication-Warning (if it really bothers you) by adding
>> www-data to the "t" set, often initialized from the contents of
>> /etc/mail/trusted-users.
>
> I added, FEATURE(`use_ct_file')dnl to my sendmail.mc file, I put
> www-data in the /etc/mail/trusted-users file and restarted sendmail.
> It still puts the X-Auth warning in the header.  I went through the
> docs very carefully and I don't think it should still print the
> warning.
>
>> Another option is to forget about invoking Sendmail and just use an SMTP
>> client library to send via SMTP over 127.0.0.1.  That way, you can control
>> everything.
>>
>> Somewhat OT: Isn't issuing an X-Authentication-Warning a bit silly?
>> Considering that you can fake anything by running an SMTP session, the
>> X-Authentication-Warning header seems quaint and anachronistic.
>
> That's actually not a bad idea.  Just stop using sendmail in the CGI
> scripts altogether.

Do you remember that sendmail daemon listening on 127.0.0.1:25 can stop
accepting incoming SMTP connections in high CPU load situations?
[I have seen a few CGI scripts/installation unprepared for such situation.] 

Sending directly to 127.0.0.1:25 
1) skips submit.cf so it improves performance when everything goes right
2) it is more portable - it makes switching MTA easier

Do you talk about configuration for sending more than occasional email?

-- 
[pl>en Andrew] Andrzej Adam Filip : anfi@onet.eu : anfi@xl.wp.pl
Open-Sendmail: http://open-sendmail.sourceforge.net/
The whole earth is in jail and we're plotting this incredible jailbreak.
  -- Wavy Gravy
0
Reply anfi2 (1412) 2/27/2009 6:45:31 PM

Andrzej Adam Filip wrote:

> Do you remember that sendmail daemon listening on 127.0.0.1:25 can stop
> accepting incoming SMTP connections in high CPU load situations?

Not if you put this in sendmail.mc:

    define(`confREFUSE_LA', `1000000')dnl

By the time your load average hits a million, you have more things to worry
about than a non-listening SMTP daemon. :-)

Regards,

David.
0
Reply dfs6 (705) 2/28/2009 2:08:44 AM

10 Replies
29 Views

(page loaded in 0.069 seconds)


Reply: