LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-16-2004, 10:59 PM   #1
Kalar
LQ Newbie
 
Registered: Nov 2003
Distribution: Fedora Core 1
Posts: 2

Rep: Reputation: 0
How can I use the Mail command with Sendmail Options


Hello,

I recently setup and configured CVS on a FC1 machine and I've managed to figure out how to get the CVS to email me all commit messages. The problem is that it is not perfect.

First some background on what I am doing. Since the CVS machine is a local machine it doesn't actually have a "real" IP address to the outside world; just to my dynamic IP. The emails get sent to a mailinglist on my Web host. To allow the mail server on my Web host to accept the mails, I had to configure a DynDNS IP to show it that "yes, the domain does exist".

The list software gives me two (relevent) options: 1. Allow posts from non-registered users, and 2. The list of members on the list. I do not have the option of changing the mailing list software (unfortunately).

I definitely want to enable option (1) to get rid of spam on the mailing list, but since the email address (eg.: ) localCVSuser@whatever.dyndns.org gets put into the from field of each email, the commit emails can't be sent to the list (even subscribing that addr to the list would cause problems because it doesn't exist IRL).

After some searching, I found that I can (somewhat) fake the from address using sendmail -f, but sendmail refuses to run on FC1 unless it's the root user or a "trusted user" (whatever that means).

Then I looked at the mail option, which can be run as any user, and according to the "mail --help":
Code:
Usage: mail [-iInv] [-s subject] [-c cc-addr] [-b bcc-addr] to-addr ...
            [- sendmail-options ...]
       mail [-iInNv] -f [name]
       mail [-iInNv] [-u user]
... sendmail options can be included in the command line.

The problems is: how? They imply that a "-(space)(sendmail-options)" format should be used, but it ends up giving me strange results. For example, the command:
mail -s "cvs test" maillist@mydomain.com - -f cvs@mydomain.com

Sends a message to cvs@mydomain.com, with a to field of maillist@mydomain.com, and a From field of the local CVS machine user (eg.: localCVSuser@whatever.dyndns.org).

I'm a (little past a) Linux newbie, but I can't figure this out. Does anyone know how I can use the sendmail-options with the "mail" command? (And yes, I checked "man"; it didn't even mention the sendmail options, but mentioned that not all options were listed because "most were not useful to the general user" .

Thanks in advance.
 
Old 07-16-2004, 11:35 PM   #2
Kalar
LQ Newbie
 
Registered: Nov 2003
Distribution: Fedora Core 1
Posts: 2

Original Poster
Rep: Reputation: 0
Answer found!

Just when I had given up hope, I found the answer here:
http://www.mail-archive.com/uug-list.../msg10431.html

Apparently, the "mail --help" output is a big lie. Well, maybe a typo... but we'll call it lie.

The original text output stated:
Code:
Usage: mail [-iInv] [-s subject] [-c cc-addr] [-b bcc-addr] to-addr ...
            [- sendmail-options ...]
       mail [-iInNv] -f [name]
       mail [-iInNv] [-u user]
When it should have said:
Code:
Usage: mail [-iInv] [-s subject] [-c cc-addr] [-b bcc-addr] to-addr ...
            [-- sendmail-options ...]
       mail [-iInNv] -f [name]
       mail [-iInNv] [-u user]
Notice the extra "-" on the second line above. Now, adding -- -f youremail@yourdomain.com will set the from field to that address.

Thanks anyway to those who read this!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to make Sendmail forward all incoming mail to localhost port 26 (Domino mail) speedgelb Linux - Software 3 09-27-2013 11:18 AM
sendmail error Fetching mail could not lock /var/spool/mail/username sukhdev50 Linux - Networking 0 05-04-2005 04:41 AM
Mail command (much) faster than sendmail bmorel Linux - Software 7 04-02-2005 06:57 PM
Sendmail Options skidmarc Linux - Software 0 10-16-2003 07:25 AM
sendmail: Routing dead mail to a shell command? noisybastard Linux - Networking 1 10-05-2003 05:13 PM


All times are GMT -5. The time now is 06:49 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration