Sendmail/"/var/spool/mail/$USER" - question!

Sendmail/"/var/spool/mail/$USER" - question!

Post by Efraim Mostro » Sun, 31 Dec 1899 09:00:00



Hi!

When a USER receives a mail in the spool/mail - directory I
want to execute a program/script.

How can I configure Sendmail to execute a program when user
receives a mail?

I dont want to have crontab running a program that checks
the mail every minute.

Thanks for your help!

--
Remove nospam from my adress to reply.

 
 
 

Sendmail/"/var/spool/mail/$USER" - question!

Post by nob.. » Sun, 31 Dec 1899 09:00:00



> When a USER receives a mail in the spool/mail - directory I
> want to execute a program/script.

> How can I configure Sendmail to execute a program when user
> receives a mail?

Configuring Sendmail is an absoultely huge and very difficult subject
and one that really has nothing to do with Linux since 99.99% of
sendmail configuration is platform independant.  There are sendmail
books, web sites, FAQs, newsgroups, tee-shirts, coffee-mugs,
conferences.

On a per-user basis users can put programs in their ~/.forward

$ echo $LOGNAME >~/.forward # If I want a copy of the mail in my mailbox too
$ echo "| /some/command" >>~/.forward  # Pipe a copy into /some/command

Also the answer depends on what local mail delivery agent sendmail is
configured to use.  For example on SuSE Linux the default is for
sendmail to be configured to use procmail as the local mail delivery
agent so you can put stuff in /etc/procmailrc.

--
     \\   ( )
  .  _\\__[oo

 .  l___\\  
  # ll  l\\  
 ###LL  LL\\

 
 
 

Sendmail/"/var/spool/mail/$USER" - question!

Post by Tony Lif » Sun, 31 Dec 1899 09:00:00


If Linux is the same as AIX then add an item in the /etc/aliases file
e.g. if the mail is sent to fred then the alias item should look like
fred|/usr/local/bin/do_a_program
note the pipe character after fred, the mail is piped into the program
called
/usr/local/bin/do_a_program for you to process.
After adding an entry in /etc/aliases, run the newaliases program to
update the system.
Hope this helps

> Hi!

> When a USER receives a mail in the spool/mail - directory I
> want to execute a program/script.

> How can I configure Sendmail to execute a program when user
> receives a mail?

> I dont want to have crontab running a program that checks
> the mail every minute.

> Thanks for your help!

> --
> Remove nospam from my adress to reply.

 
 
 

Sendmail/"/var/spool/mail/$USER" - question!

Post by reith new » Sun, 31 Dec 1899 09:00:00


I've just got into work and checked the format of the entry

fred:"|/usr/local/bin/do_a_program "
note the position of the pipe and colon


>If Linux is the same as AIX then add an item in the /etc/aliases file
>e.g. if the mail is sent to fred then the alias item should look like
>fred|/usr/local/bin/do_a_program

 
 
 

1. Sendmail: mails rejected with "550-unrouteable mail domain "blade150.lafr.de""

mails sent from my Sun Blade 150 (Solaris 9) via sendmail are rejected
by the destination mail server with message shown above in the subject line.

My sendmail.mc file look like this:
divert(0)dnl

OSTYPE(`solaris8')dnl
DOMAIN(`solaris-generic')dnl
FEATURE(`allmasquerade')
MASQUERADE_AS(lafr.de)dnl
MAILER(`local')dnl
MAILER(`smtp')dnl

I put in the domain name "lafr.de". I thought this will change

But it seems that I am missing something else.

Who can help me ?

Regards - Frank

2. awk, repquota, skip 1st line, bad mojo

3. USING SENDMAIL "user@domain.com" vs. "user@host.domain.com"

4. how to run a command on a specific virtual console

5. "BOGUS" entries in /var/spool/mail.

6. queer data integrity problem

7. Problems with "df" and "du" on "/var"

8. Matrox m3d support in linux?

9. GETSERVBYNAME()????????????????????"""""""""""""

10. Mail for user "backup" going to "root"

11. "Server" via mail: /usr/spool/mail/me a named pipe

12. mail folder is in /var/mail or /var/spool/mail

13. """"""""My SoundBlast 16 pnp isn't up yet""""""""""""