Mail command question
Hi,
i often use the mail command to send email from terminal.
Is it possible to change the default "From: " header?
If i use the mail command from root mails apper to come from System Administrator (root@localhost); i'd like to use a different name.
I know that when in interactive mode i can simply wrote to mail prompt the header i want (From: whatiwant@whatilike) in this case... but i need to do this via script (not interactive) executed by cron
Is it possible to do this?
I actually use this command:
cat /var/log/secure.log | mail -s "Report on `date '+%m/%d/%y% - %H:%M:%S'`" mymailaddress@hostname
Thanks in advance
If you look into the man page of mail command, you will see that it accepts sendmail-options. Then man page of sendmail command shows that "-r sender" is the option to set the "envelope sender address".
Did you try "mail -r sender" but it didn't satisfy you?
I guess it also sets the "From:" header, but if you want set the "From:" alone, then you may try:
<pre>
echo "Subject: Report on `date '+%m/%d/%y - %H:%M:%S'`
From: whatyoulike@whatyoulike
" |
cat - /var/log/secure.log |
/usr/sbin/sendmail -i yourmailaddress@hostname</pre>
PowerMacG4, PowerBookG4, iMac(C2D) Mac OS X (10.4.9)
Similar Messages
-
Hi,
We have configured SMTP server details in OBIEE 11g OEM to send mail from Agent. When we run Agents, we are getting the error
[nQSError:75006] Unable to send MAIL Command.5.7.1 Client was not authenticated
Did anyone face the issue? In that Case, Please give some inputs on that.Hi Satya,
I would like to few more which I have done today.
I wanted to test telnet SMTP on the OBIEE Installed Machine and I was able to succeed also. Please find below what I did
C:\>telnet mail.smtp.com 25
220 internal.mail.smtp.com Microsoft ESMTP MAIL Service Readt at Fri,
25 May 2012 00:51:00 -0400
ehlo
250-internal.mail.smtp.com Hello [162.44.76.47]
250-SIZE
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-X-ANONYMOUSTLS
250-AUTH NTLM LOGIN
250-X-EXPS GSSAPI NILM
250-8BITMIME
250-BINARYMIME
250-CHUNKING
250-XEXCH50
250 XRDST
AUTH LOGIN
334 VXN1cm5hbWU6
Uy5SY-------------- Mail User Name
334 UGFzc3dvcmWU6
U2hfpd------------- Mail Password
235 2.7.0 Authentication Successful
mail from:[email protected]
250 2.1.0 Sender OK
rcpt to:[email protected]
250 2.1.5 Recipient OK
data
354 start mail input; end with <CRLF>.<CRLF>
This is a Test Mail
250 2.6.0 <internal.mail.smtp.com>
Queue Mail for Delivery
Mail Received in Inbox
So, My Question is that, I am able to receive the Mail if I directly access SMTP via Telnet then , Why it is not working in OBIEE and it throws error
[nQSError:75006] Failed to send MAIL Command.5.7.1 Client was not authenticated
Please help on resolving the issue? -
Topic area: Apple Mail. Question: How do I get the message preview window to display to the right of my list of email messages? i.e. to preview whatever message is currently highlighted in the center window list of messages?
At present there is no preference option available to move the preview
pane to right side of the mail window.
Best. -
Mail command in script hangs and does not release control to calling script
Hello folks,
I am running in a situation which I haven't seen before.
Main script calls function which executes another script.
No matter which statement is the last in called script, it hangs on the last line and does not return control to main script.
I tried to call another script not within the function - it is the same result.
Can you help please.
Below example of code:
--- Main script:
function checksum
set -x
/sybdump/ukgoald/scripts/egrep_expr1
##MAIN --- call to script script execution which runs mail command
checksum
---- trace execution of called script:
+ read A B RF_FULL_NAME
+ print
+ /usr/bin/mailx -s Checksum Report [email protected]
+ 0< /sybdump/ukgoald/dump1/egrep_expr1.log3
+ print
+ return 0
Edited by: ge**** on Dec 14, 2010 11:29 PMHello folks,
I am running in a situation which I haven't seen before.
Main script calls function which executes another script.
No matter which statement is the last in called script, it hangs on the last line and does not return control to main script.
I tried to call another script not within the function - it is the same result.
Can you help please.
Below example of code:
--- Main script:
function checksum
set -x
/sybdump/ukgoald/scripts/egrep_expr1
##MAIN --- call to script script execution which runs mail command
checksum
---- trace execution of called script:
+ read A B RF_FULL_NAME
+ print
+ /usr/bin/mailx -s Checksum Report [email protected]
+ 0< /sybdump/ukgoald/dump1/egrep_expr1.log3
+ print
+ return 0
Edited by: ge**** on Dec 14, 2010 11:29 PM -
IS THERE A SEND MAIL COMMAND?
I was wanting to know if there is a SEND MAIL COMMAND or something similiar to a SEND MAIL COMMAND that would automatically send a hard coded email message from an ORACLE FORM when a button on that form was pushed instead of opening up MICROSOFT OUTLOOK and having the user enter an email message and then hitting the SEND BUTTON.
I know that this can be done using SMTP code in a WHEN_BUTTON PRESSED TRIGGER. This happens when the last part of the mail host name is the same as the last part of the email address. For example, the mail host name on my PC is
'ERECEMH1-BH.EREC.ARMY.MIL' and my email address hard coded in the program is '[email protected]', the message gets sent. However if the
email address hard coded in the program is '[email protected]' then the hard coded email message in the program does not get sent.
What is causing this to not happen?Since Im a 21 year retired US Air Force veteran I've decided to help you out.... :)
If you want to send email, with attachments, from an Oracle form implement one of these two methods.
1) Heres how you send email with attachments from the database for 8i and 9i using smtp..
http://www.oracle.com/technology/sample_code/tech/pl_sql/htdocs/Utl_Smtp_Sample.html
2) but, heres a newer/simpler utl_mail 10g method ...
http://download-east.oracle.com/docs/cd/B19306_01/appdev.102/b14258/u_mail.htm
With the first example you will have to change the mail host in the code to a SMTP server in your organazation. I have not used the second newer 10g example but have heard it is easy. If you have 10g database you should probably use it.
From your email it is not clear what you are doing currently? Are you using outlook or are you using SMTP? If you are using SMTP then how exaclty are you doing that?
Disregarding all of the above for a moment... Are you sure its not getting "sent" or is just not getting "received". The email may actually be getting sent to an incorrect address, but since you are doing it, possibly, from outlook, there is no from email address to send the bounced email message back to...
There is no forms send_mail built-in command. Gotta use one of the options above or outlook.
You can call outlook from ole2 or do this...
web.show_document('mailto:[email protected]?subject=Happy%20Birthday&body=I%20dont%20like%20green%20eggs%20and%20ham');
Using outlook to send email, or any client email software, is generally not a good idea. Its better to setup one of the options above, 1 or 2, and email from the database not the client.
And.. there's even a java mail solution...
Message was edited by:
Mark Reichman -
Using the MAIL command of UNIX through JAVA
Can any one give me a lead or example on how to call the MAIL command of UNIX to send mails using JAVA.
Use java.lang.Process for it. See the code below, it will
help you understand how it would be possible.
Process p = Runtime.getRuntime().exec("mail username");
in = p.getInputStream();
out = p.getOutputStream();
Now stdout will be available on 'in' for reading e.g.
you can expect Subject: and Cc: lines on linux box.
and write data/message to 'out'. It will be the message
which you will wrile in normal use of mail on stdin.
Good Luck
Mumtaz Siddiqui -
[nQSError: 75006] Failed to send MAIL Command
Hello,
We are on AIX and Siebel Analytics 7.8.5. We are having a weird issue with ibots. Wwe have around 800 ibots and only 65 of them fail with *[nQSError: 75006] Failed to send MAIL Command* this error. These ibots use to work good. I have created some test ibots and even those fail with the same error.
Does any one have an idea..how to resolve this?
Thanks in advanceWe are using Exchange Server. We are able to send e-mails to many usres....that means the credentials are correct. If we reschedule a delivered report..it is successful.
Eventually succeeded, but encountered and resolved errors...
Number of skipped recipients: 1 of 2
+++ ThreadID: 8ca6 : 2010-09-23 09:30:37.000
iBotID: /shared/_iBots/NBR - ED and Mktg/NBR Alert - Private Equipment
[nQSError: 75006] Failed to send MAIL command.
+++ ThreadID: 8ca6 : 2010-09-23 09:30:37.000
iBotID: /shared/_iBots/NBR - ED and Mktg/NBR Alert - Private Equipment
...Trying SMTP Delivery loop again
+++ ThreadID: 8ca6 : 2010-09-23 09:30:37.000
... Sleeping for 9 seconds.
+++ThreadID: 8ca6 : 2010-09-23 09:30:46.000
iBotID: /shared/_iBots/NBR - ED and Mktg/NBR Alert - Private Equipment
[nQSError: 75006] Failed to send MAIL command.
+++ ThreadID: 8ca6 : 2010-09-23 09:30:46.000
iBotID: /shared/_iBots/NBR - ED and Mktg/NBR Alert - Private Equipment
...Trying SMTP Delivery loop again
+++ ThreadID: 8ca6 : 2010-09-23 09:30:46.000
... Sleeping for 4 seconds.
+++ ThreadID: 8ca6 : 2010-09-23 09:30:50.000
iBotID: /shared/_iBots/NBR - ED and Mktg/NBR Alert - Private Equipment
[nQSError: 75006] Failed to send MAIL command.
Thanks -
The sender information of mail command
Hi there,
Our machine is running Solaris 9 and using NIS. I sshed in as a regular user A and "su -" to root user. I typed following command as root user "mail A test ctrl^d". I switched back to regular user A and checked the email of A. I found the email with the content "test" as expected but I found the sender of the email is A NOT the root. I am wondering why I issued the mail command as root but the sender is not root but user A?
Thanks in advance!I guessing but probably because mail is using your real UID and not your effective UID. Take a look at the -r switch. You could also use the -f switch with sendmail.
-
Mail not delivered when sent with the Unix "mail" command
I am trying to send mail from the Unix command line with the "mail" command. Whenever I try to send an e-mail using a command of the form:
mail -s 'This is the subject' <email address>
the mail message always ends up in subdirectories of the postfix "deferred" directory:
/private/var/spool/postfix/deferred
It seems that the mail system runs for 60 seconds after an e-mail is sent and during that time I can run "mailq". If I do that I see something like the following:
-Queue ID- Size ----Arrival Time---- -Sender/Recipient-------
0195D1534C54 494 Sat Oct 18 11:48:13 [email protected]
(connect to broadpark.no\[217.13.4.67\]: Operation timed out)
[email protected]
040F51556A8C 334 Sat Oct 18 17:42:39 [email protected]
(connect to broadpark.no\[217.13.4.67\]: Operation timed out)
[email protected]
0C408153869D 1992 Sat Oct 18 12:26:48 MAILER-DAEMON
(connect to broadpark.no\[217.13.4.67\]: Operation timed out)
[email protected]
3B10415374FC 1992 Sat Oct 18 12:23:47 MAILER-DAEMON
(delivery temporarily suspended: connect to broadpark.no\[217.13.4.67\]: Operation timed out)
[email protected]
4509815374C0 342 Sat Oct 18 12:21:47 [email protected]
(delivery temporarily suspended: connect to broadpark.no\[217.13.4.67\]: Operation timed out)
[email protected]
4CFC915374C7 2050 Sat Oct 18 12:21:47 MAILER-DAEMON
(delivery temporarily suspended: connect to broadpark.no\[217.13.4.67\]: Operation timed out)
[email protected]
+<lots of lines snipped out>+
It seems to be complaining that the connection timed out to broadpark.no\[217.13.4.67\], which is the domain of my ISP.
My outgoing SMTP mail server is:
mail.broadpark.no\[217.13.6.35\]
Could it be that mail system is trying to connect to the wrong SMTP mailserver? If so, how can I fix this?
I should mention that mail flows perfectly in and out of my machine via the Mail.app program. I am only having problem sending mail down at the Unix command line level.
I had this working on OS X 10.4.x, but this is the first time I have tried this with Leopard.
Any help/suggestions would be greatly appreciated. Thanks in advance.Perhaps I should have been a little bit clearer why I want to be able to send mail via my local mail/postfix system: I have several servers set up on my iMac, in particular:
apache
trac
I want these servers to be able to send mail to, e.g.,
webmaster@localhost
root@localhost
trac@localhost
I have created aliases for these addresses in:
/etc/postfix/aliases
(I have also executed "newaliases"). These aliases all point to my own user account on the same machine (my iMac).
Finally, I have a .forward file at the root level of my OS X account that forwards all local Unix mail to my normal e-mail account handled by my ISP.
This way, all local mail sent to "webmaster2, "root", "trac", etc., should be sent to my normal e-mail address that I monitor with Mail.app.
*This all worked perfectly with Mac OS X 10.4.x,* so I know it should be possible. However, I have only now just tried to set this up 10.5.x (Leopard) and, clearly, I am having problems.
Perhaps this motivation for wanting to send e-mail via the Unix mail system will help others understand my situation, and I hope someone can point me in the right direction. Thanks very much in advance. -
Hi, I just set up a new Tiger Xserve. When I go to mail myself from the command line, the mail goes through without a hiccup. The problem is that I don't recieve the mail and our mail server admin says nothing went through there either. No errors or anything to indicate a problem. I run two 10.3 servers and can use the mail command just fine, no extra config needed.
Did something change with 10.4?Ok, I enabled the mail server and set the smtp to relay to our smtp mail server. Now the command works. Does anyone know why the mail server has to be enabled on 10.4 to make this work? On 10.3, the mail server does not need to be enabled to send mail from the server. I thought the whole idea of using sendmail/postfix was so you could avoid having an smtp server running...?
-
Had a user forward me the undeliverable she recevied back trying to
send an email to an address she's sent to before.
The message that you sent was undeliverable to the following:
[email protected] (503 5.5.1 MAIL command expected)
Information about your message:
Subject: subject........not important
GroupWise Message Id: 517A6D49.B2F:123:45810
Message log tag: 479565
Number of send attempts: 1
Time of initial send attempt: 04-26-13 12:05:01
What gives? Something I need to check on my GWIA or elsewhere?
Running gw2012 sp1, gwia running on sles11sp1/oes11 (64bit) box.
StevoOn 4/26/2013 1:31 PM, Stevo wrote:
> Had a user forward me the undeliverable she recevied back trying to
> send an email to an address she's sent to before.
>
> The message that you sent was undeliverable to the following:
>
> [email protected] (503 5.5.1 MAIL command expected)
>
>
> Information about your message:
> Subject: subject........not important
> GroupWise Message Id: 517A6D49.B2F:123:45810
> Message log tag: 479565
> Number of send attempts: 1
> Time of initial send attempt: 04-26-13 12:05:01
>
>
> What gives? Something I need to check on my GWIA or elsewhere?
>
> Running gw2012 sp1, gwia running on sles11sp1/oes11 (64bit) box.
>
Absolutely nothing to figure out without a wire trace.
SMTP says do
EHLO (or HELO
MAIL FROM:<from adddress>
RCPT TO:<to address>
DATA
Any out of order command is rejected.
Could be bad sender, bad firewall proxy, etc. -
Sending Mail to Local Users via the Terminal mail Command
I am having trouble sending mail to other user account via the terminal mail command. It seems to work with some accounts i.e. guest, etc, but fails with others i.e. Dennis. It will fail with no error message. Has anyone had any experience using the unix mail command locally ?
DennisI don't know the answer to this but you might try the -v option on the mail command in order to get verbose output. Perhaps a useful message would pop up.
Also, you might consider posting this message in the Unix Forum. There is a good chance that someone there can help you with this issue.
EMAC G4 1.0 GHz Mac OS X (10.4.6) -
[SOLVED]mail command not found
What package should I install to get the mail command working?
I used it to check my cron mails but doesn't work anymore.
keerthi ~ $ mail
bash: mail: command not found
Last edited by keerthi (2008-02-04 17:57:07)You want mailx or the alternative heirloom implementation (in community, I believe)
-
Hi there,
This may be a crazt question but I was curious if there was a way to get information from apple mail in report format.
I would like to create report showing waht folder the email is in.
My reason for doing this I seem tobe missing emails. So instead of going in to each folder, I wondered if I could generate a report of some kind to do it. Maybe an Applescript? I do not know how to create scripts.
Or is there a way to add an additonal header in MAIL that would show the folder the email is saved in?
Thanks and I look forward to your reply.
...BruceOK, so first some background:
1) The basic process goes like this:
a) one release doc (edited by the developer, presumably) and the
template docs are copied to the build area
b) Each doc is unzipped (ODT's are just ZIP files) into a subdir
c) The doc contents are copied around; this is to allow Ant to
replace its special @VAR@ variables in the document content
d) The docs are zipped back up into ODTs
e) The ODTs are converted into PDFs using OOo's macro functionality
Here are the troubleshooting steps I would apply:
1) Make sure the external.odt file exists - check the build area
(//content/build/<pluginname>/tmp/) and can be opened using normal
OpenOffice
2) Check that the release.odt file exists (same location) and can be
opened using normal OpenOffice
3) See if you can manually convert the external.odt file into a PDF -
the command we use is simply:
soffice -invisible
macro:///Standard.Collectors.External2PDF(${pkgdir}/tmp/external.odt)
(replace ${pkgdir} with the build directory path).
If all that works, then the Ant build process should work.
Also - what does that OpenOffice error popup say?
DCorlette
DCorlette's Profile: http://forums.novell.com/member.php?userid=4437
View this thread: http://forums.novell.com/showthread.php?t=416875 -
This is a example and I hope it's not too confusing but I don't want to give out the domain name I'm using so I will call it example.com for this question.
If have a server and named it mail.example.com. So if I make a account called User, I will get the mail box [email protected] The problem is the user I created has an existing email account called [email protected] I'm planning to stop the old mail server and have this one host the email. How can I get this server to assign the user the email address "[email protected]" off the old server? We can hack this through the terminal to get it to work but don't want to change the files this way. I want to know how to do it through the GUI.
ThanksIn Server Admin
Under the General Tab for Mail
Set Domain name to: example.com
Set the Host name to: mail.example.com
Then in the Advance Tab Select the Hosting tab
and make sure the "Include server's domain as local host alias" is checked.
These settings should allow any new user to have the their email default to
[email protected]
*I have noticed that squirrelmail will still use [email protected]
To fix squirrelMail you will need to go to the command line
Type: sudo /etc/squirrelmail/config/conf.pl
to mail changes to default configuration.
2 Enter : for Server Settings
Then
1 Enter :for Domain
Type your domain then Enter
Q to quite then save your changes.
Hope this helps
Maybe you are looking for
-
Fonts error occurred in Acrobat 7.0
We have been using Acrobat Professional 7.0 Mac version. We had an issue below while working on the PDF. 1. We have received 2 sets of PDF for the same chapter with comments. One is from Author and rest from PR. 2. We need to export the comments from
-
Importing Word docs from RH for Word X5 - out of memory error
I've tried a few times to import 537 Word docs (2,974) from a RH for Word project (RH X5 for Word, CHM output) into a new RH HTML 5 project. Each time, RH HTML "hangs" and I've seen "out of memory" at least once at the very end. The original RH for W
-
(-1200) DBMCconnBase::EndTransaction - Outgoing Payments
Hi Experts, We are getting this error when trying to add an outgoing payment. (-1200) DBMCconnBase::EndTransaction SQLEndTran sqlState: , nativeErr: 68609788, errText: C:\Program Files (x86)\SAP\SAP Business One\SAP Business One.exe PID=3548
-
How to fire event in VS C# when QuickTime sees a marker.
I am using Visual Studio 2005 C# to run QT with ActiveX. I have set markers in the video file that show up in the window at the bottom of a QT movie. I want to be able to capture that marker with an event handler and tell a microcontroller to do so
-
Win Xp VM on OVS - Increase virtual desktop size to 1920x1080(full screen)
Hi, I've installed Windows Xp virtual machine on Oracle Virtual Server host. I use the XP VM by Microsoft Remote Desktop function from another windows desktop PC. The Xp VM desktop size is max. 1600x1200/16bit. I'd like to use the Xp VM by Ms RDP in