ALT Linux Community general discussions
 help / color / mirror / Atom feed
* [Comm] отправить mail в скрипте
@ 2009-10-07 15:16 Коротков Георгий
  2009-10-07 15:24 ` Andrey Rahmatullin
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Коротков Георгий @ 2009-10-07 15:16 UTC (permalink / raw)
  To: community

хочу написать письмо в скрипте
в качестве содержимого письма - текст на русском языке
пишу в консоли
cat warn.txt | mail -s "Статистика" george@domain.ru

писмо уходит, получатель получает, в содержимом - искомый кирилический текст
запиховываю тоже самое в скрипт для запуска по крону
и после запуска получаю ошибку на рута

Invalid or incomplete multibyte or wide character
. . . message not sent.

если в warn.txt писать текст на англ то все отлично и по крону
где подпилить?




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Comm] отправить mail в скрипте
  2009-10-07 15:16 [Comm] отправить mail в скрипте Коротков Георгий
@ 2009-10-07 15:24 ` Andrey Rahmatullin
  2009-10-07 15:51   ` Dmitriy Kruglikov
  2009-10-07 16:00 ` Sergey
  2009-10-07 16:08 ` Sergey
  2 siblings, 1 reply; 10+ messages in thread
From: Andrey Rahmatullin @ 2009-10-07 15:24 UTC (permalink / raw)
  To: community

[-- Attachment #1: Type: text/plain, Size: 402 bytes --]

On Wed, Oct 07, 2009 at 08:16:17PM +0500, Коротков Георгий wrote:
> где подпилить?
Использовать mutt вместо mailx.

-- 
WBR, wRAR (ALT Linux Team)
Powered by the ALT Linux fortune(6):

<hiddenman> gns: а ты какой брат по счету? есть подозрения, что третий
<gns> hiddenman: старшой
<hiddenman> gns: кто ж тогда дурак? :)
<gns> hiddenman: его не стали делать :)
<hiddenman> gns: а. умнО ;-)

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Comm] отправить mail в скрипте
  2009-10-07 15:24 ` Andrey Rahmatullin
@ 2009-10-07 15:51   ` Dmitriy Kruglikov
  2009-10-07 15:53     ` Michael Shigorin
  0 siblings, 1 reply; 10+ messages in thread
From: Dmitriy Kruglikov @ 2009-10-07 15:51 UTC (permalink / raw)
  To: ALT Linux Community general discussions

7 октября 2009 г. 18:24 пользователь Andrey Rahmatullin  написал:
> Использовать mutt вместо mailx.
Будет значительно лучше ...
Но мне не удалось заставить mutt правильно писать
Content-Type:
Пишет charset=unknown-8bit
а хочется
Content-Type: text/plain; charset="koi8-r"

Из-за этого некоторые почтовые WEB-клиенты (в частности, RoundCube)
обламываются ...
Может быть, по ходу дела, кто-то подскажет?

-- 
Как правильно задавать вопросы:
http://maddog.sitengine.ru/smart-question-ru.html

Помогает:
http://search.altlinux.org

Best regards,
 Dmitriy Kruglikov
 Dmitriy.Kruglikov_at_gmail_dot_com
 XMPP: Dmitriy.Kruglikov_at_gmail_dot_com

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Comm] отправить mail в скрипте
  2009-10-07 15:51   ` Dmitriy Kruglikov
@ 2009-10-07 15:53     ` Michael Shigorin
  2009-10-07 16:00       ` Dmitriy Kruglikov
  0 siblings, 1 reply; 10+ messages in thread
From: Michael Shigorin @ 2009-10-07 15:53 UTC (permalink / raw)
  To: ALT Linux Community general discussions

On Wed, Oct 07, 2009 at 06:51:41PM +0300, Dmitriy Kruglikov wrote:
> > Использовать mutt вместо mailx.
> Будет значительно лучше ...  Но мне не удалось заставить mutt
> правильно писать Content-Type:
> Пишет charset=unknown-8bit а хочется
> Content-Type: text/plain; charset="koi8-r"

Наблюдаю:

.mutt/set:set charset=koi8-u
.mutt/set:set send_charset="us-ascii:iso-8859-1:koi8-r:koi8-u:windows-1251:utf-8"

-- 
 ---- WBR, Michael Shigorin <mike@altlinux.ru>
  ------ Linux.Kiev http://www.linux.kiev.ua/


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Comm] отправить mail в скрипте
  2009-10-07 15:16 [Comm] отправить mail в скрипте Коротков Георгий
  2009-10-07 15:24 ` Andrey Rahmatullin
