Sponsored Content
Full Discussion: Sendmail / Aliases
Top Forums UNIX for Dummies Questions & Answers Sendmail / Aliases Post 1582 by ComTec on Friday 16th of March 2001 03:54:34 PM
Old 03-16-2001
I'm trying to make a script that will automatically read incoming mail, parse the recipient, then send a file off to the recipient.
(Name of file = mail.pl)
#!/usr/bin/perl
$mailDir = "/var/spool/mail/"
$user = print `cat <STDIN> | grep To: | cut -b5-`;
print `elm -s Awaiting Mail $user < /tmp/alert";

And the entry in the aliases file goes:
test: "| /home/mail/mail.pl"
is that correct aswell?
 

10 More Discussions You Might Find Interesting

1. Programming

aliases

Hi. I have a C program that is using the **environ pointer and I am trying to set up aliases for a system("/bin/ksh") call. This works for other environment variables but not for the aliases. Does anyone know if this can be done? Thanks ahead of time. (1 Reply)
Discussion started by: mluey61
1 Replies

2. UNIX for Dummies Questions & Answers

aliases

Is there a way to view what aliases are running on a given session? (1 Reply)
Discussion started by: BG_JrAdmin
1 Replies

3. UNIX for Advanced & Expert Users

sendmail aliases not being honored

Running sendmail Version 8.12.10+Sun on Solaris 9. I need to send mail from this server (serverA) to the mail server (Mserver), which will relay the message to the correct user. If I specify the user specifically, as in: mailx -s"test" John.Doe@company.com test . It works perfectly and... (13 Replies)
Discussion started by: dangral
13 Replies

4. Shell Programming and Scripting

etc aliases

Hello: i have several server with own etc aliases. right now i want to combine it all into a general etc aliases in a new freebsd server. cause it consist hundred thousand of record user inside how to make a shell script to combine it or configure it. all etc aliases record example: ... (0 Replies)
Discussion started by: peterLfs
0 Replies

5. UNIX for Dummies Questions & Answers

Setting aliases

How come if I set an alias as such: alias dt 'date "+%Y-%m-%d %H:%M:%S"' it will work as intended, ie the command 'dt' does prompt the date and time, but not when invoked through a script as such: #!/bin/sh alias dt 'date "+%Y-%m-%d %H:%M:%S"' The OS is FreeBSD 7.1. Thanks in advance (4 Replies)
Discussion started by: figaro
4 Replies

6. UNIX for Dummies Questions & Answers

Aliases In Unix

Hi, I am new to Unix. I want to know how to setup aliases in Unix. Mean if i write a particular word say scripts then it should take me to scripts directory. Kindly help. (2 Replies)
Discussion started by: amritansur
2 Replies

7. Shell Programming and Scripting

Using Aliases in a script

Hi all, I have and alias set in .profile like alias ll='ls -la' I am writing a shell script in which i am using "ll" but it gives command not found . Can anyone please tell me how source aliases in the script we write do i need to define it again in every script i write is there any oher... (1 Reply)
Discussion started by: firestar
1 Replies

8. UNIX for Advanced & Expert Users

sendmail: trusted-users or aliases?

For a project that I have been assigned to, I need to send emails to a business partner (business_partner.com) from one production server. However, my emails neither reach their destination nor bounce back to me. Working with our business partner's IT support, the following error was discovered... (1 Reply)
Discussion started by: alan
1 Replies

9. Red Hat

/etc/aliases & Sendmail

I've recently migrated a Solaris 10 server, to Redhat. I've migrated all my crons & scripts and now I'm attempting to set all the aliases, to send to the appropriate accounts. I have a particular user defined in /etc/aliases, however, when a particular script is ran in cron, I do not receive any... (2 Replies)
Discussion started by: Nvizn
2 Replies

10. Solaris

Clarifying sendmail configuration - sendmail-client offline

Hi all, I have read about sendmail running as 2 separate process. 1 as a MSP, and the other as the real daemon or MTA. In my current configuration, the sendmail-client is disabled. Both submit.cf and sendmail.cf are left as default untouch I do not specified any mailhost... (3 Replies)
Discussion started by: javanoob
3 Replies
MAIL(1) 						      General Commands Manual							   MAIL(1)

NAME
mail - send and receive electronic mail SYNOPSIS
mail [-dpqrv] [-f file] [user] OPTIONS
-d Force use of the shell variable MAILER -f Use file instead of /usr/spool/mail/user as mailbox -p Print all mail and then exit -q Quit program if SIGINT received -r Reverse print order, i.e., print oldest first -v Verbose mode EXAMPLES
mail ast # Send a message to ast mail # Read your mail DESCRIPTION
Mail is an extremely simple electronic mail program. It can be used to send or receive email on a single MINIX system, in which case it functions as user agent and local delivery agent. If the flag MAILER is defined in mail.c, it can also call a transport agent to handle remote mail as well. No such agent is supplied with MINIX. When called by user with no arguments, it examines the mailbox /usr/spool/mail/user, prints one message (depending on the -r flag), and waits for one of the following commands: <newline> Go to the next message - Print the previous message !command Fork off a shell and execute command CTRL-D Update the mailbox and quit (same as q) d Delete the current message and go to the next one q Update the mailbox and quit (same as CTRL-D) p Print the current message again s [file] Save message in the named file x Exit without updating the mailbox To send mail, the program is called with the name of the recipient as an argument. The mail is sent, along with a postmark line containing the date. For local delivery, a file named after the recipient in the directory /usr/spool/mail must be writable. If the directory /usr/spool/mail does not exist then the mail is dumped on the console, so that system programs have a way to notify a user on a system that does not have a mail spool. MAIL(1)
All times are GMT -4. The time now is 07:09 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy