Obsah
Sendmail
/etc/mail/sendmail.cf
- konfigurák je soubor .mc který se kompiluje pomocí m4 příkazem
m4 sendmail.mc > sendmail.cf dnl- delete to new line vše za tímto je bráno jako komentář
divert(-1) # # komentář divert(0)dnl dnl # zde musi byt uvedena cesta k cf.m4 include(`/usr/share/sendmail-cf/m4/cf.m4')dnl VERSIONID(`$Id: generic-linux.mc,v 8.1 1999/09/24 22:48:05 gshapiro Exp $')dnl OSTYPE(`linux')dnl dnl # cesta k procmailu či dropmailu dnl define(`PROCMAIL_MAILER_PATH',`/usr/bin/procmail')dnl dnl # pro lokalni dorucovani budem pouzivat procmail (dropmail) dnl FEATURE(local_procmail)dnl dnl Toto bere v úvahu soubor /etc/mail/access.db kde jsou IP nebo domény, ze kterých je možno dnl posílat maily FEATURE(access_db)dnl DAEMON_OPTIONS(`Port=smtp,Addr=0.0.0.0,Name=MTA')dnl DOMAIN(generic)dnl MAILER(smtp)dnl MAILER(local)dnl
/etc/mail/access
- musí se zkompilovat do access.db podoby
makemap hash access < accessnebo pokud je v adresáři Makefile, stačí jen příkazmake
10.10 RELAY cyberpromo.com REJECT sendmail.org RELAY
přepsání odesilatele
- /etc/mail/sendmail.mc
FEATURE(masquerade_envelope)dnl FEATURE(`genericstable')dnl GENERICS_DOMAIN(`localhost.localdomain')dnl
- /etc/mail/genericstable
root user@example.com mohan mohan@nerdplanet.co.uk
SMART_HOST - nadřazený SMTP
- pokud je potřeba nakonfigurovat sendmail tak, aby posílal maily rovnou nadřazenému SMTP - manuál
- vytvořit soubor /etc/mail/service.switch a určit, jaké služby má sendmail využívat pro převod jmen resp. bude potřeba nastavit jej tak, aby se nepoužívalo dns:
aliases files
hosts nis files - dále přidat do sendmail.mc
define(`SMART_HOST', `name.of.smart.host')dnl
FEATURE(`accept_unresolvable_domains')dnl
FEATURE(`accept_unqualified_senders')dnl - do submit.mc přidat řádek
define(`confDIRECT_SUBMISSION_MODIFIERS', `C')dnl
sendmail.mc podrobněji
divert(-1) divert(0)dnl VERSIONID(`$Id: generic-linux.mc,v 8.1 1999/09/24 22:48:05 gshapiro Exp $')dnl
define(`confDEF_USER_ID',`8:12')dnl
- dnl This configuration option specifies the default user id. In our case the user mail and group mail, which correspond to ID number 8:12 see the /etc/passwd and /etc/group file.
OSTYPE(`linux')dnl
- dnl This configuration option specifies the default operating system Sendmail wil bel running on; in our case the linux system. This item is one of the minimal pieces of information required by the mc file.
DOMAIN(`generic')dnl
- dnl This configuration option will specify and describe a particular domain appropriated for your environment.
define(`confTRY_NULL_MX_LIST',true)dnl
- dnl This configuration option specifies whether the receiving server is the best MX for a host and if so, try connecting to that host directly.
define(`confDONT_PROBE_INTERFACES',true)dnl
- dnl This configuration option, if set to true, means Sendmail will _not_insert the names and addresses of any local interfaces into the $=w class, list of known equivalent addresses.
define(`confMAX_MESSAGE_SIZE',`20000')dnl
- dnl Velikost zprávy, kterou muze SENDMAIL přijmout
define(`confMAX_RCPTS_PER_MESSAGE',`10')dnl
- dnl Maximalni pocet prijemcu v jedne zprave
define(`SMART_HOST', `your.isp.mail.server')
- dnl pres tento server se budou odesílat všechny maily
define(`PROCMAIL_MAILER_PATH',`/usr/bin/procmail')dnl
- dnl This configuration option sets the path to the procmail program installed in your server. Since the path in Red Hat Linux differs from other Linux versions, we must specify the new path with this macro. It's important to note that this macro is also used by FEATURE(`local_procmail') as defined later in this file.
define(`LOCAL_MAILER_FLAGS', `ShPfn')dnl
- dnl This configuration option defines the flags that must be used by the local mailer (procmail). See your Sendmail documentation for more information of each one.
define(`LOCAL_MAILER_ARGS', `procmail -a $h -d $u')dnl
- dnl This configuration option defines the arguments that must be passed to the local mailer (procmail). See your Sendmail documentation for more information on each one.
FEATURE(`nocanonify')
- nezjišťuje IP adresy domén odesílatele. Vhodné, pokud není k dispozici DNS
FEATURE(`smrsh',`/usr/sbin/smrsh')dnl
- dnl This m4 macro enables the use of smrsh, the sendmail restricted shell, instead of the default /bin/sh for mailing programs. With this feature you can control what program gets run via e-mail through the /etc/mail/aliases and ~/.forward files. The default location for the smrsh program is /usr/libexec/smrsh. Since we have installed smrsh in another location, we need to add an argument to the smrsh feature to indicate the new placement /usr/sbin/smrsh. The use of smrsh is recommended by CERT, so you are encouraged to use this feature as often as possible.
FEATURE(`mailertable')dnl
- dnl This m4 macro enables the use of mailertable database selects new delivery agents. A mailertable is a database that maps host.domain names to special delivery agent and new domain name pairs. With this feature, mail can be delivered through the use of a specified or particular delivery agent to a new domain name. Usually, this feature must be available only on a Central Mail Hub server.
- např.
friendsdomain.com smtp:[mx1.friendsdomain.com]
FEATURE(`virtusertable',`hash -o /etc/mail/virtusertable')dnl
- dnl This m4 macro enables the use of virtusertable, support for virtual domains, which allow multiple virtual domains to be hosted on one machine. A virtusertable is a database that maps virtual domains into new addresses. With this feature, mail for virtual domains can be delivered to a local, remote, or single user address. Usually this feature must be available only on a Central Mail Hub server.
FEATURE(`redirect')dnl
- dnl This m4 macro enables the use of redirect support for address.REDIRECT. With this feature, mail addressed to a retired user account wahib, for example, will be bounced with an indication of the new forwarding address. The retired accounts must be set up in the aliases file on the mail server. Usually this feature must be available only on a Central Mail Hub server.
FEATURE(`always_add_domain')dnl
- dnl This m4 macro enables the use of always_add_domain, add the local domain even on local mail. With this feature, all addresses that are locally delivered will be fully qualified. It is safe and recommended to set this feature for security reasons.
FEATURE(`use_cw_file')dnl
- dnl This m4 macro enables the use of use_cw_file, use /etc/mail/local-host-names file for local hostnames. With this feature you can declare a list of hosts in the /etc/mail/local-host-names file for which the local host is acting as the MX recipient. In other word this feature causes the file /etc/mail/local-host-names to be read to obtain alternative names for the local host.
FEATURE(`local_procmail')dnl
- dnl This m4 macro enables the use of local_procmail use procmail as local delivery agent. With this feature you can use procmail as a Sendmail delivery agent.
FEATURE(`access_db')dnl
- dnl This m4 macro enables the access database feature. With this feature you have the ability through the access db to allow or refuse to accept mail from specified domains. Usually this feature must be available only in a Central Mail Hub server.
dnl FEATURE(`blacklist_recipients')dnl
- dnl This m4 macro enables the ability to block incoming mail for certain recipient usernames, hostnames, or addresses. With this feature you can, for example, block incoming mail to user nobody, host foo.mydomain.com, or guest@bar.mydomain.com.
dnl FEATURE(`dnsbl')dnl
- dnl This m4 macro enables Sendmail to reject mail from any site in the Realtime Blackhole List database rbl.maps.vix.com. The DNS based rejection is a database maintained in DNS of spammers. For details, see http://maps.vix.com/rbl/.
FEATURE(`accept_unresolvable_domains')
- dnl Povolí příjem z domén, které nejdou resolvovat
MAILER(`local')dnl
MAILER(`smtp')dnl
MAILER(`procmail')dnl
- dnl This m4 macro enables the use of local, smtp, and procmail as delivery agents in Sendmail by default, delivery agents are not automatically declared. With this feature, you can specify which ones you want to support and which ones to ignore. The MAILER(`local'), MAILER(`smtp'), and MAILER(`procmail') options cause support for local, smtp, esmtp, smtp8, relay delivery agents and procmail to be included. It's important to note that MAILER(`smtp') should always precede MAILER(`procmail').