@ 2009-10-07 16:00 ` Sergey
  2009-10-08  9:48   ` Коротков Георгий
  2009-10-07 16:08 ` Sergey
  2 siblings, 1 reply; 10+ messages in thread
From: Sergey @ 2009-10-07 16:00 UTC (permalink / raw)
  To: ALT Linux Community general discussions

On Wednesday 07 October 2009, Коротков Георгий wrote:

> где подпилить?

Ещё как вариант, сформировать полностью письмо с заголовком. После
чего (ох, сейчас закидают :-) ):

cat email.txt | sendmail -it

-- 
С уважением, Сергей
a_s_y@sama.ru


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Comm] отправить mail в скрипте
  2009-10-07 15:53     ` Michael Shigorin
@ 2009-10-07 16:00       ` Dmitriy Kruglikov
  2009-10-07 16:08         ` Michael Shigorin
  0 siblings, 1 reply; 10+ messages in thread
From: Dmitriy Kruglikov @ 2009-10-07 16:00 UTC (permalink / raw)
  To: shigorin, ALT Linux Community general discussions

7 октября 2009 г. 18:53 пользователь Michael Shigorin написал:

> Наблюдаю:
>
Это ты прям в Муте  наблюдаешь ...
> .mutt/set:set charset=koi8-u
> .mutt/set:set send_charset="us-ascii:iso-8859-1:koi8-r:koi8-u:windows-1251:utf-8"
А если у меня cron мыло шлет ?
Как ему пронаблюдать?

При этом, у рута:
# cat .muttrc
set send_charset=koi8-r
set allow_8bit

Но мыло приходит с
Mime-Version: 1.0
Content-Type: text/plain; charset=unknown-8bit
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
Почтовый клиент: Mutt/1.4.2.3i

Нешто я не гуглил?
Может быть не очень настырно...
-- 
Как правильно задавать вопросы:
http://maddog.sitengine.ru/smart-question-ru.html

Помогает:
http://search.altlinux.org

Best regards,
 Dmitriy Kruglikov
 Dmitriy.Kruglikov_at_gmail_dot_com
 XMPP: Dmitriy.Kruglikov_at_gmail_dot_com

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Comm] отправить mail в скрипте
  2009-10-07 16:00       ` Dmitriy Kruglikov
@ 2009-10-07 16:08         ` Michael Shigorin
  0 siblings, 0 replies; 10+ messages in thread
From: Michael Shigorin @ 2009-10-07 16:08 UTC (permalink / raw)
  To: ALT Linux Community general discussions

On Wed, Oct 07, 2009 at 07:00:51PM +0300, Dmitriy Kruglikov wrote:
> > Наблюдаю:
> Это ты прям в Муте  наблюдаешь ...

Точнее, в настройках вот этого самого мутта.

> > .mutt/set:set charset=koi8-u
> > .mutt/set:set send_charset="us-ascii:iso-8859-1:koi8-r:koi8-u:windows-1251:utf-8"
> А если у меня cron мыло шлет ?  Как ему пронаблюдать?

_Возможно_, при определении типа скормленного нужна подходящая
локаль.  Не уверен.

> При этом, у рута:
> # cat .muttrc
> set send_charset=koi8-r

Насколько понимаю muttrc(5), set charset влияет не только
на отображение:

