Архивные материалы

/dev/blog » sSMTP revaliases, aliases and mail.rc

Материал перенесён из старой базы знаний ATC-IP и оформлен в едином стиле нового сайта.

/dev/blog
…why bore others needlessly
Home
About
Archives
Home
Uncategorized
> sSMTP revaliases, aliases and mail.rc
sSMTP revaliases, aliases and mail.rc
December 2nd, 2009
RaftaMan
Leave a comment
Go to comments
I already
wrote about sending mails with ssmtp
, a simple alternative to sendmail. But since I got a few questions (and I tend to forget myself) how to use ssmtp’s
revaliases
-file, here is a short reminder:
/etc/revaliases
, allows you to map a local user to a specific
‘From:’ address on outbound mail
and to route that mail through a specific mailhub. But it will not rewrite the ‘To:’ address according to the local user who should receive the mail.
Usually, you would add aliases to
/etc/aliases
to ensure that a local user (receiving a mail) is mapped to a valid eMail address. But as the documentation clearly says (if you actually read it),
ssmtp does not use
/etc/aliases
The solution turns out to be letting
mail
handle the alias – which is done by configuring aliases in
/etc/mail.rc
set ask askcc append dot save crt
ignore Received Message-Id Resent-Message-Id Status Mail-From Return-Path Via Delivered-To
alias root root<yourname@domain.com>
alias localuser localuser<yourname@domain.com>
You can test it with with:
# echo test | mail -s "testing ssmtp" localuser
The mail will actually be delivered to yourname@domain.com (since ‘localuser’ is mapped to this address in
/etc/mail.rc
).
Enjoy!
Resources:
http://www.linux.com/archive/feature/132006
http://greybeardedgeek.net/?p=17
votes, average:
5.00
out of 5)
Categories:
Uncategorized
Tags:
CentOS
Fedora
Comments (3)
Trackbacks (2)
Leave a comment
Trackback
Chris
April 13th, 2012 at 12:23 |
#1
Reply
Quote
This is great little tutorial and helped me out no-end. Good work!
john
July 20th, 2012 at 03:27 |
#2
Reply
Quote
exactly what i was looking for. I still cant get mine to work, the TO: emails are still going to my hostname eg localhost@ubuntupc
how do you get the mail.rc file? do you just create it yourself and ssmtp automatically recognises it ?
RaftaMan
July 20th, 2012 at 03:59 |
#3
Reply
Quote
@john
ssmtp doesn’t care about the mail.rc afaik, but if you send your eMail through “mail” (see the example above) it uses the alias set in mail.rc with the MTA you set up.
Note that /bin/mail is just a link to /bin/mailx on Fedora.
February 24th, 2012 at 12:18 |
#1
sSMTP aliases | Записки Плюшевого Крыса
April 12th, 2012 at 19:41 |
#2
Using ssmtp on CentOS « mbrownnyc
Name
E-Mail (will not be published)
Website
Spam protection: Sum of 4 + 6 ?
Subscribe to comments feed
log4j performance
Find empty folders on Linux
Avatars by
Sterling Adventures
RSS
Google
Youdao
Xian Guo
Zhua Xia
My Yahoo!
newsgator
Bloglines
iNezha
Tag Cloud
bash
CentOS
crond
css
ext4
Fedora
firefox
git
Gnome
google
GRUB2
HylaFAX
java
KDE
kickstart
kvm
LaTeX
lirc
Позвонить +7 (343) 382-33-16