Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[risolto] check mail for bash
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian)
View previous topic :: View next topic  
Author Message
luna80
Veteran
Veteran


Joined: 01 Feb 2004
Posts: 1564
Location: switzerland

PostPosted: Tue Jan 11, 2005 5:21 pm    Post subject: [risolto] check mail for bash Reply with quote

ho seguito questo how to per avere nel mio prompt i nuovi mail, soltanto che adesso ho un problema.
nel prompt mi viene sempre visualizzato "No mail" ma se manualmente do un
Code:
$fetchmail -c

mi vengono correttamenti visualizzati i nuovi mail.
qualcuno può aiutarmi a capire come mai?

nel crontab ho fatto esattamente come spiegato nell'howto


Last edited by luna80 on Thu Jan 13, 2005 4:47 am; edited 1 time in total
Back to top
View user's profile Send private message
koma
Advocate
Advocate


Joined: 06 Jun 2003
Posts: 2702
Location: Italy

PostPosted: Tue Jan 11, 2005 8:01 pm    Post subject: Reply with quote

puoi farci un cat manuale di .mail_cunt ?
_________________
http://www.youtube.com/watch?v=_yoJI-Tl94g GLORY GLORY HYPNOTOAD
Back to top
View user's profile Send private message
koma
Advocate
Advocate


Joined: 06 Jun 2003
Posts: 2702
Location: Italy

PostPosted: Tue Jan 11, 2005 8:03 pm    Post subject: Reply with quote

e anche un
Code:
cat ~/.filefetchrc |grep message |awk '
        { acc+=$1 }
    END { if (acc==0)
             printf("No Mail");
          else if (acc==1)
             printf("1 Mail");
          else
             printf("%d Mails", acc);
        }'
Poi magari criptando o oscurando le tue mail e i tuoi pop nonchè le password anche
Code:
 cat ~/.filefetchrc

_________________
http://www.youtube.com/watch?v=_yoJI-Tl94g GLORY GLORY HYPNOTOAD
Back to top
View user's profile Send private message
luna80
Veteran
Veteran


Joined: 01 Feb 2004
Posts: 1564
Location: switzerland

PostPosted: Tue Jan 11, 2005 9:17 pm    Post subject: Reply with quote

koma wrote:
puoi farci un cat manuale di .mail_cunt ?


Code:
$cat .mail_count
No Mail


Code:
$cat ~/.filefetchrc |grep message |awk '
        { acc+=$1 }
    END { if (acc==0)
             printf("No Mail");
          else if (acc==1)
             printf("1 Mail");
          else
             printf("%d Mails", acc);
        }'
No Mail

Code:
$ cat .filefetchrc
fetchmail: no mail for luna80 at xxxx@xxx


ma da notare

Code:
$fetchmail -c
2 messages for luna80 at xxxx@xxx (11154 octets)


boh non so....magari crontab non viene eseguito? c'è magari un log? avete qualche consiglio? grazie mille!
Back to top
View user's profile Send private message
luna80
Veteran
Veteran


Joined: 01 Feb 2004
Posts: 1564
Location: switzerland

PostPosted: Tue Jan 11, 2005 9:25 pm    Post subject: Reply with quote

ho trovato ora i log:


Code:
$ more /var/log/mail.err

Jan 11 22:00:02 acertm sSMTP[7893]: Unable to locate mail
Jan 11 22:00:02 acertm sSMTP[7893]: Cannot open mail:25
Jan 11 22:05:01 acertm sSMTP[7986]: Unable to locate mail
Jan 11 22:05:01 acertm sSMTP[7986]: Cannot open mail:25
Jan 11 22:10:01 acertm sSMTP[8109]: Unable to locate mail
Jan 11 22:10:01 acertm sSMTP[8109]: Cannot open mail:25
Jan 11 22:15:01 acertm sSMTP[8184]: Unable to locate mail
Jan 11 22:15:01 acertm sSMTP[8184]: Cannot open mail:25
Jan 11 22:20:01 acertm sSMTP[8286]: Unable to locate mail
Jan 11 22:20:01 acertm sSMTP[8286]: Cannot open mail:25

...ora cerco se trovo soluzioni
Back to top
View user's profile Send private message
koma
Advocate
Advocate


Joined: 06 Jun 2003
Posts: 2702
Location: Italy

PostPosted: Tue Jan 11, 2005 10:26 pm    Post subject: Reply with quote

