Jump to content

Email/Gmail backup using getmail


MTA99

Recommended Posts

You don't have to search far on the net to find stories of people losing access to their Google accounts. All my docs, photos, pdfs and other files stored on Google's servers are backed up on my unRAID box but my GMail is the weak link. I looked at Gmail-Backup and backupify but that's not the spirit of unRAID. Our unRAID boxes are more than capable.

 

A quick search found these guides for connecting getmail to GMail over POP or IMAP

 

http://scottlinux.com/2011/02/28/backup-gmail-account-in-linux/

and

http://blog.pengdeng.com/2008/03/backup-gmail-via-imap-using-getmail_16.html

 

I've downloaded this getmail package and installed it....

 

http://slackware.cs.utah.edu/pub/slackware/slackware-13.1/slackware/n/getmail-4.17.0-i486-1.txz

 

....then created the backup folder, blank mail files and the config. The application will connect to GMail but won't download because the built-in security won't allow download as root.

 

So the question is, how can I run as a "normal" user?

 

 

Link to comment

You don't have to search far on the net to find stories of people losing access to their Google accounts. All my docs, photos, pdfs and other files stored on Google's servers are backed up on my unRAID box but my GMail is the weak link. I looked at Gmail-Backup and backupify but that's not the spirit of unRAID. Our unRAID boxes are more than capable.

 

A quick search found these guides for connecting getmail to GMail over POP or IMAP

 

http://scottlinux.com/2011/02/28/backup-gmail-account-in-linux/

and

http://blog.pengdeng.com/2008/03/backup-gmail-via-imap-using-getmail_16.html

 

I've downloaded this getmail package and installed it....

 

http://slackware.cs.utah.edu/pub/slackware/slackware-13.1/slackware/n/getmail-4.17.0-i486-1.txz

 

....then created the backup folder, blank mail files and the config. The application will connect to GMail but won't download because the built-in security won't allow download as root.

 

So the question is, how can I run as a "normal" user?

 

 

 

I have no knowledge on getmail but you will probably have to do something like what I do in the SABnzb unMenu package to start it as nobody.

 

I do this:

chown -R nobody:users ****THE FOLDER with GETMAIL OR THE GETMAIL APP****
chown -R nobody:users ****WHATEVER FOLDER YOU ARE PLACING STUFF IN****
su nobody -c "****START THE APPLICATION****"

Link to comment

Whenever i try

 

su nobody -c "/usr/bin/getmail -g /mnt/disk2/.getmail -r getmail.conf"

(-g sets alternative install DIR, -r gives name of config file)

 

or even switching user to nobody and running the command there I get the following error.....

 

Error: Specified config/data dir "/mnt/disk2/.getmail/" does not exist - create or specify alternate directory with --getmaildir option

 

It does exist! I can cd to it as root or nobody and ls the contents. If I run the exact same command as root, getmail connects but won't download due to security.

 

I've chown'd the folder and checked the permissions in WinSCP. I've got ProStuff's SAB conf open to copy the procedure. Can't see what I've missed.

Link to comment

Whenever i try

 

su nobody -c "/usr/bin/getmail -g /mnt/disk2/.getmail -r getmail.conf"

(-g sets alternative install DIR, -r gives name of config file)

 

or even switching user to nobody and running the command there I get the following error.....

 

Error: Specified config/data dir "/mnt/disk2/.getmail/" does not exist - create or specify alternate directory with --getmaildir option

 

It does exist! I can cd to it as root or nobody and ls the contents. If I run the exact same command as root, getmail connects but won't download due to security.

 

I've chown'd the folder and checked the permissions in WinSCP. I've got ProStuff's SAB conf open to copy the procedure. Can't see what I've missed.

Did you do the usermod -s part?

Link to comment

Did you do the usermod -s part?

 

Not initially but after I opened the SAB conf I saw it and ran it. Presume it only needs to be run once, not before every launch?

 

Um, not honestly sure since I do not know how getmail is installed. I would probably do it on every boot, actually I think you probably have to.

Link to comment

This is just a shot in the dark, but try setting up a regular user. Disable login for the user. You could give the user the same login as the gmail account.

 

EDIT: Is the password only digits and chars?

 

I'll give that a shot. Will I be able to telnet into my box if I have logins disabled? Password is handled by conf file. I use Google's 2-step verification and application specific passwords. All regular A-Z characters

 

How about:

 

su -c '/usr/bin/getmail -g /mnt/disk2/.getmail -r getmail.conf' nobody

 

??

 

Was sure I tried that previously (as outlined on various command guides) but just ran again and it seems to ignore the nobody part, acting as root.........well I get the refusal error due to root access. Its not to say my nobody account isn't broken  :P

Link to comment
I'll give that a shot. Will I be able to telnet into my box if I have logins disabled? Password is handled by conf file. I use Google's 2-step verification and application specific passwords. All regular A-Z characters

 

Don't disable all logins. Just for this user or don't worry about it if you don't allow incoming access from the Internet.

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...