charset
      Type: string
      Default:

      Character set your terminal uses to display  and  enter  textual
      data.  It is also the fallback for $send_charset.

      Upon  startup  Mutt  tries to derive this value from environment
      variables such as $LC_CTYPE or $LANG.

      Note: It should only be set in case Mutt isn't abled  to  deter-
      mine the character set used correctly.

> set allow_8bit

-- 
 ---- WBR, Michael Shigorin <mike@altlinux.ru>
  ------ Linux.Kiev http://www.linux.kiev.ua/


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Comm] отправить mail в скрипте
  2009-10-07 15:16 [Comm] отправить mail в скрипте Коротков Георгий
  2009-10-07 15:24 ` Andrey Rahmatullin
  2009-10-07 16:00 ` Sergey
@ 2009-10-07 16:08 ` Sergey
  2009-10-07 16:22   ` Sergey
  2 siblings, 1 reply; 10+ messages in thread
From: Sergey @ 2009-10-07 16:08 UTC (permalink / raw)
  To: ALT Linux Community general discussions

On Wednesday 07 October 2009, Коротков Георгий wrote:

> cat warn.txt | mail -s "Статистика" george@domain.ru
> 
> Invalid or incomplete multibyte or wide character
> . . . message not sent.

Стоп. Так, может, тут кто-то Subject проверяет ? Если поменять на

cat warn.txt | mail -s "=?koi8-r?b?89TB1MnT1MnLwQ==?=" george@domain.ru

что будет ?

-- 
С уважением, Сергей
a_s_y@sama.ru


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Comm] отправить mail в скрипте
  2009-10-07 16:08 ` Sergey
@ 2009-10-07 16:22   ` Sergey
  0 siblings, 0 replies; 10+ messages in thread
From: Sergey @ 2009-10-07 16:22 UTC (permalink / raw)
  To: ALT Linux Community general discussions

On Wednesday 07 October 2009, Sergey wrote:
> On Wednesday 07 October 2009, Коротков Георгий wrote:
> 
> > cat warn.txt | mail -s "Статистика" george@domain.ru
> > 
> > Invalid or incomplete multibyte or wide character
> > . . . message not sent.
> 
> Стоп. Так, может, тут кто-то Subject проверяет ? Если поменять на
> 
> cat warn.txt | mail -s "=?koi8-r?b?89TB1MnT1MnLwQ==?=" george@domain.ru

Или, даже

cat warn.txt | mail -s "=?koi8-r?b?89TB1MnT1MnLwQ==?=" \
 -a 'Content-Type: text/plain; charset="koi8-r"' \
 -a 'Content-Transfer-Encoding: 8bit' \
 george@domain.ru

Только вот тут придётся сделать apt-get install mailutils: кажется, в
mailx нет -a

-- 
С уважением, Сергей
a_s_y@sama.ru


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Comm] отправить mail в скрипте
  2009-10-07 16:00 ` Sergey
@ 2009-10-08  9:48   ` Коротков Георгий
  0 siblings, 0 replies; 10+ messages in thread
From: Коротков Георгий @ 2009-10-08  9:48 UTC (permalink / raw)
  To: ALT Linux Community general discussions

Sergey пишет:
> Ещё как вариант, сформировать полностью письмо с заголовком. После
> чего (ох, сейчас закидают :-) ):
>
> cat email.txt | sendmail -it
>
>   
это оказалось самым простым и главное рабочим решением, спсб :)



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2009-10-08  9:48 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-07 15:16 [Comm] отправить mail в скрипте Коротков Георгий
2009-10-07 15:24 ` Andrey Rahmatullin
2009-10-07 15:51   ` Dmitriy Kruglikov
2009-10-07 15:53     ` Michael Shigorin
2009-10-07 16:00       ` Dmitriy Kruglikov
2009-10-07 16:08         ` Michael Shigorin
2009-10-07 16:00 ` Sergey
2009-10-08  9:48   ` Коротков Георгий
2009-10-07 16:08 ` Sergey
2009-10-07 16:22   ` Sergey

ALT Linux Community general discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/community/0 community/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 community community/ http://lore.altlinux.org/community \
		mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com
	public-inbox-index community

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.community


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git