ti dice che non riesce a contattare la mail.
Code:
#crontab -u UTENTE -e
All'interno ho scritto questo che e' l'equivalente di un controllo ogni 5 minuti
Citazione:
*/5 * * * * check4mail -c >> /dev/null


Hai messo nel crontab giusto? nel senso è nel crontab dell'utente desiderato?
_________________
http://www.youtube.com/watch?v=_yoJI-Tl94g GLORY GLORY HYPNOTOAD
Back to top
View user's profile Send private message
luna80
Veteran
Veteran


Joined: 01 Feb 2004
Posts: 1564
Location: switzerland

PostPosted: Wed Jan 12, 2005 3:28 am    Post subject: Reply with quote

koma wrote:
ti dice che non riesce a contattare la mail.
Code:
#crontab -u UTENTE -e
All'interno ho scritto questo che e' l'equivalente di un controllo ogni 5 minuti
Citazione:
*/5 * * * * check4mail -c >> /dev/null


Hai messo nel crontab giusto? nel senso è nel crontab dell'utente desiderato?


beh credo di si,...ho fatto (da root):

Code:
# crontab -u luna80 -e
Back to top
View user's profile Send private message
luna80
Veteran
Veteran


Joined: 01 Feb 2004
Posts: 1564
Location: switzerland

PostPosted: Wed Jan 12, 2005 4:56 am    Post subject: Reply with quote

per sicurezza ho aggiunto luna80 al gruppo crontab, cmq poi effettivamente ho visto che il crontab era quello giusto anche prima.
Back to top
View user's profile Send private message
luna80
Veteran
Veteran


Joined: 01 Feb 2004
Posts: 1564
Location: switzerland

PostPosted: Wed Jan 12, 2005 5:04 pm    Post subject: Reply with quote

nessuno da darmi qualche consiglio? :cry:
Back to top
View user's profile Send private message
luna80
Veteran
Veteran


Joined: 01 Feb 2004
Posts: 1564
Location: switzerland

PostPosted: Wed Jan 12, 2005 8:08 pm    Post subject: Reply with quote

beh a furia di "darci" sono almeno riuscita a capire una cosa:

-crontab esegue correttamente checkmail e tutto va a buon fine

-nel log viene messo un errore del tipo " Jan 11 22:20:01 acertm sSMTP[8286]: Unable to locate mail
Jan 11 22:20:01 acertm sSMTP[8286]: Cannot open mail:25"
perchè credo tenti di spedire un qualche mail di log ma non trova i dati che gli servono (giustamente dato che per ssmtp non ho impostato assolutamente niente e per quello che voglio fare non mi serve). ora questo errore non l'ho più perchè ho aggiunto MAILTO="" a crontab

ho scoperto che il VERO problema è che il prompt bash non viene aggiornato con il numero di mail, se invece apro una nuova shell allora li avrò il numero corretto.
ora devo capire il perchè di questo.

(questo thread è quasi un monologo, eheheheh,...scherzo koma!!! :) :wink: )


Last edited by luna80 on Wed Jan 12, 2005 8:21 pm; edited 1 time in total
Back to top
View user's profile Send private message
koma
Advocate
Advocate


Joined: 06 Jun 2003
Posts: 2702
Location: Italy

PostPosted: Wed Jan 12, 2005 8:11 pm    Post subject: Reply with quote

scusami ma in questi gorni sono davvero molto preso purtroppo non ho nemmeno il tempo per cenare
Appena ho tempo guardo prometto
_________________
http://www.youtube.com/watch?v=_yoJI-Tl94g GLORY GLORY HYPNOTOAD
Back to top
View user's profile Send private message
luna80
Veteran
Veteran


Joined: 01 Feb 2004
Posts: 1564
Location: switzerland

PostPosted: Wed Jan 12, 2005 8:19 pm    Post subject: Reply with quote

koma wrote:
scusami ma in questi gorni sono davvero molto preso purtroppo non ho nemmeno il tempo per cenare
Appena ho tempo guardo prometto


non preoccuparti ci mancherebbe!!!
era soltanto una battuta perchè gli ultimi messaggi me li ero autoscritti senza avere altre risposte da altri, ti ho messo nella battuta perchè eri stato l'unico a rispondermi!

se risolvo da sola poi ho più soddisfazioni...eheheh

ciao
Back to top
View user's profile Send private message
Jecko_Hee
Tux's lil' helper
Tux's lil' helper


