Настройка exim4 для отправки писем через gmail в Debian Squeeze.
root@test:~# dpkg-reconfigure exim4-config
Package configuration ┌───────────────────────┤ Mail Server configuration ├───────────────────────┐ │ │ │ Please select the mail server configuration type that best meets your │ │ needs. │ │ │ │ Systems with dynamic IP addresses, including dialup systems, should │ │ generally be configured to send outgoing mail to another machine, called │ │ a 'smarthost' for delivery because many receiving systems on the │ │ Internet block incoming mail from dynamic IP addresses as spam │ │ protection. │ │ │ │ A system with a dynamic IP address can receive its own mail, or local │ │ delivery can be disabled entirely (except mail for root and postmaster). │ │ │ │ <Ok> │ │ │ └───────────────────────────────────────────────────────────────────────────┘
Package configuration
┌─────────────────────┤ Mail Server configuration ├─────────────────────┐
│ General type of mail configuration: │
│ │
│ internet site; mail is sent and received directly using SMTP │
│ mail sent by smarthost; received via SMTP or fetchmail │
│ mail sent by smarthost; no local mail │
│ local delivery only; not on a network │
│ no configuration at this time │
│ │
│ │
│ <Ok> <Cancel> │
│ │
└───────────────────────────────────────────────────────────────────────┘
Package configuration ┌───────────────────────┤ Mail Server configuration ├───────────────────────┐ │ The 'mail name' is the domain name used to 'qualify' mail addresses │ │ without a domain name. │ │ │ │ This name will also be used by other programs. It should be the single, │ │ fully qualified domain name (FQDN). │ │ │ │ Thus, if a mail address on the local host is foo@example.org, the │ │ correct value for this option would be example.org. │ │ │ │ This name won't appear on From: lines of outgoing messages if rewriting │ │ is enabled. │ │ │ │ System mail name: │ │ │ │ test_____________________________________________________________________ │ │ │ │ <Ok> <Cancel> │ │ │ └───────────────────────────────────────────────────────────────────────────┘
Package configuration ┌───────────────────────┤ Mail Server configuration ├───────────────────────┐ │ Please enter a semicolon-separated list of IP addresses. The Exim SMTP │ │ listener daemon will listen on all IP addresses listed here. │ │ │ │ An empty value will cause Exim to listen for connections on all │ │ available network interfaces. │ │ │ │ If this system only receives mail directly from local services (and not │ │ from other hosts), it is suggested to prohibit external connections to │ │ the local Exim daemon. Such services include e-mail programs (MUAs) │ │ which talk to localhost only as well as fetchmail. External connections │ │ are impossible when 127.0.0.1 is entered here, as this will disable │ │ listening on public network interfaces. │ │ │ │ IP-addresses to listen on for incoming SMTP connections: │ │ │ │ 127.0.0.1 ;______________________________________________________________ │ │ │ │ <Ok> <Cancel> │ │ │ └───────────────────────────────────────────────────────────────────────────┘
Package configuration
┌───────────────────────┤ Mail Server configuration ├───────────────────────┐
│ Please enter a semicolon-separated list of recipient domains for which │
│ this machine should consider itself the final destination. These domains │
│ are commonly called 'local domains'. The local hostname (test) and │
│ 'localhost' are always added to the list given here. │
│ │
│ By default all local domains will be treated identically. If both │
│ a.example and b.example are local domains, acc@a.example and │
│ acc@b.example will be delivered to the same final destination. If │
│ different domain names should be treated differently, it is necessary to │
│ edit the config files afterwards. │
│ │
│ Other destinations for which mail is accepted: │
│ │
│ _________________________________________________________________________ │
│ │
│ <Ok> <Cancel> │
│ │
└───────────────────────────────────────────────────────────────────────────┘
Если ваш хост имеет другие доменные имена. То самое время их ввести(разделитель ;)
Т.к как у меня нет то я оставляю это поле пустым.
Package configuration
┌───────────────────────┤ Mail Server configuration ├───────────────────────┐
│ Please enter a semicolon-separated list of IP address ranges for which │
│ this system will unconditionally relay mail, functioning as a smarthost. │
│ │
│ You should use the standard address/prefix format (e.g. 194.222.242.0/24 │
│ or 5f03:1200:836f::/48). │
│ │
│ If this system should not be a smarthost for any other host, leave this │
│ list blank. │
│ │
│ Machines to relay mail for: │
│ │
│ smtp.gmail.com::587______________________________________________________ │
│ │
│ <Ok> <Cancel> │
│ │
└───────────────────────────────────────────────────────────────────────────┘
ackage configuration
┌───────────────────────┤ Mail Server configuration ├───────────────────────┐
│ │
│ The headers of outgoing mail can be rewritten to make it appear to have │
│ been generated on a different system. If this option is chosen, 'test', │
│ 'localhost' and '' in From, Reply-To, Sender and Return-Path are │
│ rewritten. │
│ │
│ Hide local mail name in outgoing mail? │
│ │
│ <Yes> <No> │
│ │
└───────────────────────────────────────────────────────────────────────────┘
Package configuration
┌──────────────────────┤ Mail Server configuration ├───────────────────────┐
│ │
│ In normal mode of operation Exim does DNS lookups at startup, and when │
│ receiving or delivering messages. This is for logging purposes and │
│ allows keeping down the number of hard-coded values in the │
│ configuration. │
│ │
│ If this system does not have a DNS full service resolver available at │
│ all times (for example if its Internet access is a dial-up line using │
│ dial-on-demand), this might have unwanted consequences. For example, │
│ starting up Exim or running the queue (even with no messages waiting) │
│ might trigger a costly dial-up-event. │
│ │
│ This option should be selected if this system is using Dial-on-Demand. │
│ If it has always-on Internet access, this option should be disabled. │
│ │
│ Keep number of DNS-queries minimal (Dial-on-Demand)? │
│ │
│ <Yes> <No> │
│ │
└──────────────────────────────────────────────────────────────────────────┘
Package configuration
┌───────────────────────┤ Mail Server configuration ├───────────────────────┐
│ Exim is able to store locally delivered email in different formats. The │
│ most commonly used ones are mbox and Maildir. mbox uses a single file │
│ for the complete mail folder stored in /var/mail/. With Maildir format │
│ every single message is stored in a separate file in ~/Maildir/. │
│ │
│ Please note that most mail tools in Debian expect the local delivery │
│ method to be mbox in their default. │
│ │
│ Delivery method for local mail: │
│ │
│ mbox format in /var/mail/ │
│ Maildir format in home directory │
│ │
│ │
│ <Ok> <Cancel> │
│ │
└───────────────────────────────────────────────────────────────────────────┘
Package configuration
┌───────────────────────┤ Mail Server configuration ├───────────────────────┐
│ │
│ The Debian exim4 packages can either use 'unsplit configuration', a │
│ single monolithic file (/etc/exim4/exim4.conf.template) or 'split │
│ configuration', where the actual Exim configuration files are built from │
│ about 50 smaller files in /etc/exim4/conf.d/. │
│ │
│ Unsplit configuration is better suited for large modifications and is │
│ generally more stable, whereas split configuration offers a comfortable │
│ way to make smaller modifications but is more fragile and might break if │
│ modified carelessly. │
│ │
│ A more detailed discussion of split and unsplit configuration can be │
│ found in the Debian-specific README files in /usr/share/doc/exim4-base. │
│ │
│ Split configuration into small files? │
│ │
│ <Yes> <No> │
│ │
└───────────────────────────────────────────────────────────────────────────┘
Используя ваш любимый редактор в файл /etc/exim4/passwd.client
Добавляем строчку *.google.com:Логин@gmail.com:Пароль
После чего выполняем команду
root@test:~# update-exim4.conf
локальный_пользователь:почтовый_псевдоним.
Вот так я получаю на свой email сообщения от системы.
И отчеты работы утилиты logcheck.
Как настроить logcheck читаем logcheck держим руку на пульсе. Установка в Debian. Аудит журналов Linux.
А можно ли как-то использовать локальный SMTP-сервер, не пользуясь gmail-ом? Какие вообще есть SMTP-сервера?
ОтветитьУдалитьЯ не очень много смысла вижу использовать забугорный сервер, который в любом момент может упасть (или забанить твою учётку)
1. Да можно, но насколько это необходимо?
ОтветитьУдалить2. Вообще очень много обзор смотрите тут http://en.wikipedia.org/wiki/Comparison_of_mail_servers
3. Для недоверчивого человека вы слишком активно пользуйтесь забугорными серверами.
P.S Любой инструмент нужно выбирать исходя из задачи.
А если не получается нажать ни мышью ни enter'ом что бы это могло значить?
ОтветитьУдалитьПопробуйте tab enter
ОтветитьУдалитьА как проверить работоспособность, не дожидаясь пока система пошлёт тебе чего-нибудь?
ОтветитьУдалитьВоспользуйтесь утилитой mail
ОтветитьУдалитьecho "test" | mail -s "test" e-mailадрес