Joined: 20 Aug 2003
Posts: 142
Location: Svizzera/Ticino

PostPosted: Wed Jan 12, 2005 8:30 pm    Post subject: Reply with quote

luna80 wrote:


ho scoperto che il VERO problema è che il prompt bash non viene aggiornato con il numero di mail


ciao, il resto funziona? i files .filefetchrc .mail_count sono aggiornati correttamente?

potresti postare il tuo .bashrc?

Ciao
_________________
Negli anni 60 una delle tante ragazze di Fonzie, dopo aver fatto "petting", gli disse: "FONZIE, SE NON TI LECCHI LE DITA GODI SOLO A META'!"

EVITIAMO GLI OT - LINEE GUIDA DEL FORUM
Back to top
View user's profile Send private message
luna80
Veteran
Veteran


Joined: 01 Feb 2004
Posts: 1564
Location: switzerland

PostPosted: Wed Jan 12, 2005 8:59 pm    Post subject: Reply with quote

Jecko_Hee wrote:
luna80 wrote:


ho scoperto che il VERO problema è che il prompt bash non viene aggiornato con il numero di mail


ciao, il resto funziona? i files .filefetchrc .mail_count sono aggiornati correttamente?

potresti postare il tuo .bashrc?

Ciao


come non detto, :oops: :oops: :oops: :oops: :oops: :oops: :oops:
insomma, il punto è questo:

se faccio manualmente ($checkmail -c) funziona, mentre con il crontab no, i file non vengono aggiornati.

il problema del prompt l'ho sistemato facendomi ritornare il cat da una funzione e ora aggiorna correttamente, il perchè prima non lo facesse rimane un mistero.
Back to top
View user's profile Send private message
koma
Advocate
Advocate


Joined: 06 Jun 2003
Posts: 2702
Location: Italy

PostPosted: Wed Jan 12, 2005 9:04 pm    Post subject: Reply with quote

quindi ora funziona?
_________________
http://www.youtube.com/watch?v=_yoJI-Tl94g GLORY GLORY HYPNOTOAD
Back to top
View user's profile Send private message
luna80
Veteran
Veteran


Joined: 01 Feb 2004
Posts: 1564
Location: switzerland

PostPosted: Wed Jan 12, 2005 9:09 pm    Post subject: Reply with quote

koma wrote:
quindi ora funziona?


no, mi sa che non so spiegarmi!

crontab non aggiorna
Back to top
View user's profile Send private message
Jecko_Hee
Tux's lil' helper
Tux's lil' helper


Joined: 20 Aug 2003
Posts: 142
Location: Svizzera/Ticino

PostPosted: Wed Jan 12, 2005 9:37 pm    Post subject: Reply with quote

luna80 wrote:

crontab non aggiorna


Prova a mettere il path completo al crontab, a me non lo trovava cosi'.

Code:
*/5 * * * * /usr/local/bin/check4mail -c >> /dev/null

_________________
Negli anni 60 una delle tante ragazze di Fonzie, dopo aver fatto "petting", gli disse: "FONZIE, SE NON TI LECCHI LE DITA GODI SOLO A META'!"

EVITIAMO GLI OT - LINEE GUIDA DEL FORUM
Back to top
View user's profile Send private message
luna80
Veteran
Veteran


Joined: 01 Feb 2004
Posts: 1564
Location: switzerland

PostPosted: Thu Jan 13, 2005 4:46 am    Post subject: Reply with quote

Jecko_Hee wrote:
luna80 wrote:

crontab non aggiorna


Prova a mettere il path completo al crontab, a me non lo trovava cosi'.

Code:
*/5 * * * * /usr/local/bin/check4mail -c >> /dev/null


infatti, è la cosa che mi è venuta in mente questa mattina, ho provato ed è andata! potevo anche arrivarci prima però....va beh
:D

grazie mille sia a te che a koma!
Back to top
View user's profile Send private message
luna80
Veteran
Veteran


Joined: 01 Feb 2004
Posts: 1564
Location: switzerland

PostPosted: Thu Jan 13, 2005 6:32 am    Post subject: Reply with quote

in ogni caso ora ho visto un'altra cosa interessante che può essere utile anche ad altri:

cron va a sccrivere gli errori eventualmente ritornati nel file ~/dead.letter

se lo avessi scoperto prima il problema l'avrei risolto forse in 2 minuti...



:evil: :oops: :roll: :D
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum